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

Side by Side Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java

Issue 48623010: Issue 12694. Fix for parsing 'buildIn() {}' top-level functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012, the Dart project authors. 2 * Copyright (c) 2012, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
(...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 1543
1544 public void test_parseCompilationUnit_abstractAsPrefix_parameterized() throws Exception { 1544 public void test_parseCompilationUnit_abstractAsPrefix_parameterized() throws Exception {
1545 CompilationUnit unit = parse( 1545 CompilationUnit unit = parse(
1546 "parseCompilationUnit", 1546 "parseCompilationUnit",
1547 "abstract<dynamic> _abstract = new abstract.A();"); 1547 "abstract<dynamic> _abstract = new abstract.A();");
1548 assertNull(unit.getScriptTag()); 1548 assertNull(unit.getScriptTag());
1549 assertSize(0, unit.getDirectives()); 1549 assertSize(0, unit.getDirectives());
1550 assertSize(1, unit.getDeclarations()); 1550 assertSize(1, unit.getDeclarations());
1551 } 1551 }
1552 1552
1553 public void test_parseCompilationUnit_builtIn_asFunctionName() throws Exceptio n {
1554 parse("parseCompilationUnit", "abstract(x) => 0;");
1555 parse("parseCompilationUnit", "as(x) => 0;");
1556 parse("parseCompilationUnit", "dynamic(x) => 0;");
1557 parse("parseCompilationUnit", "export(x) => 0;");
1558 parse("parseCompilationUnit", "external(x) => 0;");
1559 parse("parseCompilationUnit", "factory(x) => 0;");
1560 parse("parseCompilationUnit", "get(x) => 0;");
1561 parse("parseCompilationUnit", "implements(x) => 0;");
1562 parse("parseCompilationUnit", "import(x) => 0;");
1563 parse("parseCompilationUnit", "library(x) => 0;");
1564 parse("parseCompilationUnit", "operator(x) => 0;");
1565 parse("parseCompilationUnit", "part(x) => 0;");
1566 parse("parseCompilationUnit", "set(x) => 0;");
1567 parse("parseCompilationUnit", "static(x) => 0;");
1568 parse("parseCompilationUnit", "typedef(x) => 0;");
1569 }
1570
1553 public void test_parseCompilationUnit_directives_multiple() throws Exception { 1571 public void test_parseCompilationUnit_directives_multiple() throws Exception {
1554 CompilationUnit unit = parse("parseCompilationUnit", "library l;\npart 'a.da rt';"); 1572 CompilationUnit unit = parse("parseCompilationUnit", "library l;\npart 'a.da rt';");
1555 assertNull(unit.getScriptTag()); 1573 assertNull(unit.getScriptTag());
1556 assertSize(2, unit.getDirectives()); 1574 assertSize(2, unit.getDirectives());
1557 assertSize(0, unit.getDeclarations()); 1575 assertSize(0, unit.getDeclarations());
1558 } 1576 }
1559 1577
1560 public void test_parseCompilationUnit_directives_single() throws Exception { 1578 public void test_parseCompilationUnit_directives_single() throws Exception {
1561 CompilationUnit unit = parse("parseCompilationUnit", "library l;"); 1579 CompilationUnit unit = parse("parseCompilationUnit", "library l;");
1562 assertNull(unit.getScriptTag()); 1580 assertNull(unit.getScriptTag());
(...skipping 3315 matching lines...) Expand 10 before | Expand all | Expand 10 after
4878 // Parse the source. 4896 // Parse the source.
4879 // 4897 //
4880 Parser parser = new Parser(null, listener); 4898 Parser parser = new Parser(null, listener);
4881 return (Token) invokeParserMethodImpl( 4899 return (Token) invokeParserMethodImpl(
4882 parser, 4900 parser,
4883 methodName, 4901 methodName,
4884 new Object[] {tokenStream}, 4902 new Object[] {tokenStream},
4885 tokenStream); 4903 tokenStream);
4886 } 4904 }
4887 } 4905 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698