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

multiline block comment not accepted by consult/1 predicate #326

Open
Jean-Luc-Picard-2021 opened this issue Aug 10, 2024 · 1 comment
Open

Comments

@Jean-Luc-Picard-2021
Copy link

Jean-Luc-Picard-2021 commented Aug 10, 2024

If I use this Prolog text:

human(socrates).       % This is a fact.
mortal(X) :- human(X). % This is a rule.

Everything works fine:

?- human(X).
X = socrates;

On the other hand this Prolog text:

/**
 * block comment
 * block comment
 * block comment
 * block comment
 * block comment
 * block comment
 **/

human(socrates).       % This is a fact.
mortal(X) :- human(X). % This is a rule.

Doesn't work ok:

?- human(X).
2024/08/10 21:29:19 error(existence_error(procedure,human/1),root)

I used top level ['categories.p'] respectively ['categories2.p'] with these texts:

categories.p.log
categories2.p.log

@ichiban
Copy link
Owner

ichiban commented Aug 14, 2024

I can reproduce the bug with a shorter example:

$ cat foo.pl
/* **/foo.
$ $(go env GOPATH)/bin/1pl
Top level for ichiban/prolog v1.2.1
This is for testing purposes only!
See https://github.com/ichiban/prolog for more details.
Type Ctrl-C or 'halt.' to exit.
?- [foo].
true.
?- foo.
2024/08/14 14:35:25 error(existence_error(procedure,foo/0),root)
?- 

Something's wrong in lexer and mishandling the **/, I guess.

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