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

Side by Side Diff: dart/frog/leg/scanner/scanner_task.dart

Issue 9839004: Fix co19 crashes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/frog/leg/scanner/parser.dart ('k') | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class ScannerTask extends CompilerTask { 5 class ScannerTask extends CompilerTask {
6 ScannerTask(Compiler compiler) : super(compiler); 6 ScannerTask(Compiler compiler) : super(compiler);
7 String get name() => 'Scanner'; 7 String get name() => 'Scanner';
8 8
9 void scan(CompilationUnitElement compilationUnit) { 9 void scan(CompilationUnitElement compilationUnit) {
10 measure(() { 10 measure(() {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 return library; 103 return library;
104 } 104 }
105 105
106 void importLibrary(LibraryElement library, LibraryElement imported, 106 void importLibrary(LibraryElement library, LibraryElement imported,
107 ScriptTag tag) { 107 ScriptTag tag) {
108 if (tag !== null && tag.prefix !== null) { 108 if (tag !== null && tag.prefix !== null) {
109 SourceString prefix = 109 SourceString prefix =
110 new SourceString(tag.prefix.dartString.slowToString()); 110 new SourceString(tag.prefix.dartString.slowToString());
111 Element e = library.find(prefix); 111 Element e = library.find(prefix);
112 if (e === null) { 112 if (e === null) {
113 e = new PrefixElement(prefix, library); 113 e = new PrefixElement(prefix, library, tag.getBeginToken());
114 library.define(e, compiler); 114 library.define(e, compiler);
115 } 115 }
116 if (e.kind !== ElementKind.PREFIX) { 116 if (e.kind !== ElementKind.PREFIX) {
117 compiler.withCurrentElement(e, () { 117 compiler.withCurrentElement(e, () {
118 compiler.reportWarning(new Identifier(e.position()), 118 compiler.reportWarning(new Identifier(e.position()),
119 'duplicated definition'); 119 'duplicated definition');
120 }); 120 });
121 compiler.reportError(tag.prefix, 'duplicate defintion'); 121 compiler.reportError(tag.prefix, 'duplicate defintion');
122 } 122 }
123 imported.forEachExport((Element element) { 123 imported.forEachExport((Element element) {
(...skipping 24 matching lines...) Expand all
148 final String name = 'Diet Parser'; 148 final String name = 'Diet Parser';
149 149
150 dietParse(CompilationUnitElement compilationUnit, Token tokens) { 150 dietParse(CompilationUnitElement compilationUnit, Token tokens) {
151 measure(() { 151 measure(() {
152 ElementListener listener = new ElementListener(compiler, compilationUnit); 152 ElementListener listener = new ElementListener(compiler, compilationUnit);
153 PartialParser parser = new PartialParser(listener); 153 PartialParser parser = new PartialParser(listener);
154 parser.parseUnit(tokens); 154 parser.parseUnit(tokens);
155 }); 155 });
156 } 156 }
157 } 157 }
OLDNEW
« no previous file with comments | « dart/frog/leg/scanner/parser.dart ('k') | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698