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

Unified Diff: lib/src/codegen/ast_builder.dart

Issue 1316723003: implement null aware ops, fixes #249 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 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
« no previous file with comments | « lib/src/checker/checker.dart ('k') | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/ast_builder.dart
diff --git a/lib/src/codegen/ast_builder.dart b/lib/src/codegen/ast_builder.dart
index 85f6354deab26e24758b8c0b3c3351220a0a64d1..860da4c299adf2a082e71fdb2c92302b3eb1df44 100644
--- a/lib/src/codegen/ast_builder.dart
+++ b/lib/src/codegen/ast_builder.dart
@@ -100,6 +100,18 @@ class AstBuilder {
return parenthesizedExpression(exp);
}
+ static PropertyAccess propertyAccess(
+ Expression target, SimpleIdentifier name) {
+ var p = new Token(TokenType.PERIOD, 0);
+ return new PropertyAccess(target, p, name);
+ }
+
+ static MethodInvocation methodInvoke(
+ Expression target, SimpleIdentifier name, NodeList<Expression> args) {
+ var p = new Token(TokenType.PERIOD, 0);
+ return new MethodInvocation(target, p, name, null, argumentList(args));
+ }
+
static TokenType getTokenType(String lexeme) {
switch (lexeme) {
case "&":
@@ -218,6 +230,10 @@ class AstBuilder {
return TokenType.BACKSLASH;
case "...":
return TokenType.PERIOD_PERIOD_PERIOD;
+ case "??":
+ return TokenType.QUESTION_QUESTION;
+ case "??=":
+ return TokenType.QUESTION_QUESTION_EQ;
default:
return null;
}
« no previous file with comments | « lib/src/checker/checker.dart ('k') | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698