trealla-prolog / trealla

A compact, efficient Prolog interpreter written in plain-old C.
MIT License
268 stars 13 forks source link

Syntax error displayed #590

Closed flexoron closed 2 weeks ago

flexoron commented 2 weeks ago

v2.56.2

?- op(1,xfx,'').
   true.
?- [user].
''(.\\,//.).

?- X''Y, Z=X+Y.
   X = .\\, Y = //., Z = .\\ +//. . % unexpected
?- Z = .\\ +//. .
Error: syntax error, near '+//.', operator expected, user:1

?- Z = .\\ + //. .
   Z = .\\ + //. . % expected
?-
flexoron commented 2 weeks ago
?- X''Y, Z=X+Y.
   X = .\\, Y = //., Z = .\\ + //. .

?- X''Y, Z=X''Y.
   X = .\\, Y = //., Z = .\\  ''  //. .  % Interesting, 2 more spaces added.

% Scryer does remove spaces in this case.
%  X''Y, Z=X''Y.
%  X = .\\, Y = //., Z = .\\''//.. % (Hint .. has been reported #2555)
infradig commented 2 weeks ago

Double spacing.