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

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

Issue 2567133002: Add support for the new function-type syntax. (Closed)
Patch Set: Fixes after rebase. Created 3 years, 10 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
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 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 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 library dart2js.parser.diet.task; 5 library dart2js.parser.diet.task;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/tasks.dart' show CompilerTask, Measurer; 8 import '../common/tasks.dart' show CompilerTask, Measurer;
9 import '../elements/elements.dart' show CompilationUnitElement; 9 import '../elements/elements.dart' show CompilationUnitElement;
10 import '../js_backend/backend.dart' show JavaScriptBackend; 10 import '../js_backend/backend.dart' show JavaScriptBackend;
11 import '../id_generator.dart'; 11 import '../id_generator.dart';
12 import 'package:front_end/src/fasta/scanner.dart' show Token; 12 import 'package:front_end/src/fasta/scanner.dart' show Token;
13 import 'element_listener.dart' show ElementListener, ScannerOptions; 13 import 'element_listener.dart' show ElementListener, ScannerOptions;
14 import 'package:front_end/src/fasta/parser.dart' 14 import 'package:front_end/src/fasta/parser.dart'
15 show Listener, ParserError, TopLevelParser; 15 show Listener, ParserError, TopLevelParser;
16 16
17 class PartialParser extends TopLevelParser { 17 class PartialParser extends TopLevelParser {
18 PartialParser(Listener listener) : super(listener); 18 PartialParser(Listener listener) : super(listener);
19 19
20 Token parseFormalParameters(Token token) => skipFormalParameters(token); 20 Token parseFormalParameters(Token token, {bool inFunctionType: false}) {
21 return skipFormalParameters(token);
22 }
21 } 23 }
22 24
23 class DietParserTask extends CompilerTask { 25 class DietParserTask extends CompilerTask {
24 final IdGenerator _idGenerator; 26 final IdGenerator _idGenerator;
25 final JavaScriptBackend _backend; 27 final JavaScriptBackend _backend;
26 final DiagnosticReporter _reporter; 28 final DiagnosticReporter _reporter;
27 29
28 DietParserTask( 30 DietParserTask(
29 this._idGenerator, this._backend, this._reporter, Measurer measurer) 31 this._idGenerator, this._backend, this._reporter, Measurer measurer)
30 : super(measurer); 32 : super(measurer);
(...skipping 10 matching lines...) Expand all
41 try { 43 try {
42 parser.parseUnit(tokens); 44 parser.parseUnit(tokens);
43 } on ParserError catch (_) { 45 } on ParserError catch (_) {
44 // TODO(johnniwinther): assert that the error was reported once there is 46 // TODO(johnniwinther): assert that the error was reported once there is
45 // a [hasErrorBeenReported] field in [DiagnosticReporter] 47 // a [hasErrorBeenReported] field in [DiagnosticReporter]
46 // The error should have already been reported by the parser. 48 // The error should have already been reported by the parser.
47 } 49 }
48 }); 50 });
49 } 51 }
50 } 52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698