| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import 'parser_helper.dart'; | 6 import 'parser_helper.dart'; |
| 7 import '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart'; | 7 import '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart'; |
| 8 | 8 |
| 9 void testStatement(String statement) { | 9 void testStatement(String statement) { |
| 10 Node node = parseStatement(statement); | 10 Node node = parseStatement(statement); |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 Expect.stringEquals('operator', name.receiver.source); | 262 Expect.stringEquals('operator', name.receiver.source); |
| 263 Expect.stringEquals('-', name.selector.source); | 263 Expect.stringEquals('-', name.selector.source); |
| 264 Expect.isTrue(function.parameters.isEmpty); | 264 Expect.isTrue(function.parameters.isEmpty); |
| 265 Expect.isNull(function.returnType); | 265 Expect.isNull(function.returnType); |
| 266 Expect.isNull(function.getOrSet); | 266 Expect.isNull(function.getOrSet); |
| 267 } | 267 } |
| 268 | 268 |
| 269 class Collector implements DiagnosticListener { | 269 class Collector implements DiagnosticListener { |
| 270 int token = -1; | 270 int token = -1; |
| 271 | 271 |
| 272 void cancel(String reason, {node, token, instruction, element}) { | 272 void reportFatalError(Token token, |
| 273 messageKind, |
| 274 [Map arguments = const {}]) { |
| 273 this.token = token.kind; | 275 this.token = token.kind; |
| 274 throw this; | 276 throw this; |
| 275 } | 277 } |
| 276 | 278 |
| 277 void log(message) { | 279 void log(message) { |
| 278 print(message); | 280 print(message); |
| 279 } | 281 } |
| 280 } | 282 } |
| 281 | 283 |
| 282 void testMissingCloseParen() { | 284 void testMissingCloseParen() { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 testWhileStatement(); | 331 testWhileStatement(); |
| 330 testConditionalExpression(); | 332 testConditionalExpression(); |
| 331 testAssignment(); | 333 testAssignment(); |
| 332 testIndex(); | 334 testIndex(); |
| 333 testPostfix(); | 335 testPostfix(); |
| 334 testOperatorParse(); | 336 testOperatorParse(); |
| 335 testMissingCloseParen(); | 337 testMissingCloseParen(); |
| 336 testMissingCloseBraceInClass(); | 338 testMissingCloseBraceInClass(); |
| 337 testUnmatchedAngleBracket(); | 339 testUnmatchedAngleBracket(); |
| 338 } | 340 } |
| OLD | NEW |