Skip to content

Conversation

@mdehoog
Copy link
Contributor

@mdehoog mdehoog commented Apr 16, 2023

Generating a Golang antlr4 parser from the grammar is currently broken due to some idiosyncratic language incompatibilities:

  • boolean -> bool is not supported (upstreaming a fix here: github.com/Add support to Golang codegen for booleans antlr/antlr4#4231)
  • Golang generation generates both a NewExpressionContext struct and function in the same package, causing a redeclaration error
  • start / end indexing conflicts with Antlr4 Golang runtime GetStart and GetEnd methods

This PR fixes the second two by:

  • Renaming NewExpression to NewExpr which changes the NewExpressionContext type to NewExprContext
  • Renaming start and end to startIndex and endIndex

@github-actions
Copy link

Thank you for your contribution to the Solidity compiler! A team member will follow up shortly.

If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother.

If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix.

Copy link
Collaborator

@ekpyron ekpyron left a comment

Choose a reason for hiding this comment

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

I don't see any harm in these changes, thanks!

@ekpyron ekpyron merged commit 02e936a into argotorg:develop Apr 17, 2023
@mdehoog mdehoog deleted the golang-generation branch April 17, 2023 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants