'as' pattern

This commit is contained in:
Dmitry Boulytchev 2018-11-05 18:21:41 +03:00
parent be89ee983a
commit 8a4874797b
8 changed files with 89 additions and 31 deletions

View file

@ -7,9 +7,9 @@ RC=../src/rc.opt
check: $(TESTS)
$(TESTS): %: %.expr
@$(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
$(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
clean:
rm -f test*.log *.s *~ $(TESTS)

View file

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

21
regression/test046.expr Normal file
View file

@ -0,0 +1,21 @@
n := read ();
case 3 of
a -> write (a)
| _ -> write (0)
esac;
case 3 of
a -> write (a)
esac;
case 3 of
a@_ -> write (a)
esac;
case `a (1, 2, 3) of
`b -> write (1)
| a@`a (_, _, _) -> case a of
`a (x, y, z) -> write (x); write (y); write (z)
esac
esac

1
regression/test046.input Normal file
View file

@ -0,0 +1 @@
0