Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2891)

Unified Diff: pkg/front_end/lib/src/fasta/source/outline_builder.dart

Issue 3003263002: add support for native methods in class
Patch Set: update listeners Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/source/outline_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/source/outline_builder.dart b/pkg/front_end/lib/src/fasta/source/outline_builder.dart
index a0a234256e5c5c164b93008addd72e77f696c285..0003142dc01d14f5c3c02c562de3c971a63503dc 100644
--- a/pkg/front_end/lib/src/fasta/source/outline_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/outline_builder.dart
@@ -16,6 +16,7 @@ import '../fasta_codes.dart'
show
Message,
codeExpectedBlockToSkip,
+ messageNativeClauseShouldBeAnnotation,
messageOperatorWithOptionalFormals,
messageTypedefNotFunction,
templateDuplicatedParameterName,
@@ -297,7 +298,9 @@ class OutlineBuilder extends UnhandledListener {
if (hasName) {
// Pop the native clause which in this case is a StringLiteral.
pop(); // Char offset.
- pop(); // String.
+ nativeMethodName = pop(); // String.
+ } else {
+ nativeMethodName = '';
}
}
@@ -391,7 +394,8 @@ class OutlineBuilder extends UnhandledListener {
}
@override
- void endMethod(Token getOrSet, Token beginToken, Token endToken) {
+ void endMethod(
+ Token getOrSet, Token beginToken, Token nativeToken, Token endToken) {
debugEvent("Method");
MethodBody bodyKind = pop();
if (bodyKind == MethodBody.RedirectingFactoryBody) {
@@ -917,6 +921,7 @@ class OutlineBuilder extends UnhandledListener {
@override
void handleRecoverableError(Token token, Message message) {
+ if (message == messageNativeClauseShouldBeAnnotation) return;
if (silenceParserErrors) {
debugEvent("RecoverableError");
} else {

Powered by Google App Engine
This is Rietveld 408576698