antlr / grammars-v4

Grammars written for ANTLR v4; expectation that the grammars are free of actions.
MIT License
10.24k stars 3.71k forks source link

Dart2 grammar problems running literals #1939

Open PMimosoS opened 4 years ago

PMimosoS commented 4 years ago

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 commented 4 years ago

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

jamesderlin commented 2 years ago

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.