mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
Stmt -> Expr in interpretation only
This commit is contained in:
parent
eae2367371
commit
d0c72844e8
9 changed files with 310 additions and 310 deletions
|
|
@ -7,9 +7,9 @@ RC=../src/rc.opt
|
|||
check: $(TESTS)
|
||||
|
||||
$(TESTS): %: %.expr
|
||||
@$(RC) $< && cat $@.input | ./$@ > $@.log && diff $@.log orig/$@.log
|
||||
#@$(RC) $< && cat $@.input | ./$@ > $@.log && diff $@.log orig/$@.log
|
||||
@cat $@.input | $(RC) -i $< > $@.log && diff $@.log orig/$@.log
|
||||
@cat $@.input | $(RC) -s $< > $@.log && diff $@.log orig/$@.log
|
||||
#@cat $@.input | $(RC) -s $< > $@.log && diff $@.log orig/$@.log
|
||||
|
||||
clean:
|
||||
$(RM) test*.log *.s *~ $(TESTS)
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ RC = ../../src/rc.opt
|
|||
check: $(TESTS)
|
||||
|
||||
$(TESTS): %: %.expr
|
||||
@RC_RUNTIME=../../runtime $(RC) $< && cat $@.input | ./$@ > $@.log && diff $@.log orig/$@.log
|
||||
#@RC_RUNTIME=../../runtime $(RC) $< && cat $@.input | ./$@ > $@.log && diff $@.log orig/$@.log
|
||||
@cat $@.input | $(RC) -i $< > $@.log && diff $@.log orig/$@.log
|
||||
@cat $@.input | $(RC) -s $< > $@.log && diff $@.log orig/$@.log
|
||||
#@cat $@.input | $(RC) -s $< > $@.log && diff $@.log orig/$@.log
|
||||
|
||||
clean:
|
||||
rm -f *.log *.s *~
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ RC = ../../src/rc.opt
|
|||
check: $(TESTS)
|
||||
|
||||
$(TESTS): %: %.expr
|
||||
@RC_RUNTIME=../../runtime $(RC) $< && cat $@.input | ./$@ > $@.log && diff $@.log orig/$@.log
|
||||
#@RC_RUNTIME=../../runtime $(RC) $< && cat $@.input | ./$@ > $@.log && diff $@.log orig/$@.log
|
||||
@cat $@.input | $(RC) -i $< > $@.log && diff $@.log orig/$@.log
|
||||
@cat $@.input | $(RC) -s $< > $@.log && diff $@.log orig/$@.log
|
||||
#@cat $@.input | $(RC) -s $< > $@.log && diff $@.log orig/$@.log
|
||||
|
||||
clean:
|
||||
rm -f *.log *.s *~
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ x := "abcdefgh";
|
|||
printString (x);
|
||||
|
||||
for i:=0, i<x.length, i:=i+1 do
|
||||
x[i] := x[i]+2
|
||||
x[i] := x[i]+2
|
||||
od;
|
||||
|
||||
printString (x)
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ fun find (t, x) {
|
|||
case t of
|
||||
Leaf -> return 0
|
||||
| Node (y, l, r) -> if x == y then return 1
|
||||
elif x > y then return find (l, x)
|
||||
else return find (r, x)
|
||||
fi
|
||||
elif x > y then return find (l, x)
|
||||
else return find (r, x)
|
||||
fi
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ case 1 of
|
|||
| a@3 -> write (a)
|
||||
| a@2 -> write (a)
|
||||
| a@1 -> write (a)
|
||||
| a@0 -> write (a)
|
||||
| a@0 -> write (a)
|
||||
esac;
|
||||
|
||||
case A (1, 2, 3) of
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue