OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart2js.parser.node_listener; | 5 library dart2js.parser.node_listener; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../elements/elements.dart' show | 8 import '../elements/elements.dart' show |
9 CompilationUnitElement; | 9 CompilationUnitElement; |
10 import '../native/native.dart' as native; | 10 import '../native/native.dart' as native; |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 | 443 |
444 void endAwaitExpression(Token awaitToken, Token endToken) { | 444 void endAwaitExpression(Token awaitToken, Token endToken) { |
445 Expression expression = popNode(); | 445 Expression expression = popNode(); |
446 pushNode(new Await(awaitToken, expression)); | 446 pushNode(new Await(awaitToken, expression)); |
447 } | 447 } |
448 | 448 |
449 void endRethrowStatement(Token throwToken, Token endToken) { | 449 void endRethrowStatement(Token throwToken, Token endToken) { |
450 pushNode(new Rethrow(throwToken, endToken)); | 450 pushNode(new Rethrow(throwToken, endToken)); |
451 if (identical(throwToken.stringValue, 'throw')) { | 451 if (identical(throwToken.stringValue, 'throw')) { |
452 reporter.reportErrorMessage( | 452 reporter.reportErrorMessage( |
453 throwToken, MessageKind.UNSUPPORTED_THROW_WITHOUT_EXP); | 453 throwToken, MessageKind.MISSING_EXPRESSION_IN_THROW); |
454 } | 454 } |
455 } | 455 } |
456 | 456 |
457 void handleUnaryPrefixExpression(Token token) { | 457 void handleUnaryPrefixExpression(Token token) { |
458 pushNode(new Send.prefix(popNode(), new Operator(token))); | 458 pushNode(new Send.prefix(popNode(), new Operator(token))); |
459 } | 459 } |
460 | 460 |
461 void handleSuperExpression(Token token) { | 461 void handleSuperExpression(Token token) { |
462 pushNode(new Identifier(token)); | 462 pushNode(new Identifier(token)); |
463 } | 463 } |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 void log(message) { | 814 void log(message) { |
815 reporter.log(message); | 815 reporter.log(message); |
816 } | 816 } |
817 | 817 |
818 void internalError({Token token, Node node}) { | 818 void internalError({Token token, Node node}) { |
819 // TODO(ahe): This should call reporter.internalError. | 819 // TODO(ahe): This should call reporter.internalError. |
820 Spannable spannable = (token == null) ? node : token; | 820 Spannable spannable = (token == null) ? node : token; |
821 throw new SpannableAssertionFailure(spannable, 'Internal error in parser.'); | 821 throw new SpannableAssertionFailure(spannable, 'Internal error in parser.'); |
822 } | 822 } |
823 } | 823 } |
OLD | NEW |