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

Side by Side Diff: compiler/javatests/com/google/dart/compiler/parser/ParserRecoveryTest.java

Issue 10005040: Using annotations to help with parser recovery (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed unrelated file Created 8 years, 8 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 | « compiler/java/com/google/dart/compiler/parser/Terminals.java ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 package com.google.dart.compiler.parser; 5 package com.google.dart.compiler.parser;
6 6
7 import com.google.common.base.Joiner; 7 import com.google.common.base.Joiner;
8 import com.google.dart.compiler.ast.DartClass; 8 import com.google.dart.compiler.ast.DartClass;
9 import com.google.dart.compiler.ast.DartFieldDefinition; 9 import com.google.dart.compiler.ast.DartFieldDefinition;
10 import com.google.dart.compiler.ast.DartIdentifier; 10 import com.google.dart.compiler.ast.DartIdentifier;
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 assertEquals("/", ((DartIdentifier)opDiv.getName()).getName()); 272 assertEquals("/", ((DartIdentifier)opDiv.getName()).getName());
273 DartMethodDefinition opAssignDiv = (DartMethodDefinition)foo.getMembers().ge t(1); 273 DartMethodDefinition opAssignDiv = (DartMethodDefinition)foo.getMembers().ge t(1);
274 assertEquals("/=", ((DartIdentifier)opAssignDiv.getName()).getName()); 274 assertEquals("/=", ((DartIdentifier)opAssignDiv.getName()).getName());
275 DartMethodDefinition opNonsense = (DartMethodDefinition)foo.getMembers().get (2); 275 DartMethodDefinition opNonsense = (DartMethodDefinition)foo.getMembers().get (2);
276 assertEquals("][", ((DartIdentifier)opNonsense.getName()).getName()); 276 assertEquals("][", ((DartIdentifier)opNonsense.getName()).getName());
277 DartMethodDefinition opEquiv = (DartMethodDefinition)foo.getMembers().get(3) ; 277 DartMethodDefinition opEquiv = (DartMethodDefinition)foo.getMembers().get(3) ;
278 assertEquals("===", ((DartIdentifier)opEquiv.getName()).getName()); 278 assertEquals("===", ((DartIdentifier)opEquiv.getName()).getName());
279 DartMethodDefinition opPlus = (DartMethodDefinition)foo.getMembers().get(4); 279 DartMethodDefinition opPlus = (DartMethodDefinition)foo.getMembers().get(4);
280 assertEquals("+", ((DartIdentifier)opPlus.getName()).getName()); 280 assertEquals("+", ((DartIdentifier)opPlus.getName()).getName());
281 } 281 }
282
283 public void testPropertyAccessInArgumentListRecovery() {
284 DartUnit unit = parseUnitUnspecifiedErrors("phony_recover_to_toplevel8.dart" ,
285 Joiner.on("\n").join(
286 "var before;",
287 "var bad = new B(null, foo.);",
288 "var after;"));
289 DartFieldDefinition before = (DartFieldDefinition)unit.getTopLevelNodes().ge t(0);
290 assertEquals("before", before.getFields().get(0).getName().getName());
291 DartFieldDefinition bad = (DartFieldDefinition)unit.getTopLevelNodes().get(1 );
292 assertEquals("bad", bad.getFields().get(0).getName().getName());
293 DartFieldDefinition after = (DartFieldDefinition)unit.getTopLevelNodes().get (2);
294 assertEquals("after", after.getFields().get(0).getName().getName());
295 }
282 } 296 }
OLDNEW
« no previous file with comments | « compiler/java/com/google/dart/compiler/parser/Terminals.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698