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 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 Loading... |
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 Loading... |
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 } |
OLD | NEW |