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

ANTLR parsing failures are not explained properly in error reports #3332

Open
volodya-lombrozo opened this issue Aug 14, 2024 · 9 comments
Open
Labels

Comments

@volodya-lombrozo
Copy link
Member

I have the following program:

# Comment here.
[args] > app
  seq > @
   *
     "a" > a
     QQ.io.stdout
       a

I run the following command:

eoc dataize app --parser=0.38.4 --home-tag=0.38.4

I get:

EO objects registered in .eoc/eo-foreign.json
Assembling into .eoc
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/app.eo:4': [4:2] no viable alternative at input '# Comment here.\n[args] > app\n  INTseq > @\n   ': "   *"
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/io/stdin.eo:29': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/io/stdout.eo:29': Comment must end with dot
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/malloc.eo:29': Comment must end with dot
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/false.eo:29': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/io/stdin.eo:35': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/false.eo:38': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/rust.eo:29': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/int.eo:34': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/malloc.eo:108': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/int.eo:40': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/false.eo:41': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/int.eo:47': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/int.eo:53': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/while.eo:36': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/int.eo:56': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/malloc.eo:111': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/int.eo:62': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/int.eo:65': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/true.eo:29': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/int.eo:68': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/true.eo:38': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/tuple.eo:29': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/int.eo:71': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/true.eo:41': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/tuple.eo:31': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/int.eo:74': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/float.eo:34': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/tuple.eo:43': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/string.eo:34': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/float.eo:70': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/tuple.eo:48': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/string.eo:40': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/float.eo:77': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/tuple.eo:71': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/string.eo:43': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/float.eo:77': Comment must contain only ASCII printable characters: 0x20-0x7f
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/cage.eo:42': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/float.eo:84': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/cage.eo:45': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/float.eo:87': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/cage.eo:50': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/float.eo:87': Comment must contain only ASCII printable characters: 0x20-0x7f
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/float.eo:94': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/positive-infinity.eo:29': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/float.eo:97': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/nan.eo:29': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/positive-infinity.eo:33': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/float.eo:100': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/bytes.eo:33': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/nan.eo:33': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/positive-infinity.eo:39': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/float.eo:103': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/bytes.eo:36': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/nan.eo:36': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/float.eo:106': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/positive-infinity.eo:43': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/bytes.eo:39': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/negative-infinity.eo:29': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/nan.eo:39': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/positive-infinity.eo:43': Comment must contain only ASCII printable characters: 0x20-0x7f
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/bytes.eo:42': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/negative-infinity.eo:33': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/nan.eo:39': Comment must contain only ASCII printable characters: 0x20-0x7f
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/bytes.eo:45': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/negative-infinity.eo:39': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/positive-infinity.eo:47': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/nan.eo:42': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/negative-infinity.eo:47': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/bytes.eo:66': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/nan.eo:45': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/positive-infinity.eo:55': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/negative-infinity.eo:47': Comment must contain only ASCII printable characters: 0x20-0x7f
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/bytes.eo:69': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/positive-infinity.eo:55': Comment must contain only ASCII printable characters: 0x20-0x7f
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/nan.eo:45': Comment must contain only ASCII printable characters: 0x20-0x7f
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/negative-infinity.eo:54': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/bytes.eo:72': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/positive-infinity.eo:62': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/nan.eo:48': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/bytes.eo:75': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/negative-infinity.eo:58': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/positive-infinity.eo:91': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/nan.eo:51': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/bytes.eo:78': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/positive-infinity.eo:105': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/nan.eo:54': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/bytes.eo:81': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/negative-infinity.eo:58': Comment must contain only ASCII printable characters: 0x20-0x7f
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/positive-infinity.eo:119': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/nan.eo:57': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/bytes.eo:84': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/negative-infinity.eo:62': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/nan.eo:60': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/negative-infinity.eo:91': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/negative-infinity.eo:105': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/negative-infinity.eo:119': Comment must be at least 64 characters long
[ERROR] Failed to parse '/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/4-pull/org/eolang/negative-infinity.eo:119': Comment must end with dot
EO program assembled in .eoc
[ERROR] /Users/lombrozo/Workspace/Playground/eo/hello/app.eo, line 4: [4:2] no viable alternative at input '# Comment here.\n[args] > app\n  INTseq > @\n   ': "   *"
[ERROR] net.sf.saxon.style.XSLMessage@5441ce1d: Critical error identified:
  /Users/lombrozo/Workspace/Playground/eo/hello/app.eo, 4: [4:2] no viable alternative at input '# Comment here.\n[args] > app\n  INTseq > @\n   ': "   *";
[ERROR] #fatalError(): Processing terminated by xsl:message at line 31 in fail-on-critical.xsl; SystemID: file:///org/eolang/parser/fail-on-critical.xsl; Line#: 31; Column#: 34
[ERROR] Processing terminated by xsl:message at line 31 in fail-on-critical.xsl
[ERROR] Failed to execute goal org.eolang:eo-maven-plugin:0.38.4:verify (default-cli) on project eoc: 'org.eolang.maven.VerifyMojo@52d6d273' execution failed: java.io.UncheckedIOException: java.io.IOException: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Failed to transform by net.sf.saxon.jaxp.TransformerImpl: ; Processing terminated by xsl:message at line 31 in fail-on-critical.xsl; SystemID: file:///org/eolang/parser/fail-on-critical.xsl; Line#: 31; Column#: 34 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
The command "/usr/local/lib/node_modules/eolang/mvnw/mvnw eo:verify -Deo.version=0.38.4 -Deo.tag=0.38.4 --quiet -Deo.sourcesDir=/Users/lombrozo/Workspace/Playground/eo/hello -Deo.targetDir=/Users/lombrozo/Workspace/Playground/eo/hello/.eoc -Deo.outputDir=/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/classes -Deo.generatedDir=/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/generated-sources -Deo.placed=/Users/lombrozo/Workspace/Playground/eo/hello/.eoc/eo-placed.csv -Deo.placedFormat=csv --batch-mode --color=never --update-snapshots --fail-fast --strict-checksums" exited with #1 code

What does this message mean?

 no viable alternative at input '# Comment here.\n[args] > app\n  INTseq > @\n   ': "   *";

What should I do to be able to compile simple program with the use of variable?

@volodya-lombrozo
Copy link
Member Author

@maxonfjvipon Could you help here, please?

@maxonfjvipon
Copy link
Member

@volodya-lombrozo 2 spaces are required here:
image

@volodya-lombrozo
Copy link
Member Author

@maxonfjvipon Maybe we can add a more human-readable message for this kind of mistakes? What do you think?

@volodya-lombrozo
Copy link
Member Author

@maxonfjvipon it helped, thank you.

@maxonfjvipon
Copy link
Member

@volodya-lombrozo it's a default antl4 parsing error message, I'll check what I can do

@yegor256
Copy link
Member

@volodya-lombrozo I believe, it's fixed

@volodya-lombrozo
Copy link
Member Author

@yegor256 How?

@objectionary objectionary deleted a comment from github-actions bot Oct 14, 2024
@yegor256 yegor256 changed the title Can't print simple string ANTLR parsing failures are not explained properly in error reports Oct 14, 2024
@yegor256 yegor256 reopened this Oct 14, 2024
@yegor256
Copy link
Member

@volodya-lombrozo @maxonfjvipon I suggest closing this one in favor of #3370 (they are very close to each other and once the first one is fixed, the second one will most definitely be fixed too)

@volodya-lombrozo
Copy link
Member Author

@yegor256 I suggest to wait until #3370 is fixed. If it solves the current issue as well, we will close this ticket. Closing the issue now is not safe: If #3370 won't fix this issue, we will just loose this ticket in the history.

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

No branches or pull requests

3 participants