Better error reporting; synched with ostap

This commit is contained in:
Dmitry Boulytchev 2020-01-05 22:54:09 +03:00
parent 290c124be6
commit b6180d8634
13 changed files with 59 additions and 68 deletions

11
stdlib/Makefile Normal file
View 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 *~

View file

@ -68,8 +68,7 @@ fun matcherCreate (buf, pos, line, col) {
[show,
eof,
matchString,
matchRegexp
]
matchRegexp]
}
fun show (m) {

View 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]]}))