Skip to content

fix: #3758 Allow for string being a keyword and fix go template to us… - #3831

Merged
parrt merged 3 commits into
antlr:devfrom
jimidle:feature/3758
Aug 23, 2022
Merged

parrt merged 3 commits into
antlr:devfrom
jimidle:feature/3758

Conversation

@jimidle

@jimidle jimidle commented Aug 22, 2022

Copy link
Copy Markdown
Collaborator

fix: #3758 Consistently apply .escapedName instead of just .name for the go target. Add string to reserved words

  • The Go code generation template mostly ignored the use of escapedName, hence it would generate rules and so on
    that were keywords in go.
  • Added string as a keyword for go

…e escapedName

  - The go template was ignoring the use of escapedName in many places and was
    not consistenet with the Java version.
  - Added 'string' to the list of reserved words for the Go target

Signed-off-by: Jim.Idle <jimi@gatherstars.com>
@KvanTTT

KvanTTT commented Aug 22, 2022

Copy link
Copy Markdown
Member

Could you please add a test that covers the case?

Jim.Idle added 2 commits August 23, 2022 10:25
Signed-off-by: Jim.Idle <jimi@gatherstars.com>
….mod

Signed-off-by: Jim.Idle <jimi@gatherstars.com>
@jimidle

jimidle commented Aug 23, 2022

Copy link
Copy Markdown
Collaborator Author

The go.mod file is updated to include the go runtime extensions and the go.sum file is added to the repo, which I had not noticed was missing.

Comment thread runtime/Go/antlr/go.mod Resolved
@parrt parrt added this to the 4.10.2 milestone Aug 23, 2022
@parrt
parrt merged commit e51cfcc into antlr:dev Aug 23, 2022
@jimidle

jimidle commented Aug 23, 2022

Copy link
Copy Markdown
Collaborator Author

I will add a string rule to the existing keyword test. I should have done that with this PR.

@jimidle

jimidle commented Aug 30, 2022

Copy link
Copy Markdown
Collaborator Author

@parrt I thin we can close this now?

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.

3 participants