Closed lppedd closed 7 months ago
@ftomassetti let me know what you think about this.
The missing part is for TokenDecl. We would have to use the lateinit modifier, but I'm still unsure if it's appropriate.
This can't be done at all, as it's then impossible to check if a lateinit
variable has been initialized or not.
It looks good, but it is difficult to assess if the code work. I assume tests guarantee that to some extent. I just added minor comments
@ftomassetti haven't changed much so everything still work as before.
The "issue" here is the change in generated method names. This is a breaking change basically.
Thank you for your answers. Merging
Improves type nullability support in generated parsers, and solves a part of #84.
In this case we are checking for the
optional
property - injected by the ANTLR code generator - on theContextTokenGetterDecl
andContextRuleGetterDecl
template parts.Note that the generated methods now start with
get*
instead offind*
.The missing part is for
TokenDecl
. We would have to use thelateinit
modifier, but I'm still unsure if it's appropriate.