FSF in SM (only obe-level closure yet)

This commit is contained in:
Dmitry Boulytchev 2019-10-11 17:25:58 +03:00
parent 89e0d04f3d
commit 4fec2aa29e
8 changed files with 160 additions and 53 deletions

View file

@ -1,4 +1,4 @@
TESTS=$(basename $(wildcard test*.expr))
TESTS=$(sort $(basename $(wildcard test*.expr)))
RC=../src/rc.opt
@ -10,7 +10,7 @@ $(TESTS): %: %.expr
@echo $@
# @$(RC) $< && cat $@.input | ./$@ > $@.log && diff $@.log orig/$@.log
cat $@.input | $(RC) -i $< > $@.log && diff $@.log orig/$@.log
@cat $@.input | $(RC) -s $< 2> /dev/null > $@.log && diff $@.log orig/$@.log; true
cat $@.input | $(RC) -s $< 2> /dev/null > $@.log && diff $@.log orig/$@.log
clean:
$(RM) test*.log *.s *~ $(TESTS)

View file

@ -0,0 +1,2 @@
> 2
1

21
regression/test065.expr Normal file
View file

@ -0,0 +1,21 @@
fun f () {
local x, l = {};
fun g () {return x}
x := 1;
l := g : l;
x := 2;
l := g : l;
return l
}
fun p (l) {
case l of
{} -> skip
| h : tl -> write (h ()); p (tl)
esac
}
p (f ())

1
regression/test065.input Normal file
View file

@ -0,0 +1 @@
5