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:front_end/src/fasta/scanner/token.dart' show | 7 import 'package:front_end/src/fasta/scanner/token.dart' show |
8 BeginGroupToken, | 8 BeginGroupToken, |
9 Token; | 9 Token; |
10 | 10 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 } | 121 } |
122 | 122 |
123 void handleStringJuxtaposition(int literalCount) { | 123 void handleStringJuxtaposition(int literalCount) { |
124 debugEvent("StringJuxtaposition"); | 124 debugEvent("StringJuxtaposition"); |
125 push(ast.adjacentStrings(popList(literalCount))); | 125 push(ast.adjacentStrings(popList(literalCount))); |
126 } | 126 } |
127 | 127 |
128 void endArguments(int count, Token beginToken, Token endToken) { | 128 void endArguments(int count, Token beginToken, Token endToken) { |
129 debugEvent("Arguments"); | 129 debugEvent("Arguments"); |
130 List expressions = popList(count); | 130 List<Expression> expressions = popList(count); |
131 ArgumentList arguments = ast.argumentList(toAnalyzerToken(beginToken), | 131 ArgumentList arguments = ast.argumentList(toAnalyzerToken(beginToken), |
132 expressions, toAnalyzerToken(endToken)); | 132 expressions, toAnalyzerToken(endToken)); |
133 push(ast.methodInvocation(null, null, null, null, arguments)); | 133 push(ast.methodInvocation(null, null, null, null, arguments)); |
134 } | 134 } |
135 | 135 |
136 void beginExpression(Token token) { | 136 void beginExpression(Token token) { |
137 isFirstIdentifier = true; | 137 isFirstIdentifier = true; |
138 } | 138 } |
139 | 139 |
140 void handleIdentifier(Token token) { | 140 void handleIdentifier(Token token) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 void doPropertyGet(Token token) { | 180 void doPropertyGet(Token token) { |
181 } | 181 } |
182 | 182 |
183 void endExpressionStatement(Token token) { | 183 void endExpressionStatement(Token token) { |
184 debugEvent("ExpressionStatement"); | 184 debugEvent("ExpressionStatement"); |
185 push(ast.expressionStatement(pop(), toAnalyzerToken(token))); | 185 push(ast.expressionStatement(pop(), toAnalyzerToken(token))); |
186 } | 186 } |
187 | 187 |
188 void endFunctionBody(int count, Token beginToken, Token endToken) { | 188 void endFunctionBody(int count, Token beginToken, Token endToken) { |
189 debugEvent("FunctionBody"); | 189 debugEvent("FunctionBody"); |
190 List statements = popList(count); | 190 List<Statement> statements = popList(count); |
191 if (beginToken != null) { | 191 if (beginToken != null) { |
192 exitLocalScope(); | 192 exitLocalScope(); |
193 } | 193 } |
194 push(ast.block(toAnalyzerToken(beginToken), statements, | 194 push(ast.block(toAnalyzerToken(beginToken), statements, |
195 toAnalyzerToken(endToken))); | 195 toAnalyzerToken(endToken))); |
196 } | 196 } |
197 | 197 |
198 void finishFunction(formals, asyncModifier, Statement body) { | 198 void finishFunction(formals, asyncModifier, Statement body) { |
199 debugEvent("finishFunction"); | 199 debugEvent("finishFunction"); |
200 var kernel = toKernel(body, elementStore, library.library, scope); | 200 var kernel = toKernel(body, elementStore, library.library, scope); |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 debugEvent("Modifier"); | 586 debugEvent("Modifier"); |
587 // TODO(ahe): Don't ignore modifiers. | 587 // TODO(ahe): Don't ignore modifiers. |
588 } | 588 } |
589 | 589 |
590 void handleModifiers(int count) { | 590 void handleModifiers(int count) { |
591 debugEvent("Modifiers"); | 591 debugEvent("Modifiers"); |
592 // TODO(ahe): Don't ignore modifiers. | 592 // TODO(ahe): Don't ignore modifiers. |
593 push(NullValue.Modifiers); | 593 push(NullValue.Modifiers); |
594 } | 594 } |
595 } | 595 } |
OLD | NEW |