-
Notifications
You must be signed in to change notification settings - Fork 1k
Enhanced Enum support in the Dart.bnf parser for Dart 2.17 #849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
enumConstantDeclaration ::= componentName | ||
enumConstantDeclaration ::= metadata* componentName typeArguments? arguments? | | ||
metadata* componentName typeArguments? '.' componentName arguments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any input matches arguments?
, and this means that the second branch of this rule (after |
) will never be reached. To make it work as expected, I flipped the branches. Test updated as well.
enumConstantDeclaration ::= metadata* componentName typeArguments? '.' componentName arguments |
metadata* componentName typeArguments? arguments?
{ | ||
mixin="com.jetbrains.lang.dart.psi.impl.AbstractDartComponentImpl" | ||
implements="com.jetbrains.lang.dart.psi.DartComponent" | ||
methods = [getMetadataList] | ||
methods= [getMetadataList] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the updated grammar, we don't need custom getMetadataList() method declaration anymore (otherwize the generated code contains 2 of them and doesn't compile). But now we need custom getComponentName
method declaration. Added it here and in DartPsiImplUtil
, so now the generated code compiles fine.
Thanks, pushed. |
close #849 (cherry picked from commit 6ef1c112bf87d6e9a6803a0c36157178a6b6913e) (cherry picked from commit 93fc285ed9fa443195fca4fb4b8123a281183013) GitOrigin-RevId: 48efcf939b18d87b36703e4aa14d0de20cd903d4
close #849 (cherry picked from commit 6ef1c112bf87d6e9a6803a0c36157178a6b6913e) (cherry picked from commit 93fc285ed9fa443195fca4fb4b8123a281183013) (cherry picked from commit 48efcf939b18d87b36703e4aa14d0de20cd903d4) GitOrigin-RevId: 892def6b88031c0c5e40953dffffc1a47c226c9c
close #849 (cherry picked from commit 6ef1c112bf87d6e9a6803a0c36157178a6b6913e) GitOrigin-RevId: 93fc285ed9fa443195fca4fb4b8123a281183013
dart-lang/sdk#47869