Procedures in interpretation

This commit is contained in:
Dmitry Boulytchev 2018-03-27 01:51:22 +03:00
parent 30697f19eb
commit b4ef95c8bc
22 changed files with 337 additions and 188 deletions

18
regression/test029.expr Normal file
View file

@ -0,0 +1,18 @@
fun fib (n) local r {
if n <= 1
then result := 1
else
fib (n-1);
r := result;
fib (n-2);
result := result + r
fi
}
read (n);
for i := n, i >= 1, i := i-1 do
fib (i);
write (i);
write (result)
od