Add support to Golang codegen for booleans by mdehoog · Pull Request #4231 · antlr/antlr4

@mdehoog

Currently Golang codegen passes through boolean types without type conversion. This generates invalid Golang, as boolean is not Golang keyword.

This PR copies Swift's implementation of a type map:

SwiftTypeMap ::= [
"int":"Int",
"float":"Float",
"long":"Int64",
"double":"Double",
"bool":"Bool",
"boolean":"Bool",
default : key
]

@mdehoog

Signed-off-by: Michael de Hoog <michael.dehoog@coinbase.com>

@mdehoog mdehoog marked this pull request as ready for review

April 16, 2023 19:40

@jimidle

Where is that input coming from? Something in your grammar itself? Can you give me an example? I am not saying this isn't a good idea, but I have forgotten where the type map comes in to it to be honest?

Also, is there a reason for you to do force pushes? Just forgot the -s on the commit?

@mdehoog

@jimidle

@jimidle

@mdehoog mdehoog deleted the michael/go-boolean branch

April 18, 2023 19:35