mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
Better error reporting; synched with ostap
This commit is contained in:
parent
290c124be6
commit
b6180d8634
13 changed files with 59 additions and 68 deletions
11
stdlib/Makefile
Normal file
11
stdlib/Makefile
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
FILES=$(wildcard *.expr)
|
||||
ALL=$(sort $(FILES:.expr=.o))
|
||||
|
||||
all: $(ALL)
|
||||
|
||||
%.o: %.expr
|
||||
../src/rc.opt -c $<
|
||||
|
||||
clean:
|
||||
rm -Rf *.s *.o *.i *~
|
||||
|
||||
|
|
@ -68,8 +68,7 @@ fun matcherCreate (buf, pos, line, col) {
|
|||
[show,
|
||||
eof,
|
||||
matchString,
|
||||
matchRegexp
|
||||
]
|
||||
matchRegexp]
|
||||
}
|
||||
|
||||
fun show (m) {
|
||||
|
|
|
|||
33
stdlib/regression/test006.expr
Normal file
33
stdlib/regression/test006.expr
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
fun f (x) {
|
||||
return fun (y) {return x + y}
|
||||
}
|
||||
|
||||
write (compare (1, 2));
|
||||
write (compare (2, 1));
|
||||
write (compare (3, 3));
|
||||
write (compare (2, "abc"));
|
||||
write (compare ("abc", 2));
|
||||
write (compare ("abc", "abc"));
|
||||
write (compare ("ab", "abc"));
|
||||
write (compare ("abc", "ab"));
|
||||
write (compare ([], []));
|
||||
write (compare (A, A));
|
||||
write (compare (A, B));
|
||||
write (compare (B, A));
|
||||
write (compare (A (1), A (1, 1)));
|
||||
write (compare (A (1, 1), A (1)));
|
||||
|
||||
-- not stable: write (compare (f, f));
|
||||
-- not stable: write (compare (f, f(5)));
|
||||
-- not stable: write (compare (f(5), f));
|
||||
-- not stable: write (compare (f(5), f(5)));
|
||||
-- not stable: write (compare (f(5), f(6)));
|
||||
-- not stable: write (compare (f(6), f(5)));
|
||||
|
||||
write (compare ({1, 2, 3}, {1, 2, 3}));
|
||||
write (compare ({1, [2], [[3]]}, {1, [2], [[3]]}));
|
||||
write (compare ({1, [2], [[3]]}, {1, [2], [3]}));
|
||||
write (compare ({1, [2], [3]}, {1, [2], [[3]]}))
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue