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

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

Issue 2726693002: Parse ParenthesizedExpression as Fasta. (Closed)
Patch Set: 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 | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | no next file » | 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;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 createJumpTarget(JumpTargetKind kind, int charOffset) { 61 createJumpTarget(JumpTargetKind kind, int charOffset) {
62 // TODO(ahe): Implement jump targets. 62 // TODO(ahe): Implement jump targets.
63 return null; 63 return null;
64 } 64 }
65 65
66 void beginLiteralString(Token token) { 66 void beginLiteralString(Token token) {
67 debugEvent("beginLiteralString"); 67 debugEvent("beginLiteralString");
68 push(token); 68 push(token);
69 } 69 }
70 70
71 @override
72 void handleParenthesizedExpression(BeginGroupToken token) {
73 debugEvent("ParenthesizedExpression");
74 Expression expression = pop();
75 push(ast.parenthesizedExpression(
76 toAnalyzerToken(token), expression, toAnalyzerToken(token.endGroup)));
77 }
78
71 void handleStringPart(Token token) { 79 void handleStringPart(Token token) {
72 debugEvent("StringPart"); 80 debugEvent("StringPart");
73 push(token); 81 push(token);
74 } 82 }
75 83
76 void doStringPart(Token token) { 84 void doStringPart(Token token) {
77 push(ast.simpleStringLiteral(toAnalyzerToken(token), token.value)); 85 push(ast.simpleStringLiteral(toAnalyzerToken(token), token.value));
78 } 86 }
79 87
80 void endLiteralString(int interpolationCount) { 88 void endLiteralString(int interpolationCount) {
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1351 1359
1352 /// Data structure placed on the stack as a container for optional parameters. 1360 /// Data structure placed on the stack as a container for optional parameters.
1353 class _OptionalFormalParameters { 1361 class _OptionalFormalParameters {
1354 final List<FormalParameter> parameters; 1362 final List<FormalParameter> parameters;
1355 final Token leftDelimiter; 1363 final Token leftDelimiter;
1356 final Token rightDelimiter; 1364 final Token rightDelimiter;
1357 1365
1358 _OptionalFormalParameters( 1366 _OptionalFormalParameters(
1359 this.parameters, this.leftDelimiter, this.rightDelimiter); 1367 this.parameters, this.leftDelimiter, this.rightDelimiter);
1360 } 1368 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698