Replies: 1 comment 7 replies
-
For 1st case I found a workaround – add this to your code: :- use_module(library(format)).
user:term_expansion(G, _) :-
nonvar(G),
functor(G, ',', _),
prolog_load_context(file, F),
prolog_load_context(term_position, position_and_lines_read(_,L)),
format(user_error, "% Warning: (~q) attempts to re-define ','/2 at line ~d of ~a~n", [G,L,F]),
false. And it will report a little bit of context, so it would be easier to find it:
|
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here I will collect syntax errors that are difficult to find, so if we will have an improved parser in the future it can be tested against those cases:
Code can't be compiled, Scryer just reports an exception:
error(permission_error(modify,static_procedure,(',')/2),load/1).
no information about source location, very hard to find and can easily happen if you copy code from one predicate to another.Scryer reports error at misleading place:
error(syntax_error(incomplete_reduction),read_term/3:7).
. After such error I usually think that the problem is in a body ofy/0
, but actual problem is non-terminated previous predicate.Beta Was this translation helpful? Give feedback.
All reactions