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

Side by Side Diff: pkg/compiler/lib/src/scanner/diet_parser_task.dart

Issue 1313073007: Move parser and token related libraries into their own subfolder. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix unittests and try Created 5 years, 3 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
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4
5 library dart2js.parser.diet.task;
6
7 import '../common/tasks.dart' show
8 CompilerTask;
9 import '../compiler.dart' show
10 Compiler;
11 import '../elements/elements.dart' show
12 CompilationUnitElement;
13 import '../diagnostics/invariant.dart' show
14 invariant;
15
16 import 'listener.dart' show
17 ElementListener,
18 ParserError;
19 import 'partial_parser.dart' show
20 PartialParser;
21 import 'token.dart' show
22 Token;
23
24 class DietParserTask extends CompilerTask {
25 DietParserTask(Compiler compiler) : super(compiler);
26 final String name = 'Diet Parser';
27
28 dietParse(CompilationUnitElement compilationUnit, Token tokens) {
29 measure(() {
30 Function idGenerator = compiler.getNextFreeClassId;
31 ElementListener listener =
32 new ElementListener(compiler, compilationUnit, idGenerator);
33 PartialParser parser = new PartialParser(listener);
34 try {
35 parser.parseUnit(tokens);
36 } on ParserError catch(_) {
37 assert(invariant(compilationUnit, compiler.compilationFailed));
38 }
39 });
40 }
41 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/scanner/class_element_parser.dart ('k') | pkg/compiler/lib/src/scanner/keyword.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698