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

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

Issue 2850853004: Add 'scanGenericMethodComments' parameter to constructors and scan() functions. (Closed)
Patch Set: Parse generic method comments only in strong mode. Created 3 years, 7 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 | pkg/front_end/lib/src/fasta/scanner.dart » ('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) 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:async'; 5 import 'dart:async';
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:typed_data'; 7 import 'dart:typed_data';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 } 373 }
374 374
375 /** 375 /**
376 * Return a new parsed unresolved [CompilationUnit]. 376 * Return a new parsed unresolved [CompilationUnit].
377 */ 377 */
378 CompilationUnit parse(AnalysisErrorListener errorListener) { 378 CompilationUnit parse(AnalysisErrorListener errorListener) {
379 AnalysisOptions analysisOptions = _fsState._analysisOptions; 379 AnalysisOptions analysisOptions = _fsState._analysisOptions;
380 380
381 if (USE_FASTA_PARSER) { 381 if (USE_FASTA_PARSER) {
382 try { 382 try {
383 fasta.ScannerResult scanResult = 383 fasta.ScannerResult scanResult = fasta.scan(_contentBytes,
384 fasta.scan(_contentBytes, includeComments: true); 384 includeComments: true,
385 scanGenericMethodComments: analysisOptions.strongMode);
385 386
386 var astBuilder = new fasta.AstBuilder( 387 var astBuilder = new fasta.AstBuilder(
387 new ErrorReporter(errorListener, source), 388 new ErrorReporter(errorListener, source),
388 null, 389 null,
389 null, 390 null,
390 new _FastaElementStoreProxy(), 391 new _FastaElementStoreProxy(),
391 new fasta.Scope.top(isModifiable: true), 392 new fasta.Scope.top(isModifiable: true),
392 uri); 393 uri);
394 astBuilder.parseGenericMethodComments = analysisOptions.strongMode;
395
393 var parser = new fasta.Parser(astBuilder); 396 var parser = new fasta.Parser(astBuilder);
394 astBuilder.parser = parser; 397 astBuilder.parser = parser;
395 parser.parseUnit(scanResult.tokens); 398 parser.parseUnit(scanResult.tokens);
396 var unit = astBuilder.pop() as CompilationUnit; 399 var unit = astBuilder.pop() as CompilationUnit;
397 400
398 LineInfo lineInfo = new LineInfo(scanResult.lineStarts); 401 LineInfo lineInfo = new LineInfo(scanResult.lineStarts);
399 unit.lineInfo = lineInfo; 402 unit.lineInfo = lineInfo;
400 return unit; 403 return unit;
401 } catch (e, st) { 404 } catch (e, st) {
402 print(e); 405 print(e);
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 _FastaElementProxy operator [](fasta.Builder builder) => 926 _FastaElementProxy operator [](fasta.Builder builder) =>
924 _elements.putIfAbsent(builder, () => new _FastaElementProxy()); 927 _elements.putIfAbsent(builder, () => new _FastaElementProxy());
925 928
926 @override 929 @override
927 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 930 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
928 } 931 }
929 932
930 class _FastaInterfaceTypeProxy implements fasta.KernelInterfaceType { 933 class _FastaInterfaceTypeProxy implements fasta.KernelInterfaceType {
931 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 934 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
932 } 935 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698