Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[user]. Syntax error not reported #2418

Open
flexoron opened this issue Jun 8, 2024 · 4 comments
Open

[user]. Syntax error not reported #2418

flexoron opened this issue Jun 8, 2024 · 4 comments

Comments

@flexoron
Copy link

flexoron commented Jun 8, 2024

?- [user].
{x|y|z}.
?- X =.. [{},(A|B|C)], call(X).
   error(syntax_error(incomplete_reduction),read_term/3:1). % unexpected
   X = {x|y|z}, A = x, B = y, C = z. % expected but not found.
?- 
@flexoron
Copy link
Author

flexoron commented Jun 8, 2024

sorry, forgot dcgs

$ scryer-prolog -f
?- use_module(library(dcgs)).
   true.
?- [user].
{x|y|z}.

?- X =.. [{},(A|B|C)], call(X).
   X = {x|y|z}, A = x, B = y, C = z.
?- 

@flexoron flexoron closed this as completed Jun 8, 2024
@flexoron
Copy link
Author

flexoron commented Jun 8, 2024

The issue here is the [user] part (without dcgs)

$ scryer-prolog -f
?- [user].
{x|y|z}. % Input accepted but ignored and should be handled like the following query?

?- X = {x|y|z}.
   error(syntax_error(incomplete_reduction),read_term/3:1).

?- use_module(library(dcgs)).
   true.
?- X = {x|y|z}.
   X = {x|y|z}.

@flexoron flexoron reopened this Jun 8, 2024
@flexoron flexoron changed the title Arcane syntax error [user]. Syntax error not reported Jun 8, 2024
@UWN
Copy link

UWN commented Jun 8, 2024

It seems that syntax errors are not reported in general.

ulrich@gupu:/opt/gupu/scryer-prolog$ target/release/scryer-prolog -v
v0.9.4-53-g2d18e0d7
ulrich@gupu:/opt/gupu/scryer-prolog$ target/release/scryer-prolog -f
?- [user].
p(1++2).
?- p(1++2).
   error(syntax_error(incomplete_reduction),read_term/3:1).

@flexoron
Copy link
Author

flexoron commented Jun 8, 2024

$ cat x.pl 
{x|y|z}.

$ scryer-prolog -f
?- use_module(library(dcgs)).
   true.
?- [x].
   true.
?- X =.. [{},(A|B|C)], call(abc:X).
   error(existence_error(procedure,abc:{}/1),{}/1). % expected, call(abc:X)
?- X =.. [{},(A|B|C)], call(user:X). 
   X = {x|y|z}, A = x, B = y, C = z. % expected, call(user:X)
?- halt. 

$ scryer-prolog -f
?- [x].
   error(syntax_error(incomplete_reduction),read_term/3:1). % expected
?- 

Issue happens in interactive mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants