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

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: 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, scanGenericMethodComments: true);
Paul Berry 2017/04/28 21:39:52 Why not scanGenericMethodComments: analysisOpti
scheglov 2017/04/28 21:42:38 Fixed, thanks.
385 385
386 var astBuilder = new fasta.AstBuilder( 386 var astBuilder = new fasta.AstBuilder(
387 new ErrorReporter(errorListener, source), 387 new ErrorReporter(errorListener, source),
388 null, 388 null,
389 null, 389 null,
390 new _FastaElementStoreProxy(), 390 new _FastaElementStoreProxy(),
391 new fasta.Scope.top(isModifiable: true), 391 new fasta.Scope.top(isModifiable: true),
392 uri); 392 uri);
393 astBuilder.parseGenericMethodComments = analysisOptions.strongMode;
394
393 var parser = new fasta.Parser(astBuilder); 395 var parser = new fasta.Parser(astBuilder);
394 astBuilder.parser = parser; 396 astBuilder.parser = parser;
395 parser.parseUnit(scanResult.tokens); 397 parser.parseUnit(scanResult.tokens);
396 var unit = astBuilder.pop() as CompilationUnit; 398 var unit = astBuilder.pop() as CompilationUnit;
397 399
398 LineInfo lineInfo = new LineInfo(scanResult.lineStarts); 400 LineInfo lineInfo = new LineInfo(scanResult.lineStarts);
399 unit.lineInfo = lineInfo; 401 unit.lineInfo = lineInfo;
400 return unit; 402 return unit;
401 } catch (e, st) { 403 } catch (e, st) {
402 print(e); 404 print(e);
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 _FastaElementProxy operator [](fasta.Builder builder) => 925 _FastaElementProxy operator [](fasta.Builder builder) =>
924 _elements.putIfAbsent(builder, () => new _FastaElementProxy()); 926 _elements.putIfAbsent(builder, () => new _FastaElementProxy());
925 927
926 @override 928 @override
927 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 929 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
928 } 930 }
929 931
930 class _FastaInterfaceTypeProxy implements fasta.KernelInterfaceType { 932 class _FastaInterfaceTypeProxy implements fasta.KernelInterfaceType {
931 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 933 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
932 } 934 }
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