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

Side by Side Diff: tests/compiler/dart2js/parser_test.dart

Issue 14969024: Fix parser in case of unmatched angle bracket. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Re-upload Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/scanner/parser.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) 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 parse() { 299 parse() {
300 fullParseUnit(source, diagnosticHandler: new Collector()); 300 fullParseUnit(source, diagnosticHandler: new Collector());
301 } 301 }
302 check(Collector c) { 302 check(Collector c) {
303 Expect.equals(EOF_TOKEN, c.token); 303 Expect.equals(EOF_TOKEN, c.token);
304 return true; 304 return true;
305 } 305 }
306 Expect.throws(parse, check); 306 Expect.throws(parse, check);
307 } 307 }
308 308
309 void testUnmatchedAngleBracket() {
310 final String source = 'A<'; // unmatched '<'
311 parse() {
312 fullParseUnit(source, diagnosticHandler: new Collector());
313 }
314 check(Collector c) {
315 Expect.equals(LT_TOKEN, c.token);
316 return true;
317 }
318 Expect.throws(parse, check);
319 }
320
309 void main() { 321 void main() {
310 testGenericTypes(); 322 testGenericTypes();
311 // TODO(ahe): Enable this test when we handle library prefixes. 323 // TODO(ahe): Enable this test when we handle library prefixes.
312 // testPrefixedGenericTypes(); 324 // testPrefixedGenericTypes();
313 testUnaryExpression(); 325 testUnaryExpression();
314 testChainedMethodCalls(); 326 testChainedMethodCalls();
315 testFunctionStatement(); 327 testFunctionStatement();
316 testDoStatement(); 328 testDoStatement();
317 testWhileStatement(); 329 testWhileStatement();
318 testConditionalExpression(); 330 testConditionalExpression();
319 testAssignment(); 331 testAssignment();
320 testIndex(); 332 testIndex();
321 testPostfix(); 333 testPostfix();
322 testOperatorParse(); 334 testOperatorParse();
323 testMissingCloseParen(); 335 testMissingCloseParen();
324 testMissingCloseBraceInClass(); 336 testMissingCloseBraceInClass();
337 testUnmatchedAngleBracket();
325 } 338 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/scanner/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698