Skip to content

[java] Fix annotated module declaration#1843

Merged
adangel merged 1 commit into
pmd:masterfrom
oowekyala:grammar-fix-annot-module-decl
May 25, 2019
Merged

[java] Fix annotated module declaration#1843
adangel merged 1 commit into
pmd:masterfrom
oowekyala:grammar-fix-annot-module-decl

Conversation

@oowekyala

Copy link
Copy Markdown
Member

Fixes #1842

There's also this weird thing at the end of the CompilationUnit production:

( < "~[]" > )?

I think this is meant to allow any additionnal trailing characters, but in that case it should be written ( < ~[] > )* (no quotes, a star). With the current grammar, an empty file with just the contents ~[] is a valid compilation unit.

@oowekyala oowekyala added the in:ast About the AST structure or API, the parsing step label May 25, 2019
@oowekyala oowekyala added this to the 6.15.0 milestone May 25, 2019
@ghost

ghost commented May 25, 2019

Copy link
Copy Markdown
1 Message
📖 No java rules are changed!

Generated by 🚫 Danger

@oowekyala oowekyala changed the title Fix annotated module declaration [java] Fix annotated module declaration May 25, 2019

@adangel adangel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed this ( < "~[]" > )? is really weird. Also the line above ( < "\u001a" > )? looks unnecessary.
We might simply remove these two lines (in PMD 7). I think, we could make sure, that we don't fail to parse an empty file (containing only whitespaces), but other than that, I would not ignore any garbage at the end... (I assume the java parser doesn't do this either)

@adangel adangel self-assigned this May 25, 2019
@adangel adangel merged commit ae8ba51 into pmd:master May 25, 2019
@oowekyala oowekyala deleted the grammar-fix-annot-module-decl branch May 25, 2019 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in:ast About the AST structure or API, the parsing step

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[java] Annotated module declarations cause parse error

2 participants