OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:convert'; | 5 import 'dart:convert'; |
6 import 'dart:typed_data'; | 6 import 'dart:typed_data'; |
7 | 7 |
8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
9 import 'package:analyzer/dart/ast/token.dart'; | 9 import 'package:analyzer/dart/ast/token.dart'; |
10 import 'package:analyzer/error/listener.dart'; | 10 import 'package:analyzer/error/listener.dart'; |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 } | 350 } |
351 | 351 |
352 /** | 352 /** |
353 * Return a new parsed unresolved [CompilationUnit]. | 353 * Return a new parsed unresolved [CompilationUnit]. |
354 */ | 354 */ |
355 CompilationUnit parse(AnalysisErrorListener errorListener) { | 355 CompilationUnit parse(AnalysisErrorListener errorListener) { |
356 AnalysisOptions analysisOptions = _fsState._analysisOptions; | 356 AnalysisOptions analysisOptions = _fsState._analysisOptions; |
357 | 357 |
358 if (USE_FASTA_PARSER) { | 358 if (USE_FASTA_PARSER) { |
359 try { | 359 try { |
360 fasta.ScannerResult scanResult = fasta.scan(_contentBytes); | 360 fasta.ScannerResult scanResult = |
| 361 fasta.scan(_contentBytes, includeComments: true); |
361 | 362 |
362 var astBuilder = new fasta.AstBuilder( | 363 var astBuilder = new fasta.AstBuilder( |
363 new ErrorReporter(errorListener, source), | 364 new ErrorReporter(errorListener, source), |
364 null, | 365 null, |
365 null, | 366 null, |
366 new _FastaElementStoreProxy(), | 367 new _FastaElementStoreProxy(), |
367 new _FastaEmptyScope(), | 368 new _FastaEmptyScope(), |
368 uri); | 369 uri); |
369 var parser = new fasta.Parser(astBuilder); | 370 var parser = new fasta.Parser(astBuilder); |
370 parser.parseUnit(scanResult.tokens); | 371 parser.parseUnit(scanResult.tokens); |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 802 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
802 } | 803 } |
803 | 804 |
804 class _FastaEmptyScope extends fasta.Scope { | 805 class _FastaEmptyScope extends fasta.Scope { |
805 _FastaEmptyScope() : super({}, null); | 806 _FastaEmptyScope() : super({}, null); |
806 } | 807 } |
807 | 808 |
808 class _FastaInterfaceTypeProxy implements fasta.KernelInterfaceType { | 809 class _FastaInterfaceTypeProxy implements fasta.KernelInterfaceType { |
809 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 810 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
810 } | 811 } |
OLD | NEW |