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

Side by Side Diff: pkg/analyzer/lib/src/dart/analysis/file_state.dart

Issue 2777613002: Include comments when parsing with Fasta in file_state. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698