WTF error handler.

Made it check that the unknown term really isn't a literal, definition, function, or combinator.
This commit is contained in:
Simon Forman 2019-07-20 17:19:35 -07:00
parent 2a66e7fb47
commit 7354911d05
1 changed files with 9 additions and 1 deletions

View File

@ -88,7 +88,15 @@ thun( [Func|E], Si, So) :- func(Func, Si, S), thun(E, S, So).
thun([Combo|E], Si, So) :- combo(Combo, Si, S, E, Eo), thun(Eo, S, So).
% Some error handling.
% thun([Unknown|E], Si, So) :- write("wtf? "), writeln(Unknown), So = [[Unknown|E]|Si].
thun([Unknown|E], Si, So) :- damned_thing(Unknown), write("wtf? "), writeln(Unknown), So = [[Unknown|E]|Si].
damned_thing(It) :-
\+ literal(It),
\+ (It _),
\+ func(It, _, _),
\+ combo(It, _, _, _, _).
/*
Literals