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

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

Issue 2730293003: Fix for parsing 'rethrow' statement with 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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 559
560 void handleConditionalExpression(Token question, Token colon) { 560 void handleConditionalExpression(Token question, Token colon) {
561 debugEvent("ConditionalExpression"); 561 debugEvent("ConditionalExpression");
562 Expression elseExpression = pop(); 562 Expression elseExpression = pop();
563 Expression thenExpression = pop(); 563 Expression thenExpression = pop();
564 Expression condition = pop(); 564 Expression condition = pop();
565 push(ast.conditionalExpression(condition, toAnalyzerToken(question), 565 push(ast.conditionalExpression(condition, toAnalyzerToken(question),
566 thenExpression, toAnalyzerToken(colon), elseExpression)); 566 thenExpression, toAnalyzerToken(colon), elseExpression));
567 } 567 }
568 568
569 @override
570 void endRethrowStatement(Token throwToken, Token endToken) {
Brian Wilkerson 2017/03/06 19:47:28 "throwToken" --> "rethrowToken"?
571 debugEvent("RethrowStatement");
572 RethrowExpression expression =
573 ast.rethrowExpression(toAnalyzerToken(throwToken));
574 // TODO(scheglov) According to the specification, 'rethrow' is a statement.
575 push(ast.expressionStatement(expression, toAnalyzerToken(endToken)));
576 }
577
569 void endThrowExpression(Token throwToken, Token endToken) { 578 void endThrowExpression(Token throwToken, Token endToken) {
570 debugEvent("ThrowExpression"); 579 debugEvent("ThrowExpression");
571 push(ast.throwExpression(toAnalyzerToken(throwToken), pop())); 580 push(ast.throwExpression(toAnalyzerToken(throwToken), pop()));
572 } 581 }
573 582
574 @override 583 @override
575 void endOptionalFormalParameters( 584 void endOptionalFormalParameters(
576 int count, Token beginToken, Token endToken) { 585 int count, Token beginToken, Token endToken) {
577 debugEvent("OptionalFormalParameters"); 586 debugEvent("OptionalFormalParameters");
578 push(new _OptionalFormalParameters(popList(count), beginToken, endToken)); 587 push(new _OptionalFormalParameters(popList(count), beginToken, endToken));
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 } else if (identical('static', s)) { 1480 } else if (identical('static', s)) {
1472 staticKeyword = token; 1481 staticKeyword = token;
1473 } else if (identical('var', s)) { 1482 } else if (identical('var', s)) {
1474 finalConstOrVarKeyword = token; 1483 finalConstOrVarKeyword = token;
1475 } else { 1484 } else {
1476 internalError('Unhandled modifier: $s'); 1485 internalError('Unhandled modifier: $s');
1477 } 1486 }
1478 } 1487 }
1479 } 1488 }
1480 } 1489 }
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