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

Unified Diff: dart/frog/leg/tree/nodes.dart

Issue 8999015: Generate AST node for factory methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix type errors Created 9 years 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 | « dart/frog/leg/scanner/listener.dart ('k') | dart/frog/presubmit.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/tree/nodes.dart
diff --git a/dart/frog/leg/tree/nodes.dart b/dart/frog/leg/tree/nodes.dart
index f0b7bcbf20a27788af48a5ae79dcf0cf9bb85481..0ad6d3cc68bc3cc7b82cf0354a58e55f6ea85073 100644
--- a/dart/frog/leg/tree/nodes.dart
+++ b/dart/frog/leg/tree/nodes.dart
@@ -808,6 +808,7 @@ class Modifiers extends Node {
static final int FLAG_FINAL = FLAG_ABSTRACT << 1;
static final int FLAG_VAR = FLAG_FINAL << 1;
static final int FLAG_CONST = FLAG_VAR << 1;
+ static final int FLAG_FACTORY = FLAG_CONST << 1;
Modifiers(NodeList nodes)
: this.nodes = nodes, flags = computeFlags(nodes.nodes);
@@ -821,6 +822,8 @@ class Modifiers extends Node {
else if (value === 'final') flags += FLAG_FINAL;
else if (value === 'var') flags += FLAG_VAR;
else if (value === 'const') flags += FLAG_CONST;
+ else if (value === 'factory') flags += FLAG_FACTORY;
+ else throw 'internal error: ${nodes.head}';
}
return flags;
}
@@ -836,6 +839,7 @@ class Modifiers extends Node {
bool isFinal() => (flags & FLAG_FINAL) != 0;
bool isVar() => (flags & FLAG_VAR) != 0;
bool isConst() => (flags & FLAG_CONST) != 0;
+ bool isFactory() => (flags & FLAG_FACTORY) != 0;
}
class StringInterpolation extends Expression {
« no previous file with comments | « dart/frog/leg/scanner/listener.dart ('k') | dart/frog/presubmit.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698