-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[parser] Better error message for >>> when not enabled in some cases …
…(part 2) #46886 Change-Id: I6195ad921f5c4b9622c735cb919c2d88f957f374 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211820 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Jens Johansen <jensj@google.com>
- Loading branch information
Showing
19 changed files
with
885 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
pkg/front_end/parser_testcases/no-triple-shift/define_triple_shift_method.equivalence_info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
files: | ||
- define_triple_shift_method.dart | ||
- define_triple_shift_method_prime.dart | ||
filters: | ||
- ignoreListenerArguments | ||
ignored: | ||
- handleRecoverableError |
13 changes: 13 additions & 0 deletions
13
pkg/front_end/parser_testcases/no-triple-shift/define_triple_shift_method_prime.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class Foo { | ||
Foo operator >>(_) => this; | ||
} | ||
|
||
main() { | ||
Foo foo = new Foo(); | ||
foo >> 42; | ||
print(foo >> 42); | ||
print(foo >>= 42); | ||
if ((foo >>= 42) == foo) { | ||
print("same"); | ||
} | ||
} |
137 changes: 137 additions & 0 deletions
137
pkg/front_end/parser_testcases/no-triple-shift/define_triple_shift_method_prime.dart.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
beginCompilationUnit(class) | ||
beginMetadataStar(class) | ||
endMetadataStar(0) | ||
beginClassOrNamedMixinApplicationPrelude(class) | ||
handleIdentifier(Foo, classOrMixinDeclaration) | ||
handleNoTypeVariables({) | ||
beginClassDeclaration(class, null, Foo) | ||
handleNoType(Foo) | ||
handleClassExtends(null, 1) | ||
handleClassNoWithClause() | ||
handleClassOrMixinImplements(null, 0) | ||
handleClassHeader(class, class, null) | ||
beginClassOrMixinBody(DeclarationKind.Class, {) | ||
beginMetadataStar(Foo) | ||
endMetadataStar(0) | ||
beginMember() | ||
beginMethod(null, null, null, null, null, operator) | ||
handleIdentifier(Foo, typeReference) | ||
handleNoTypeArguments(operator) | ||
handleType(Foo, null) | ||
handleOperatorName(operator, >>) | ||
handleNoTypeVariables(() | ||
beginFormalParameters((, MemberKind.NonStaticMethod) | ||
beginMetadataStar(_) | ||
endMetadataStar(0) | ||
beginFormalParameter(_, MemberKind.NonStaticMethod, null, null, null) | ||
handleNoType(() | ||
handleIdentifier(_, formalParameterDeclaration) | ||
handleFormalParameterWithoutValue()) | ||
endFormalParameter(null, null, _, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod) | ||
endFormalParameters(1, (, ), MemberKind.NonStaticMethod) | ||
handleNoInitializers() | ||
handleAsyncModifier(null, null) | ||
handleThisExpression(this, expression) | ||
handleExpressionFunctionBody(=>, ;) | ||
endClassMethod(null, Foo, (, null, ;) | ||
endMember() | ||
endClassOrMixinBody(DeclarationKind.Class, 1, {, }) | ||
endClassDeclaration(class, }) | ||
endTopLevelDeclaration(main) | ||
beginMetadataStar(main) | ||
endMetadataStar(0) | ||
beginTopLevelMember(main) | ||
beginTopLevelMethod(}, null) | ||
handleNoType(}) | ||
handleIdentifier(main, topLevelFunctionDeclaration) | ||
handleNoTypeVariables(() | ||
beginFormalParameters((, MemberKind.TopLevelMethod) | ||
endFormalParameters(0, (, ), MemberKind.TopLevelMethod) | ||
handleAsyncModifier(null, null) | ||
beginBlockFunctionBody({) | ||
beginMetadataStar(Foo) | ||
endMetadataStar(0) | ||
handleIdentifier(Foo, typeReference) | ||
handleNoTypeArguments(foo) | ||
handleType(Foo, null) | ||
beginVariablesDeclaration(foo, null, null) | ||
handleIdentifier(foo, localVariableDeclaration) | ||
beginInitializedIdentifier(foo) | ||
beginVariableInitializer(=) | ||
beginNewExpression(new) | ||
handleIdentifier(Foo, constructorReference) | ||
beginConstructorReference(Foo) | ||
handleNoTypeArguments(() | ||
handleNoConstructorReferenceContinuationAfterTypeArguments(() | ||
endConstructorReference(Foo, null, (, ConstructorReferenceContext.New) | ||
beginArguments(() | ||
endArguments(0, (, )) | ||
endNewExpression(new) | ||
endVariableInitializer(=) | ||
endInitializedIdentifier(foo) | ||
endVariablesDeclaration(1, ;) | ||
handleIdentifier(foo, expression) | ||
handleNoTypeArguments(>>) | ||
handleNoArguments(>>) | ||
handleSend(foo, >>) | ||
beginBinaryExpression(>>) | ||
handleLiteralInt(42) | ||
endBinaryExpression(>>) | ||
handleExpressionStatement(;) | ||
handleIdentifier(print, expression) | ||
handleNoTypeArguments(() | ||
beginArguments(() | ||
handleIdentifier(foo, expression) | ||
handleNoTypeArguments(>>) | ||
handleNoArguments(>>) | ||
handleSend(foo, >>) | ||
beginBinaryExpression(>>) | ||
handleLiteralInt(42) | ||
endBinaryExpression(>>) | ||
endArguments(1, (, )) | ||
handleSend(print, ;) | ||
handleExpressionStatement(;) | ||
handleIdentifier(print, expression) | ||
handleNoTypeArguments(() | ||
beginArguments(() | ||
handleIdentifier(foo, expression) | ||
handleNoTypeArguments(>>=) | ||
handleNoArguments(>>=) | ||
handleSend(foo, >>=) | ||
handleLiteralInt(42) | ||
handleAssignmentExpression(>>=) | ||
endArguments(1, (, )) | ||
handleSend(print, ;) | ||
handleExpressionStatement(;) | ||
beginIfStatement(if) | ||
handleIdentifier(foo, expression) | ||
handleNoTypeArguments(>>=) | ||
handleNoArguments(>>=) | ||
handleSend(foo, >>=) | ||
handleLiteralInt(42) | ||
handleAssignmentExpression(>>=) | ||
handleParenthesizedExpression(() | ||
beginBinaryExpression(==) | ||
handleIdentifier(foo, expression) | ||
handleNoTypeArguments()) | ||
handleNoArguments()) | ||
handleSend(foo, )) | ||
endBinaryExpression(==) | ||
handleParenthesizedCondition(() | ||
beginThenStatement({) | ||
beginBlock({, BlockKind(statement)) | ||
handleIdentifier(print, expression) | ||
handleNoTypeArguments(() | ||
beginArguments(() | ||
beginLiteralString("same") | ||
endLiteralString(0, )) | ||
endArguments(1, (, )) | ||
handleSend(print, ;) | ||
handleExpressionStatement(;) | ||
endBlock(1, {, }, BlockKind(statement)) | ||
endThenStatement(}) | ||
endIfStatement(if, null) | ||
endBlockFunctionBody(5, {, }) | ||
endTopLevelMethod(main, null, }) | ||
endTopLevelDeclaration() | ||
endCompilationUnit(2, ) |
Oops, something went wrong.