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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 fasta.scan(_contentBytes, includeComments: true); | 360 fasta.scan(_contentBytes, includeComments: true); |
361 | 361 |
362 var astBuilder = new fasta.AstBuilder( | 362 var astBuilder = new fasta.AstBuilder( |
363 new ErrorReporter(errorListener, source), | 363 new ErrorReporter(errorListener, source), |
364 null, | 364 null, |
365 null, | 365 null, |
366 new _FastaElementStoreProxy(), | 366 new _FastaElementStoreProxy(), |
367 new fasta.Scope.top(isModifiable: true), | 367 new fasta.Scope.top(isModifiable: true), |
368 uri); | 368 uri); |
369 var parser = new fasta.Parser(astBuilder); | 369 var parser = new fasta.Parser(astBuilder); |
| 370 astBuilder.parser = parser; |
370 parser.parseUnit(scanResult.tokens); | 371 parser.parseUnit(scanResult.tokens); |
371 var unit = astBuilder.pop() as CompilationUnit; | 372 var unit = astBuilder.pop() as CompilationUnit; |
372 | 373 |
373 LineInfo lineInfo = new LineInfo(scanResult.lineStarts); | 374 LineInfo lineInfo = new LineInfo(scanResult.lineStarts); |
374 unit.lineInfo = lineInfo; | 375 unit.lineInfo = lineInfo; |
375 return unit; | 376 return unit; |
376 } catch (e, st) { | 377 } catch (e, st) { |
377 print(e); | 378 print(e); |
378 print(st); | 379 print(st); |
379 rethrow; | 380 rethrow; |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 _FastaElementProxy operator [](fasta.Builder builder) => | 798 _FastaElementProxy operator [](fasta.Builder builder) => |
798 _elements.putIfAbsent(builder, () => new _FastaElementProxy()); | 799 _elements.putIfAbsent(builder, () => new _FastaElementProxy()); |
799 | 800 |
800 @override | 801 @override |
801 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 802 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
802 } | 803 } |
803 | 804 |
804 class _FastaInterfaceTypeProxy implements fasta.KernelInterfaceType { | 805 class _FastaInterfaceTypeProxy implements fasta.KernelInterfaceType { |
805 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 806 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
806 } | 807 } |
OLD | NEW |