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

Side by Side Diff: dart/frog/tests/leg/src/ParserTest.dart

Issue 8883024: Parse all variations of for-statement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 9 years 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 | « dart/frog/leg/scanner/parser.dart ('k') | dart/frog/tests/leg_only/src/BasicClassTest.dart » ('j') | 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('parser_helper.dart'); 5 #import('parser_helper.dart');
6 6
7 void testStatement(String statement) { 7 void testStatement(String statement) {
8 var node = parseStatement(statement); 8 var node = parseStatement(statement);
9 print("$statement: $node"); 9 print("$statement: $node");
10 } 10 }
11 11
12 void main() { 12 void main() {
13 /*
14 TODO(ahe): Enable these tests when we don't discard type arguments.
13 testStatement('List<T> t;'); 15 testStatement('List<T> t;');
14 testStatement('List<List<T>> t;'); 16 testStatement('List<List<T>> t;');
15 testStatement('List<List<List<T>>> t;'); 17 testStatement('List<List<List<T>>> t;');
16 testStatement('List<List<List<List<T>>>> t;'); 18 testStatement('List<List<List<List<T>>>> t;');
17 testStatement('List<List<List<List<List<T>>>>> t;'); 19 testStatement('List<List<List<List<List<T>>>>> t;');
18 20
19 testStatement('List<List<T> > t;'); 21 testStatement('List<List<T> > t;');
20 testStatement('List<List<List<T> >> t;'); 22 testStatement('List<List<List<T> >> t;');
21 testStatement('List<List<List<List<T> >>> t;'); 23 testStatement('List<List<List<List<T> >>> t;');
22 testStatement('List<List<List<List<List<T> >>>> t;'); 24 testStatement('List<List<List<List<List<T> >>>> t;');
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 testStatement('lib.List<List<List<List<T> > > > t;'); 56 testStatement('lib.List<List<List<List<T> > > > t;');
55 testStatement('lib.List<List<List<List<List<T> > > >> t;'); 57 testStatement('lib.List<List<List<List<List<T> > > >> t;');
56 58
57 testStatement('lib.List<List<List<List<List<T> > > > > t;'); 59 testStatement('lib.List<List<List<List<List<T> > > > > t;');
58 60
59 testStatement('lib.List<List<List<List<List<T> >> >> t;'); 61 testStatement('lib.List<List<List<List<List<T> >> >> t;');
60 62
61 testStatement('lib.List<List<List<List<List<T> >>> > t;'); 63 testStatement('lib.List<List<List<List<List<T> >>> > t;');
62 64
63 testStatement('lib.List<List<List<List<List<T >>> >> t;'); 65 testStatement('lib.List<List<List<List<List<T >>> >> t;');
66 */
64 67
65 testStatement('x++;'); 68 testStatement('x++;');
66 // TODO(ahe): reenable following test. 69 // TODO(ahe): reenable following test.
67 // testStatement('++x++;'); 70 // testStatement('++x++;');
68 testStatement('++x;'); 71 testStatement('++x;');
69 testStatement('print(x++);'); 72 testStatement('print(x++);');
70 // TODO(ahe): reenable following test. 73 // TODO(ahe): reenable following test.
71 // testStatement('print(++x++);'); // Accepted by parser, rejected later. 74 // testStatement('print(++x++);'); // Accepted by parser, rejected later.
72 testStatement('print(++x);'); 75 testStatement('print(++x);');
73 76
74 testStatement('MyClass.foo().bar().baz();'); 77 testStatement('MyClass.foo().bar().baz();');
75 testStatement('MyClass.foo().-x;'); // Accepted by parser, rejected later. 78 testStatement('MyClass.foo().-x;'); // Accepted by parser, rejected later.
76 testStatement('a.b.c.d();'); 79 testStatement('a.b.c.d();');
77 80
78 testStatement('int f() {}'); 81 testStatement('int f() {}');
79 testStatement('void f() {}'); 82 testStatement('void f() {}');
80 83
81 testStatement('do fisk(); while (hest());'); 84 testStatement('do fisk(); while (hest());');
82 testStatement('do { fisk(); } while (hest());'); 85 testStatement('do { fisk(); } while (hest());');
83 86
84 testStatement('while (fisk()) hest();'); 87 testStatement('while (fisk()) hest();');
85 testStatement('while (fisk()) { hest(); }'); 88 testStatement('while (fisk()) { hest(); }');
86 } 89 }
OLDNEW
« no previous file with comments | « dart/frog/leg/scanner/parser.dart ('k') | dart/frog/tests/leg_only/src/BasicClassTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698