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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/ast/AstFactory.java

Issue 192303002: Support for @DartName and @DartOptional annotations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/ast/AstFactory.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/ast/AstFactory.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/ast/AstFactory.java
index 5bd8d984a2220bf1db39dc6ee56ac0da95923c74..9ba42d97e829579d28cb6f83616ecd3c6cbe6a06 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/ast/AstFactory.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/ast/AstFactory.java
@@ -18,6 +18,8 @@ import com.google.dart.engine.scanner.Keyword;
import com.google.dart.engine.scanner.Token;
import com.google.dart.engine.scanner.TokenType;
import com.google.dart.engine.utilities.dart.ParameterKind;
+import com.google.dart.engine.utilities.translation.DartOmit;
+import com.google.dart.engine.utilities.translation.DartOptional;
import static com.google.dart.engine.scanner.TokenFactory.tokenFromKeyword;
import static com.google.dart.engine.scanner.TokenFactory.tokenFromString;
@@ -327,17 +329,16 @@ public final class AstFactory {
name == null ? null : identifier(name));
}
+ @DartOmit
public static ContinueStatement continueStatement() {
- return new ContinueStatement(
- tokenFromKeyword(Keyword.CONTINUE),
- null,
- tokenFromType(TokenType.SEMICOLON));
+ return continueStatement(null);
}
- public static ContinueStatement continueStatement(String label) {
+ public static ContinueStatement continueStatement(@DartOptional String label) {
+ SimpleIdentifier labelNode = label == null ? null : identifier(label);
return new ContinueStatement(
tokenFromKeyword(Keyword.CONTINUE),
- identifier(label),
+ labelNode,
tokenFromType(TokenType.SEMICOLON));
}
@@ -431,21 +432,14 @@ public final class AstFactory {
return fieldDeclaration(isStatic, keyword, null, variables);
}
+ @DartOmit
public static FieldFormalParameter fieldFormalParameter(Keyword keyword, TypeName type,
String identifier) {
- return new FieldFormalParameter(
- null,
- null,
- keyword == null ? null : tokenFromKeyword(keyword),
- type,
- tokenFromKeyword(Keyword.THIS),
- tokenFromType(TokenType.PERIOD),
- identifier(identifier),
- null);
+ return fieldFormalParameter(keyword, type, identifier, null);
}
public static FieldFormalParameter fieldFormalParameter(Keyword keyword, TypeName type,
- String identifier, FormalParameterList parameterList) {
+ String identifier, @DartOptional FormalParameterList parameterList) {
return new FieldFormalParameter(
null,
null,

Powered by Google App Engine
This is Rietveld 408576698