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

Unified Diff: pkg/compiler/lib/src/parser/element_listener.dart

Issue 1867243004: Begin refactoring compiler out of diet parser and scanner (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « pkg/compiler/lib/src/parser/diet_parser_task.dart ('k') | pkg/compiler/lib/src/patch_parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/parser/element_listener.dart
diff --git a/pkg/compiler/lib/src/parser/element_listener.dart b/pkg/compiler/lib/src/parser/element_listener.dart
index 30d155cf9fe216c997d003594b3235b3d6d8f504..1554f9e23feb5329353f024fa06a289ef8db7455 100644
--- a/pkg/compiler/lib/src/parser/element_listener.dart
+++ b/pkg/compiler/lib/src/parser/element_listener.dart
@@ -19,6 +19,7 @@ import '../elements/modelx.dart'
LibraryElementX,
NamedMixinApplicationElementX,
VariableList;
+import '../id_generator.dart';
import '../native/native.dart' as native;
import '../string_validator.dart' show StringValidator;
import '../tokens/keyword.dart' show Keyword;
@@ -39,8 +40,6 @@ import 'partial_elements.dart'
PartialTypedefElement;
import 'listener.dart' show closeBraceFor, Listener, ParserError, VERBOSE;
-typedef int IdGenerator();
-
/// Options used for scanning.
///
/// Use this to conditionally support special tokens.
@@ -171,7 +170,7 @@ class ElementListener extends Listener {
NodeList names = makeNodeList(count, enumKeyword.next.next, endBrace, ",");
Identifier name = popNode();
- int id = idGenerator();
+ int id = idGenerator.getNextFreeId();
Element enclosing = compilationUnitElement;
pushElement(new EnumClassElementX(
name.source, enclosing, id, new Enum(enumKeyword, name, names)));
@@ -249,7 +248,7 @@ class ElementListener extends Listener {
popNode(); // superType
popNode(); // typeParameters
Identifier name = popNode();
- int id = idGenerator();
+ int id = idGenerator.getNextFreeId();
PartialClassElement element = new PartialClassElement(
name.source, beginToken, endToken, compilationUnitElement, id);
pushElement(element);
@@ -290,7 +289,7 @@ class ElementListener extends Listener {
classKeyword,
endToken);
- int id = idGenerator();
+ int id = idGenerator.getNextFreeId();
Element enclosing = compilationUnitElement;
pushElement(new NamedMixinApplicationElementX(
name.source, enclosing, id, namedMixinApplication));
« no previous file with comments | « pkg/compiler/lib/src/parser/diet_parser_task.dart ('k') | pkg/compiler/lib/src/patch_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698