mthom / scryer-prolog

A modern Prolog implementation written mostly in Rust.
BSD 3-Clause "New" or "Revised" License
2.01k stars 117 forks source link

Syntax error unexpected #2401

Closed flexoron closed 4 months ago

flexoron commented 4 months ago
$ scryer-prolog -f
?- current_op(X,Y,-).
   X = 500, Y = yfx
;  X = 200, Y = fy.
?- op(0,yfx,-).
   true.
?- op(0,fy,-).
   true.
?- [(-,-)] = X.
   error(syntax_error(incomplete_reduction),read_term/3:1). % unexpected, expecting X = [(-,-)].
?-
UWN commented 4 months ago

Shorter:


... .
?- current_op(Pri,Fix,-).
   false.
?- writeq([-]).
   error(syntax_error(incomplete_reduction),read_term/3:1), unexpected.
UWN commented 4 months ago

?- T=[-].
   T = "-".
?- op(0,fy,-).
   true.
?- T=[-].
   error(syntax_error(incomplete_reduction),read_term/3:1), unexpected.
   T = [-]. % expected, but not found
UWN commented 4 months ago

Added as #328