antlr / antlr/antlr4

Antlr4 target JavaScript ';' disappearing

Open
#2,736 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
19k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Description

Hello,
when generating a Parser with antlr4(target JavaScript), i noticed a statement like this
"{ $associativity = Associativity.YFX ; $bottom = $op.priority + 1; }" is created like:
"associativity=Associativity.YFX bottom=op,priority +1" in the same line and WITHOUT ';' character.
This broke my runtime test, I think it'is a bug or something else.
I also noticed if I put double ';' one of them appears.

Contributor guide

Open the contributing guide

Research direction

Start with the ANTLR JavaScript target generation path and reproduce the reported grammar action containing two statements. Compare the generated JavaScript with the input, then run the runtime test mentioned in the report; done means statement separators are preserved and the test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.