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

Side by Side Diff: pkg/analyzer/lib/src/fasta/ast_builder.dart

Issue 2759173002: Switch to IdentifierContext. (Closed)
Patch Set: Status file. 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 | pkg/analyzer/test/generated/parser_fasta_test.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 library fasta.analyzer.ast_builder; 5 library fasta.analyzer.ast_builder;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; 8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory;
9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; 9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard;
10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token; 10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token;
11 import 'package:analyzer/dart/element/element.dart' show Element; 11 import 'package:analyzer/dart/element/element.dart' show Element;
12 import 'package:front_end/src/fasta/parser/parser.dart' show FormalParameterType ; 12 import 'package:front_end/src/fasta/parser/parser.dart'
13 import 'package:front_end/src/fasta/scanner/token.dart' show BeginGroupToken, To ken; 13 show FormalParameterType;
14 import 'package:front_end/src/fasta/scanner/token.dart'
15 show BeginGroupToken, Token;
14 16
15 import 'package:front_end/src/fasta/errors.dart' show internalError; 17 import 'package:front_end/src/fasta/errors.dart' show internalError;
16 import 'package:front_end/src/fasta/kernel/kernel_builder.dart' 18 import 'package:front_end/src/fasta/kernel/kernel_builder.dart'
17 show Builder, KernelLibraryBuilder, ProcedureBuilder; 19 show Builder, KernelLibraryBuilder, ProcedureBuilder;
18 import 'package:front_end/src/fasta/parser/identifier_context.dart' show Identif ierContext; 20 import 'package:front_end/src/fasta/parser/identifier_context.dart'
21 show IdentifierContext;
19 import 'package:front_end/src/fasta/quote.dart'; 22 import 'package:front_end/src/fasta/quote.dart';
20 import 'package:front_end/src/fasta/source/scope_listener.dart' 23 import 'package:front_end/src/fasta/source/scope_listener.dart'
21 show JumpTargetKind, NullValue, Scope, ScopeListener; 24 show JumpTargetKind, NullValue, Scope, ScopeListener;
22 import 'analyzer.dart' show toKernel; 25 import 'analyzer.dart' show toKernel;
23 import 'element_store.dart' 26 import 'element_store.dart'
24 show 27 show
25 AnalyzerLocalVariableElemment, 28 AnalyzerLocalVariableElemment,
26 AnalyzerParameterElement, 29 AnalyzerParameterElement,
27 ElementStore, 30 ElementStore,
28 KernelClassElement; 31 KernelClassElement;
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 push(ast.mapLiteralEntry(key, toAnalyzerToken(colon), value)); 575 push(ast.mapLiteralEntry(key, toAnalyzerToken(colon), value));
573 } 576 }
574 577
575 void endLiteralSymbol(Token hashToken, int tokenCount) { 578 void endLiteralSymbol(Token hashToken, int tokenCount) {
576 debugEvent("LiteralSymbol"); 579 debugEvent("LiteralSymbol");
577 List<analyzer.Token> components = popList(tokenCount); 580 List<analyzer.Token> components = popList(tokenCount);
578 push(ast.symbolLiteral(toAnalyzerToken(hashToken), components)); 581 push(ast.symbolLiteral(toAnalyzerToken(hashToken), components));
579 } 582 }
580 583
581 @override 584 @override
582 void handleSuperExpression(Token token) { 585 void handleSuperExpression(Token token, IdentifierContext context) {
583 debugEvent("SuperExpression"); 586 debugEvent("SuperExpression");
584 push(ast.superExpression(toAnalyzerToken(token))); 587 push(ast.superExpression(toAnalyzerToken(token)));
585 } 588 }
586 589
587 @override 590 @override
588 void handleThisExpression(Token token) { 591 void handleThisExpression(Token token, IdentifierContext context) {
589 debugEvent("ThisExpression"); 592 debugEvent("ThisExpression");
590 push(ast.thisExpression(toAnalyzerToken(token))); 593 push(ast.thisExpression(toAnalyzerToken(token)));
591 } 594 }
592 595
593 void handleType(Token beginToken, Token endToken) { 596 void handleType(Token beginToken, Token endToken) {
594 debugEvent("Type"); 597 debugEvent("Type");
595 TypeArgumentList arguments = pop(); 598 TypeArgumentList arguments = pop();
596 Identifier name = pop(); 599 Identifier name = pop();
597 // TODO(paulberry,ahe): what if the type doesn't resolve to a class 600 // TODO(paulberry,ahe): what if the type doesn't resolve to a class
598 // element? Try to share code with BodyBuilder.builderToFirstExpression. 601 // element? Try to share code with BodyBuilder.builderToFirstExpression.
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 } else if (identical('static', s)) { 1793 } else if (identical('static', s)) {
1791 staticKeyword = token; 1794 staticKeyword = token;
1792 } else if (identical('var', s)) { 1795 } else if (identical('var', s)) {
1793 finalConstOrVarKeyword = token; 1796 finalConstOrVarKeyword = token;
1794 } else { 1797 } else {
1795 internalError('Unhandled modifier: $s'); 1798 internalError('Unhandled modifier: $s');
1796 } 1799 }
1797 } 1800 }
1798 } 1801 }
1799 } 1802 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_fasta_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698