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

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

Issue 2797343003: Support for parsing native function bodies with Fasta. (Closed)
Patch Set: Created 3 years, 8 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/analyzer/lib/src/fasta/ast_builder.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: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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/fasta/ast_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698