grammars-v4 icon indicating copy to clipboard operation
grammars-v4 copied to clipboard

Dart2 grammar problems running literals

Open PMimosoS opened this issue 4 years ago • 2 comments

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.

PMimosoS avatar Nov 18 '20 11:11 PMimosoS

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

PMimosoS avatar Nov 18 '20 18:11 PMimosoS

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.

jamesderlin avatar Feb 18 '22 04:02 jamesderlin