GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [lua] Fix several related Lua parsing issues found when using CPD by matthargett · Pull Request #4061 · pmd/pmd

Conversation

@matthargett

@matthargett matthargett commented Jul 24, 2022

Copy link
Copy Markdown
Contributor

Describe the PR

The Lua ANTLR grammar had parsing issues with escaped characters in comments, multiline comments with line breaks, and a few other bits and pieces. Informed by looking at the C# and Go grammars.

I enhanced the existing sample Lua files to reproduce the issues in a way that didn't require modifying their CPD snapshots.
I then tested against some of the largest corpus' of Lua code availble in open source, including test suites from multiple other parsers.

If this looks good here, I'll upstream to antlr4's repo.

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Barocena, JohnnyMorganz, boatbomber, jhampton, and oltrep reacted with thumbs up emoji
All reactions
  • 👍 5 reactions
matthargett added 6 commits July 24, 2022 12:58
@matthargett
Fortify the Lua parser to fix parse error in several OSS Lua codebase…
50b06f3
…s when trying to use CPD.
@matthargett
World of Warcraft Lua uses a few non-standard escape patterns, which …
08cc6a1
…are easy enough to add and shouldn't introduce any confusions with errors messages on other dialects.
@matthargett
Luau benchmarks and conformance suite all analyze fine, update test s…
f7f449c
…uite comment.
@matthargett
Comments have to go to HIDDEN channel so that suppression comments wi…
54918a7
…ll work.
@matthargett
Add explaining comment, cleanup inconsistent fragment formatting
8fa558e
@matthargett
Remove superfluous whitespace'
5dc75e7
@matthargett matthargett mentioned this pull request Jul 24, 2022
Fortify Lua grammar to fix related parse issues antlr/grammars-v4#2728
Merged
@matthargett
Fix another superflous ws
b189d07
@matthargett

matthargett commented Jul 24, 2022

Copy link
Copy Markdown
Contributor Author

Upstream antlr4 twin PR merged: antlr/grammars-v4#2728

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ghost

ghost commented Jul 25, 2022

Copy link
Copy Markdown
1 Message
📖 No regression tested rules have been changed.

Generated by 🚫 Danger

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adangel adangel changed the title Fix several related Lua parsing issues found when using CPD [lua] Fix several related Lua parsing issues found when using CPD Jul 25, 2022
@adangel adangel added the a:bug PMD crashes or fails to analyse a file. label Jul 25, 2022
@adangel adangel added this to the 6.48.0 milestone Jul 25, 2022
adangel
adangel approved these changes Jul 25, 2022
View reviewed changes

@adangel adangel left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks, looks good!

And thanks for becoming a sponsor 🙏

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

matthargett reacted with heart emoji
All reactions
  • ❤️ 1 reaction
adangel added a commit that referenced this pull request Jul 25, 2022
@adangel
[doc] Update release notes (#4061)
b000b07
adangel added a commit that referenced this pull request Jul 25, 2022
@adangel
Merge pull request #4061 from matthargett:fortify-lua-grammar
0550512
[lua] Fix several related Lua parsing issues found when using CPD #4061
@adangel
adangel merged commit b189d07 into pmd:master Jul 25, 2022
@adangel adangel added the in:grammar About the grammar of a lexer or parser, eg, a parse/lex exception label Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adangel adangel adangel approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

a:bug PMD crashes or fails to analyse a file. in:grammar About the grammar of a lexer or parser, eg, a parse/lex exception

Projects

None yet

Milestone

6.48.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@matthargett @adangel
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.