[XL] Change in dart/sdk[main]: [parser] Change enum listener calls

0 views
Skip to first unread message

Johnni Winther (Gerrit)

unread,
Oct 30, 2025, 7:32:19 AM (2 days ago) Oct 30
to Jens Johansen, Commit Queue, Paul Berry, dart-analys...@google.com, dart-fe-te...@google.com, rev...@dartlang.org
Attention needed from Jens Johansen and Johnni Winther

Johnni Winther voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Jens Johansen
  • Johnni Winther
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I9c1ad55db6e3fcc09ed5ac0c05f5d50db95ae608
Gerrit-Change-Number: 458200
Gerrit-PatchSet: 5
Gerrit-Owner: Johnni Winther <johnni...@google.com>
Gerrit-Reviewer: Jens Johansen <je...@google.com>
Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
Gerrit-CC: Paul Berry <paul...@google.com>
Gerrit-Attention: Jens Johansen <je...@google.com>
Gerrit-Attention: Johnni Winther <johnni...@google.com>
Gerrit-Comment-Date: Thu, 30 Oct 2025 11:32:10 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Jens Johansen (Gerrit)

unread,
Oct 30, 2025, 7:46:41 AM (2 days ago) Oct 30
to Johnni Winther, Commit Queue, Paul Berry, dart-analys...@google.com, dart-fe-te...@google.com, rev...@dartlang.org
Attention needed from Johnni Winther

Jens Johansen voted and added 2 comments

Votes added by Jens Johansen

Code-Review+1

2 comments

File pkg/front_end/lib/src/source/outline_builder.dart
Line 3312, Patchset 5 (Latest): //int endOffset = popCharOffset();
Jens Johansen . unresolved

remove?

File pkg/front_end/parser_testcases/declaring_constructors/declaring_parameter_error.dart.expect
Line 515, Patchset 5 (Latest): beginEnumDeclarationPrelude(enum)
handleIdentifier(E, enumDeclaration)
handleNoTypeVariables(()
beginEnumDeclaration(enum, null, enum, E)
Jens Johansen . unresolved

I did not expect the `handleNoTypeVariables` to be moved (I mean the `parseVariables` is move before the `beginEnumDeclaration` in the parser so it makes sense I guess, but the comment in listener said that `beginEnumDeclarationPrelude` had "Substructure metadata" (which doesn't seem true either --- the "metadata*" is before the enum?)).

Open in Gerrit

Related details

Attention is currently required from:
  • Johnni Winther
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I9c1ad55db6e3fcc09ed5ac0c05f5d50db95ae608
Gerrit-Change-Number: 458200
Gerrit-PatchSet: 5
Gerrit-Owner: Johnni Winther <johnni...@google.com>
Gerrit-Reviewer: Jens Johansen <je...@google.com>
Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
Gerrit-CC: Paul Berry <paul...@google.com>
Gerrit-Attention: Johnni Winther <johnni...@google.com>
Gerrit-Comment-Date: Thu, 30 Oct 2025 11:46:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Johnni Winther (Gerrit)

unread,
Oct 30, 2025, 11:12:24 AM (2 days ago) Oct 30
to Jens Johansen, Commit Queue, Paul Berry, dart-analys...@google.com, dart-fe-te...@google.com, rev...@dartlang.org

Johnni Winther voted and added 2 comments

Votes added by Johnni Winther

Commit-Queue+2

2 comments

File pkg/front_end/lib/src/source/outline_builder.dart
Line 3312, Patchset 5: //int endOffset = popCharOffset();
Jens Johansen . resolved

remove?

Johnni Winther

Done

File pkg/front_end/parser_testcases/declaring_constructors/declaring_parameter_error.dart.expect
Line 515, Patchset 5: beginEnumDeclarationPrelude(enum)

handleIdentifier(E, enumDeclaration)
handleNoTypeVariables(()
beginEnumDeclaration(enum, null, enum, E)
Jens Johansen . resolved

I did not expect the `handleNoTypeVariables` to be moved (I mean the `parseVariables` is move before the `beginEnumDeclaration` in the parser so it makes sense I guess, but the comment in listener said that `beginEnumDeclarationPrelude` had "Substructure metadata" (which doesn't seem true either --- the "metadata*" is before the enum?)).

Johnni Winther

The term "substructure" seems to be used to mean "what can be expected to be parsed at this point". Any parsed metadata will be on the stack at `beginEnumDeclarationPrelude`, so this is correct.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I9c1ad55db6e3fcc09ed5ac0c05f5d50db95ae608
Gerrit-Change-Number: 458200
Gerrit-PatchSet: 6
Gerrit-Owner: Johnni Winther <johnni...@google.com>
Gerrit-Reviewer: Jens Johansen <je...@google.com>
Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
Gerrit-CC: Paul Berry <paul...@google.com>
Gerrit-Comment-Date: Thu, 30 Oct 2025 15:12:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Jens Johansen <je...@google.com>
satisfied_requirement
open
diffy

Commit Queue (Gerrit)

unread,
Oct 30, 2025, 11:50:09 AM (2 days ago) Oct 30
to Johnni Winther, Jens Johansen, Paul Berry, dart-analys...@google.com, dart-fe-te...@google.com, rev...@dartlang.org

Commit Queue submitted the change with unreviewed changes

Unreviewed changes

5 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: pkg/front_end/lib/src/source/outline_builder.dart
Insertions: 0, Deletions: 2.

@@ -3309,8 +3309,6 @@
}
}

- //int endOffset = popCharOffset();
-
List<TypeBuilder>? interfaces =
nullIfParserRecovery(pop()) as List<TypeBuilder>?;
List<TypeBuilder>? mixins =
```

Change information

Commit message:
[parser] Change enum listener calls

This aligns the call to `Listener.beginEnum*` with that of `Listener.beginClass*`. A `beginExtensionPrelude` is added, replacing the call to `beginUncategorizedTopLevelDeclaration` and matching the call to `beginClassOrMixinOrNamedMixinApplicationPrelude` for classes. `beginEnumDeclaration` and `endEnumDeclaration` replaces the `beginEnum`/`endEnum` pair, matching the calls to `beginClassDeclaration`/`endClassDeclaration` with the name and type parameters now available at `beginEnumDeclaration` similar to `beginClassDeclaration`. This helps supporting primary constructors in enums because the enclosing enum can be prepared in `beginEnumDeclaration` before calls to `endPrimaryConstructor`.
Change-Id: I9c1ad55db6e3fcc09ed5ac0c05f5d50db95ae608
Commit-Queue: Johnni Winther <johnni...@google.com>
Reviewed-by: Jens Johansen <je...@google.com>
Files:
  • M pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart
  • M pkg/_fe_analyzer_shared/lib/src/parser/listener.dart
  • M pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
  • M pkg/analyzer/lib/src/fasta/ast_builder.dart
  • M pkg/analyzer/test/generated/parser_fasta_listener.dart
  • M pkg/analyzer/tool/summary/mini_ast.dart
  • M pkg/front_end/lib/src/fragment/class.dart
  • M pkg/front_end/lib/src/fragment/declaration.dart
  • M pkg/front_end/lib/src/fragment/enum.dart
  • M pkg/front_end/lib/src/fragment/extension_type.dart
  • M pkg/front_end/lib/src/fragment/mixin.dart
  • M pkg/front_end/lib/src/source/diet_listener.dart
  • M pkg/front_end/lib/src/source/fragment_factory.dart
  • M pkg/front_end/lib/src/source/fragment_factory_impl.dart
  • M pkg/front_end/lib/src/source/outline_builder.dart
  • M pkg/front_end/lib/src/util/abstracted_ast_nodes.dart
  • M pkg/front_end/lib/src/util/outline_extractor.dart
  • M pkg/front_end/lib/src/util/parser_ast.dart
  • M pkg/front_end/lib/src/util/parser_ast_helper.dart
  • M pkg/front_end/lib/src/util/textual_outline.dart
  • M pkg/front_end/parser_testcases/declaring_constructors/declaring_parameter.dart.expect
  • M pkg/front_end/parser_testcases/declaring_constructors/declaring_parameter.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/declaring_constructors/declaring_parameter_error.dart.expect
  • M pkg/front_end/parser_testcases/declaring_constructors/declaring_parameter_error.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/declaring_constructors/enum_primary_constructor.dart.expect
  • M pkg/front_end/parser_testcases/declaring_constructors/enum_primary_constructor.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/declaring_constructors/enum_primary_constructor_error.dart.expect
  • M pkg/front_end/parser_testcases/declaring_constructors/enum_primary_constructor_error.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/dot_shorthands/no_identifier_no_context_recovery.dart.expect
  • M pkg/front_end/parser_testcases/dot_shorthands/no_identifier_no_context_recovery.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/dot_shorthands/no_identifier_recovery.dart.expect
  • M pkg/front_end/parser_testcases/dot_shorthands/no_identifier_recovery.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/dot_shorthands/syntax.dart.expect
  • M pkg/front_end/parser_testcases/dot_shorthands/syntax.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/enhanced_enums/entries_with_type_arguments.dart.expect
  • M pkg/front_end/parser_testcases/enhanced_enums/entries_with_type_arguments.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/invalid_enum_modifiers.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/invalid_enum_modifiers.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48371.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48371.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48371_prime3.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48371_prime3.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_1.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_1.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_1_comma.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_1_comma.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_1_comma_ok.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_1_comma_ok.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_1_ok.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_1_ok.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_2.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_2.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_2_comma.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_2_comma.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_2_comma_ok.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_2_comma_ok.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_2_ok.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_2_ok.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_3.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_3.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_3_comma.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_3_comma.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_3_comma_ok.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_3_comma_ok.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_3_ok.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_3_ok.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_4.dart.expect
  • M pkg/front_end/parser_testcases/error_recovery/issue_48380_4.dart.intertwined.expect
  • M pkg/front_end/parser_testcases/general/declaring_parameter_pre_feature.dart.expect
  • M pkg/front_end/parser_testcases/general/declaring_parameter_pre_feature.dart.intertwined.expect
  • M pkg/front_end/test/crashing_test_case_minimizer_impl.dart
  • M pkg/front_end/test/parser/parser_ast_test.dart
  • M pkg/front_end/test/parser_test_listener.dart
  • M pkg/front_end/test/spell_checking_list_tests.txt
  • M pkg/front_end/test/testing/suite.dart
  • A pkg/front_end/testcases/general/no_name_declarations.dart
  • A pkg/front_end/testcases/general/no_name_declarations.dart.strong.expect
  • A pkg/front_end/testcases/general/no_name_declarations.dart.strong.modular.expect
  • A pkg/front_end/testcases/general/no_name_declarations.dart.strong.outline.expect
  • A pkg/front_end/testcases/general/no_name_declarations.dart.strong.transformed.expect
  • A pkg/front_end/testcases/general/no_name_declarations.dart.textual_outline.expect
  • A pkg/front_end/testcases/general/no_name_declarations.dart.textual_outline_modelled.expect
  • M pkg/front_end/tool/parser_ast_indexer.dart
Change size: XL
Delta: 83 files changed, 1233 insertions(+), 1042 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Jens Johansen
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I9c1ad55db6e3fcc09ed5ac0c05f5d50db95ae608
Gerrit-Change-Number: 458200
Gerrit-PatchSet: 7
Gerrit-Owner: Johnni Winther <johnni...@google.com>
Gerrit-Reviewer: Jens Johansen <je...@google.com>
Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
Gerrit-CC: Paul Berry <paul...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages