grammars-v4
grammars-v4 copied to clipboard
Dart2 grammar problems running literals
Hello, I was testing and using the grammar of Dart2 with antlr4, but I think for some reason some rule to recognize collection literals is not defined. I run a sample code from https://dart.dev/#try-dart, and it didn't recognize the var list, the var dict, and the var set, maybe I'm doing something wrong, but would like to have some opinion on this matter... Thank you.
I think var is missing these literals, because if we try to change from var to const the grammar recognizes. I will try to update the grammar to recognize these var types
As noted in https://stackoverflow.com/a/67903080/, the Dart team maintains its own ANTLR grammar, and the the one in the ANTLR repository is very outdated.