mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-29 18:18:21 +00:00
Control statement (interpreter, SM, x86)
This commit is contained in:
parent
42d94672bc
commit
8758485b80
15 changed files with 132 additions and 55 deletions
|
|
@ -1,4 +1,4 @@
|
|||
TESTS=test001 test002 test003 test004 test005 test006 test007 test008
|
||||
TESTS=test001 test002 test003 test004 test005 test006 test007 test008 test009 test010 test011
|
||||
|
||||
RC=../src/rc.opt
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
2
|
||||
1024
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
1024
|
||||
499950
|
||||
|
|
|
|||
|
|
@ -1,3 +1 @@
|
|||
5
|
||||
5
|
||||
3
|
||||
2
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
499950
|
||||
8
regression/test009.expr
Normal file
8
regression/test009.expr
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
n := 2;
|
||||
k := 10;
|
||||
res := 1;
|
||||
while k > 0 do
|
||||
res := res * n;
|
||||
k := k - 1
|
||||
od;
|
||||
write(res)
|
||||
0
regression/test009.input
Normal file
0
regression/test009.input
Normal file
18
regression/test010.expr
Normal file
18
regression/test010.expr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
i := 0;
|
||||
s := 0;
|
||||
|
||||
while i < 100
|
||||
do
|
||||
j := 0;
|
||||
|
||||
while j < 100
|
||||
do
|
||||
s := s + j;
|
||||
j := j + 1
|
||||
od;
|
||||
|
||||
s := s + i;
|
||||
i := i + 1
|
||||
od;
|
||||
|
||||
write (s)
|
||||
0
regression/test010.input
Normal file
0
regression/test010.input
Normal file
5
regression/test011.expr
Normal file
5
regression/test011.expr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
x:=0;
|
||||
if x
|
||||
then write(1)
|
||||
else write(2)
|
||||
fi
|
||||
0
regression/test011.input
Normal file
0
regression/test011.input
Normal file
Loading…
Add table
Add a link
Reference in a new issue