| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 | 3 |
| 4 library engine.parser_test; | 4 library engine.parser_test; |
| 5 | 5 |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'package:analyzer-experimental/src/generated/java_core.dart'; | 7 import 'package:analyzer-experimental/src/generated/java_core.dart'; |
| 8 import 'package:analyzer-experimental/src/generated/java_engine.dart'; | 8 import 'package:analyzer-experimental/src/generated/java_engine.dart'; |
| 9 import 'package:analyzer-experimental/src/generated/java_junit.dart'; | 9 import 'package:analyzer-experimental/src/generated/java_junit.dart'; |
| 10 import 'package:analyzer-experimental/src/generated/source.dart'; | 10 import 'package:analyzer-experimental/src/generated/source.dart'; |
| 11 import 'package:analyzer-experimental/src/generated/error.dart'; | 11 import 'package:analyzer-experimental/src/generated/error.dart'; |
| 12 import 'package:analyzer-experimental/src/generated/scanner.dart'; | 12 import 'package:analyzer-experimental/src/generated/scanner.dart'; |
| 13 import 'package:analyzer-experimental/src/generated/ast.dart'; | 13 import 'package:analyzer-experimental/src/generated/ast.dart'; |
| 14 import 'package:analyzer-experimental/src/generated/parser.dart'; | 14 import 'package:analyzer-experimental/src/generated/parser.dart'; |
| 15 import 'package:analyzer-experimental/src/generated/utilities_dart.dart'; | 15 import 'package:analyzer-experimental/src/generated/utilities_dart.dart'; |
| 16 import 'package:unittest/unittest.dart' as _ut; | 16 import 'package:unittest/unittest.dart' as _ut; |
| 17 import 'test_support.dart'; | 17 import 'test_support.dart'; |
| 18 import 'scanner_test.dart' show TokenFactory; | 18 import 'scanner_test.dart' show TokenFactory; |
| 19 | 19 |
| 20 /** | 20 /** |
| 21 * The class {@code SimpleParserTest} defines parser tests that test individual
parsing method. The | 21 * The class {@code SimpleParserTest} defines parser tests that test individual
parsing method. The |
| 22 * code fragments should be as minimal as possible in order to test the method,
but should not test | 22 * code fragments should be as minimal as possible in order to test the method,
but should not test |
| 23 * the interactions between the method under test and other methods. | 23 * the interactions between the method under test and other methods. |
| 24 * <p> | 24 * <p> |
| 25 * More complex tests should be defined in the class {@link ComplexParserTest}. | 25 * More complex tests should be defined in the class {@link ComplexParserTest}. |
| 26 */ | 26 */ |
| 27 class SimpleParserTest extends ParserTestCase { | 27 class SimpleParserTest extends ParserTestCase { |
| 28 void fail_parseCommentReference_this() { | 28 void fail_parseCommentReference_this() { |
| 29 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["this", 5], ""); | 29 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["this", 5], ""); |
| 30 SimpleIdentifier identifier18 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); | 30 SimpleIdentifier identifier19 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); |
| 31 JUnitTestCase.assertNotNull(identifier18.token); | 31 JUnitTestCase.assertNotNull(identifier19.token); |
| 32 JUnitTestCase.assertEquals("a", identifier18.name); | 32 JUnitTestCase.assertEquals("a", identifier19.name); |
| 33 JUnitTestCase.assertEquals(5, identifier18.offset); | 33 JUnitTestCase.assertEquals(5, identifier19.offset); |
| 34 } | 34 } |
| 35 void test_computeStringValue_emptyInterpolationPrefix() { | 35 void test_computeStringValue_emptyInterpolationPrefix() { |
| 36 JUnitTestCase.assertEquals("", computeStringValue("'''")); | 36 JUnitTestCase.assertEquals("", computeStringValue("'''")); |
| 37 } | 37 } |
| 38 void test_computeStringValue_escape_b() { | 38 void test_computeStringValue_escape_b() { |
| 39 JUnitTestCase.assertEquals("\b", computeStringValue("'\\b'")); | 39 JUnitTestCase.assertEquals("\b", computeStringValue("'\\b'")); |
| 40 } | 40 } |
| 41 void test_computeStringValue_escape_f() { | 41 void test_computeStringValue_escape_f() { |
| 42 JUnitTestCase.assertEquals("\f", computeStringValue("'\\f'")); | 42 JUnitTestCase.assertEquals("\f", computeStringValue("'\\f'")); |
| 43 } | 43 } |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 void test_parseAnnotation_n3_a() { | 256 void test_parseAnnotation_n3_a() { |
| 257 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B.C(x,y
)", []); | 257 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B.C(x,y
)", []); |
| 258 JUnitTestCase.assertNotNull(annotation.atSign); | 258 JUnitTestCase.assertNotNull(annotation.atSign); |
| 259 JUnitTestCase.assertNotNull(annotation.name); | 259 JUnitTestCase.assertNotNull(annotation.name); |
| 260 JUnitTestCase.assertNotNull(annotation.period); | 260 JUnitTestCase.assertNotNull(annotation.period); |
| 261 JUnitTestCase.assertNotNull(annotation.constructorName); | 261 JUnitTestCase.assertNotNull(annotation.constructorName); |
| 262 JUnitTestCase.assertNotNull(annotation.arguments); | 262 JUnitTestCase.assertNotNull(annotation.arguments); |
| 263 } | 263 } |
| 264 void test_parseArgument_named() { | 264 void test_parseArgument_named() { |
| 265 NamedExpression expression = ParserTestCase.parse6("parseArgument", "n: x",
[]); | 265 NamedExpression expression = ParserTestCase.parse6("parseArgument", "n: x",
[]); |
| 266 Label name21 = expression.name; | 266 Label name22 = expression.name; |
| 267 JUnitTestCase.assertNotNull(name21); | 267 JUnitTestCase.assertNotNull(name22); |
| 268 JUnitTestCase.assertNotNull(name21.label); | 268 JUnitTestCase.assertNotNull(name22.label); |
| 269 JUnitTestCase.assertNotNull(name21.colon); | 269 JUnitTestCase.assertNotNull(name22.colon); |
| 270 JUnitTestCase.assertNotNull(expression.expression); | 270 JUnitTestCase.assertNotNull(expression.expression); |
| 271 } | 271 } |
| 272 void test_parseArgument_unnamed() { | 272 void test_parseArgument_unnamed() { |
| 273 String lexeme = "x"; | 273 String lexeme = "x"; |
| 274 SimpleIdentifier identifier = ParserTestCase.parse6("parseArgument", lexeme,
[]); | 274 SimpleIdentifier identifier = ParserTestCase.parse6("parseArgument", lexeme,
[]); |
| 275 JUnitTestCase.assertEquals(lexeme, identifier.name); | 275 JUnitTestCase.assertEquals(lexeme, identifier.name); |
| 276 } | 276 } |
| 277 void test_parseArgumentDefinitionTest() { | 277 void test_parseArgumentDefinitionTest() { |
| 278 ArgumentDefinitionTest test = ParserTestCase.parse6("parseArgumentDefinition
Test", "?x", []); | 278 ArgumentDefinitionTest test = ParserTestCase.parse6("parseArgumentDefinition
Test", "?x", []); |
| 279 JUnitTestCase.assertNotNull(test.question); | 279 JUnitTestCase.assertNotNull(test.question); |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 EngineTestCase.assertSize(0, commentAndMetadata.metadata); | 981 EngineTestCase.assertSize(0, commentAndMetadata.metadata); |
| 982 } | 982 } |
| 983 void test_parseCommentReference_new_prefixed() { | 983 void test_parseCommentReference_new_prefixed() { |
| 984 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a.b", 7], ""); | 984 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a.b", 7], ""); |
| 985 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); | 985 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); |
| 986 SimpleIdentifier prefix11 = prefixedIdentifier.prefix; | 986 SimpleIdentifier prefix11 = prefixedIdentifier.prefix; |
| 987 JUnitTestCase.assertNotNull(prefix11.token); | 987 JUnitTestCase.assertNotNull(prefix11.token); |
| 988 JUnitTestCase.assertEquals("a", prefix11.name); | 988 JUnitTestCase.assertEquals("a", prefix11.name); |
| 989 JUnitTestCase.assertEquals(11, prefix11.offset); | 989 JUnitTestCase.assertEquals(11, prefix11.offset); |
| 990 JUnitTestCase.assertNotNull(prefixedIdentifier.period); | 990 JUnitTestCase.assertNotNull(prefixedIdentifier.period); |
| 991 SimpleIdentifier identifier19 = prefixedIdentifier.identifier; | 991 SimpleIdentifier identifier20 = prefixedIdentifier.identifier; |
| 992 JUnitTestCase.assertNotNull(identifier19.token); | 992 JUnitTestCase.assertNotNull(identifier20.token); |
| 993 JUnitTestCase.assertEquals("b", identifier19.name); | 993 JUnitTestCase.assertEquals("b", identifier20.name); |
| 994 JUnitTestCase.assertEquals(13, identifier19.offset); | 994 JUnitTestCase.assertEquals(13, identifier20.offset); |
| 995 } | 995 } |
| 996 void test_parseCommentReference_new_simple() { | 996 void test_parseCommentReference_new_simple() { |
| 997 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a", 5], ""); | 997 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a", 5], ""); |
| 998 SimpleIdentifier identifier20 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); | 998 SimpleIdentifier identifier21 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); |
| 999 JUnitTestCase.assertNotNull(identifier20.token); | 999 JUnitTestCase.assertNotNull(identifier21.token); |
| 1000 JUnitTestCase.assertEquals("a", identifier20.name); | 1000 JUnitTestCase.assertEquals("a", identifier21.name); |
| 1001 JUnitTestCase.assertEquals(9, identifier20.offset); | 1001 JUnitTestCase.assertEquals(9, identifier21.offset); |
| 1002 } | 1002 } |
| 1003 void test_parseCommentReference_prefixed() { | 1003 void test_parseCommentReference_prefixed() { |
| 1004 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a.b", 7], ""); | 1004 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a.b", 7], ""); |
| 1005 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); | 1005 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); |
| 1006 SimpleIdentifier prefix12 = prefixedIdentifier.prefix; | 1006 SimpleIdentifier prefix12 = prefixedIdentifier.prefix; |
| 1007 JUnitTestCase.assertNotNull(prefix12.token); | 1007 JUnitTestCase.assertNotNull(prefix12.token); |
| 1008 JUnitTestCase.assertEquals("a", prefix12.name); | 1008 JUnitTestCase.assertEquals("a", prefix12.name); |
| 1009 JUnitTestCase.assertEquals(7, prefix12.offset); | 1009 JUnitTestCase.assertEquals(7, prefix12.offset); |
| 1010 JUnitTestCase.assertNotNull(prefixedIdentifier.period); | 1010 JUnitTestCase.assertNotNull(prefixedIdentifier.period); |
| 1011 SimpleIdentifier identifier21 = prefixedIdentifier.identifier; | 1011 SimpleIdentifier identifier22 = prefixedIdentifier.identifier; |
| 1012 JUnitTestCase.assertNotNull(identifier21.token); | 1012 JUnitTestCase.assertNotNull(identifier22.token); |
| 1013 JUnitTestCase.assertEquals("b", identifier21.name); | 1013 JUnitTestCase.assertEquals("b", identifier22.name); |
| 1014 JUnitTestCase.assertEquals(9, identifier21.offset); | 1014 JUnitTestCase.assertEquals(9, identifier22.offset); |
| 1015 } | 1015 } |
| 1016 void test_parseCommentReference_simple() { | 1016 void test_parseCommentReference_simple() { |
| 1017 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a", 5], ""); | 1017 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a", 5], ""); |
| 1018 SimpleIdentifier identifier22 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); | 1018 SimpleIdentifier identifier23 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); |
| 1019 JUnitTestCase.assertNotNull(identifier22.token); | 1019 JUnitTestCase.assertNotNull(identifier23.token); |
| 1020 JUnitTestCase.assertEquals("a", identifier22.name); | 1020 JUnitTestCase.assertEquals("a", identifier23.name); |
| 1021 JUnitTestCase.assertEquals(5, identifier22.offset); | 1021 JUnitTestCase.assertEquals(5, identifier23.offset); |
| 1022 } | 1022 } |
| 1023 void test_parseCommentReferences_multiLine() { | 1023 void test_parseCommentReferences_multiLine() { |
| 1024 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT,
"/** xxx [a] yyy [b] zzz */", 3)]; | 1024 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT,
"/** xxx [a] yyy [b] zzz */", 3)]; |
| 1025 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere
nces", <Object> [tokens], ""); | 1025 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere
nces", <Object> [tokens], ""); |
| 1026 EngineTestCase.assertSize(2, references); | 1026 EngineTestCase.assertSize(2, references); |
| 1027 CommentReference reference = references[0]; | 1027 CommentReference reference = references[0]; |
| 1028 JUnitTestCase.assertNotNull(reference); | 1028 JUnitTestCase.assertNotNull(reference); |
| 1029 JUnitTestCase.assertNotNull(reference.identifier); | 1029 JUnitTestCase.assertNotNull(reference.identifier); |
| 1030 JUnitTestCase.assertEquals(12, reference.offset); | 1030 JUnitTestCase.assertEquals(12, reference.offset); |
| 1031 reference = references[1]; | 1031 reference = references[1]; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "const int x = 0;"); | 1124 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "const int x = 0;"); |
| 1125 JUnitTestCase.assertNotNull(declaration.semicolon); | 1125 JUnitTestCase.assertNotNull(declaration.semicolon); |
| 1126 JUnitTestCase.assertNotNull(declaration.variables); | 1126 JUnitTestCase.assertNotNull(declaration.variables); |
| 1127 } | 1127 } |
| 1128 void test_parseCompilationUnitMember_finalVariable() { | 1128 void test_parseCompilationUnitMember_finalVariable() { |
| 1129 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "final x = 0;"); | 1129 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "final x = 0;"); |
| 1130 JUnitTestCase.assertNotNull(declaration.semicolon); | 1130 JUnitTestCase.assertNotNull(declaration.semicolon); |
| 1131 JUnitTestCase.assertNotNull(declaration.variables); | 1131 JUnitTestCase.assertNotNull(declaration.variables); |
| 1132 } | 1132 } |
| 1133 void test_parseCompilationUnitMember_function_external_noType() { | 1133 void test_parseCompilationUnitMember_function_external_noType() { |
| 1134 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external f()"); | 1134 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external f();"); |
| 1135 JUnitTestCase.assertNotNull(declaration.externalKeyword); | 1135 JUnitTestCase.assertNotNull(declaration.externalKeyword); |
| 1136 JUnitTestCase.assertNotNull(declaration.functionExpression); | 1136 JUnitTestCase.assertNotNull(declaration.functionExpression); |
| 1137 JUnitTestCase.assertNull(declaration.propertyKeyword); | 1137 JUnitTestCase.assertNull(declaration.propertyKeyword); |
| 1138 } | 1138 } |
| 1139 void test_parseCompilationUnitMember_function_external_type() { | 1139 void test_parseCompilationUnitMember_function_external_type() { |
| 1140 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external int f()"); | 1140 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external int f();"); |
| 1141 JUnitTestCase.assertNotNull(declaration.externalKeyword); | 1141 JUnitTestCase.assertNotNull(declaration.externalKeyword); |
| 1142 JUnitTestCase.assertNotNull(declaration.functionExpression); | 1142 JUnitTestCase.assertNotNull(declaration.functionExpression); |
| 1143 JUnitTestCase.assertNull(declaration.propertyKeyword); | 1143 JUnitTestCase.assertNull(declaration.propertyKeyword); |
| 1144 } | 1144 } |
| 1145 void test_parseCompilationUnitMember_function_noType() { | 1145 void test_parseCompilationUnitMember_function_noType() { |
| 1146 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "f() {}"); | 1146 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "f() {}"); |
| 1147 JUnitTestCase.assertNotNull(declaration.functionExpression); | 1147 JUnitTestCase.assertNotNull(declaration.functionExpression); |
| 1148 JUnitTestCase.assertNull(declaration.propertyKeyword); | 1148 JUnitTestCase.assertNull(declaration.propertyKeyword); |
| 1149 } | 1149 } |
| 1150 void test_parseCompilationUnitMember_function_type() { | 1150 void test_parseCompilationUnitMember_function_type() { |
| 1151 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "int f() {}"); | 1151 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "int f() {}"); |
| 1152 JUnitTestCase.assertNotNull(declaration.functionExpression); | 1152 JUnitTestCase.assertNotNull(declaration.functionExpression); |
| 1153 JUnitTestCase.assertNull(declaration.propertyKeyword); | 1153 JUnitTestCase.assertNull(declaration.propertyKeyword); |
| 1154 } | 1154 } |
| 1155 void test_parseCompilationUnitMember_getter_external_noType() { | 1155 void test_parseCompilationUnitMember_getter_external_noType() { |
| 1156 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external get p"); | 1156 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external get p;"); |
| 1157 JUnitTestCase.assertNotNull(declaration.externalKeyword); | 1157 JUnitTestCase.assertNotNull(declaration.externalKeyword); |
| 1158 JUnitTestCase.assertNotNull(declaration.functionExpression); | 1158 JUnitTestCase.assertNotNull(declaration.functionExpression); |
| 1159 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | 1159 JUnitTestCase.assertNotNull(declaration.propertyKeyword); |
| 1160 } | 1160 } |
| 1161 void test_parseCompilationUnitMember_getter_external_type() { | 1161 void test_parseCompilationUnitMember_getter_external_type() { |
| 1162 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external int get p"); | 1162 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external int get p;"); |
| 1163 JUnitTestCase.assertNotNull(declaration.externalKeyword); | 1163 JUnitTestCase.assertNotNull(declaration.externalKeyword); |
| 1164 JUnitTestCase.assertNotNull(declaration.functionExpression); | 1164 JUnitTestCase.assertNotNull(declaration.functionExpression); |
| 1165 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | 1165 JUnitTestCase.assertNotNull(declaration.propertyKeyword); |
| 1166 } | 1166 } |
| 1167 void test_parseCompilationUnitMember_getter_noType() { | 1167 void test_parseCompilationUnitMember_getter_noType() { |
| 1168 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "get p => 0;"); | 1168 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "get p => 0;"); |
| 1169 JUnitTestCase.assertNotNull(declaration.functionExpression); | 1169 JUnitTestCase.assertNotNull(declaration.functionExpression); |
| 1170 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | 1170 JUnitTestCase.assertNotNull(declaration.propertyKeyword); |
| 1171 } | 1171 } |
| 1172 void test_parseCompilationUnitMember_getter_type() { | 1172 void test_parseCompilationUnitMember_getter_type() { |
| 1173 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "int get p => 0;"); | 1173 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "int get p => 0;"); |
| 1174 JUnitTestCase.assertNotNull(declaration.functionExpression); | 1174 JUnitTestCase.assertNotNull(declaration.functionExpression); |
| 1175 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | 1175 JUnitTestCase.assertNotNull(declaration.propertyKeyword); |
| 1176 } | 1176 } |
| 1177 void test_parseCompilationUnitMember_setter_external_noType() { | 1177 void test_parseCompilationUnitMember_setter_external_noType() { |
| 1178 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external set p(v)"); | 1178 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external set p(v);"); |
| 1179 JUnitTestCase.assertNotNull(declaration.externalKeyword); | 1179 JUnitTestCase.assertNotNull(declaration.externalKeyword); |
| 1180 JUnitTestCase.assertNotNull(declaration.functionExpression); | 1180 JUnitTestCase.assertNotNull(declaration.functionExpression); |
| 1181 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | 1181 JUnitTestCase.assertNotNull(declaration.propertyKeyword); |
| 1182 } | 1182 } |
| 1183 void test_parseCompilationUnitMember_setter_external_type() { | 1183 void test_parseCompilationUnitMember_setter_external_type() { |
| 1184 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external void set p(int v)"); | 1184 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external void set p(int v);"); |
| 1185 JUnitTestCase.assertNotNull(declaration.externalKeyword); | 1185 JUnitTestCase.assertNotNull(declaration.externalKeyword); |
| 1186 JUnitTestCase.assertNotNull(declaration.functionExpression); | 1186 JUnitTestCase.assertNotNull(declaration.functionExpression); |
| 1187 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | 1187 JUnitTestCase.assertNotNull(declaration.propertyKeyword); |
| 1188 } | 1188 } |
| 1189 void test_parseCompilationUnitMember_setter_noType() { | 1189 void test_parseCompilationUnitMember_setter_noType() { |
| 1190 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "set p(v) {}"); | 1190 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "set p(v) {}"); |
| 1191 JUnitTestCase.assertNotNull(declaration.functionExpression); | 1191 JUnitTestCase.assertNotNull(declaration.functionExpression); |
| 1192 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | 1192 JUnitTestCase.assertNotNull(declaration.propertyKeyword); |
| 1193 } | 1193 } |
| 1194 void test_parseCompilationUnitMember_setter_type() { | 1194 void test_parseCompilationUnitMember_setter_type() { |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1536 JUnitTestCase.assertNotNull(invocation.argumentList); | 1536 JUnitTestCase.assertNotNull(invocation.argumentList); |
| 1537 } | 1537 } |
| 1538 void test_parseExtendsClause() { | 1538 void test_parseExtendsClause() { |
| 1539 ExtendsClause clause = ParserTestCase.parse6("parseExtendsClause", "extends
B", []); | 1539 ExtendsClause clause = ParserTestCase.parse6("parseExtendsClause", "extends
B", []); |
| 1540 JUnitTestCase.assertNotNull(clause.keyword); | 1540 JUnitTestCase.assertNotNull(clause.keyword); |
| 1541 JUnitTestCase.assertNotNull(clause.superclass); | 1541 JUnitTestCase.assertNotNull(clause.superclass); |
| 1542 EngineTestCase.assertInstanceOf(TypeName, clause.superclass); | 1542 EngineTestCase.assertInstanceOf(TypeName, clause.superclass); |
| 1543 } | 1543 } |
| 1544 void test_parseFinalConstVarOrType_const_noType() { | 1544 void test_parseFinalConstVarOrType_const_noType() { |
| 1545 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "const"); | 1545 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "const"); |
| 1546 Token keyword29 = result.keyword; | 1546 Token keyword31 = result.keyword; |
| 1547 JUnitTestCase.assertNotNull(keyword29); | 1547 JUnitTestCase.assertNotNull(keyword31); |
| 1548 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword29.type); | 1548 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword31.type); |
| 1549 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword29 as KeywordToken)).keyw
ord); | 1549 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword31 as KeywordToken)).keyw
ord); |
| 1550 JUnitTestCase.assertNull(result.type); | 1550 JUnitTestCase.assertNull(result.type); |
| 1551 } | 1551 } |
| 1552 void test_parseFinalConstVarOrType_const_type() { | 1552 void test_parseFinalConstVarOrType_const_type() { |
| 1553 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "const A a"); | 1553 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "const A a"); |
| 1554 Token keyword30 = result.keyword; | 1554 Token keyword32 = result.keyword; |
| 1555 JUnitTestCase.assertNotNull(keyword30); | 1555 JUnitTestCase.assertNotNull(keyword32); |
| 1556 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword30.type); | 1556 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword32.type); |
| 1557 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword30 as KeywordToken)).keyw
ord); | 1557 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword32 as KeywordToken)).keyw
ord); |
| 1558 JUnitTestCase.assertNotNull(result.type); | 1558 JUnitTestCase.assertNotNull(result.type); |
| 1559 } | 1559 } |
| 1560 void test_parseFinalConstVarOrType_final_noType() { | 1560 void test_parseFinalConstVarOrType_final_noType() { |
| 1561 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "final"); | 1561 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "final"); |
| 1562 Token keyword31 = result.keyword; | 1562 Token keyword33 = result.keyword; |
| 1563 JUnitTestCase.assertNotNull(keyword31); | 1563 JUnitTestCase.assertNotNull(keyword33); |
| 1564 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword31.type); | 1564 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword33.type); |
| 1565 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword31 as KeywordToken)).keyw
ord); | 1565 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword33 as KeywordToken)).keyw
ord); |
| 1566 JUnitTestCase.assertNull(result.type); | 1566 JUnitTestCase.assertNull(result.type); |
| 1567 } | 1567 } |
| 1568 void test_parseFinalConstVarOrType_final_type() { | 1568 void test_parseFinalConstVarOrType_final_type() { |
| 1569 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "final A a"); | 1569 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "final A a"); |
| 1570 Token keyword32 = result.keyword; | 1570 Token keyword34 = result.keyword; |
| 1571 JUnitTestCase.assertNotNull(keyword32); | 1571 JUnitTestCase.assertNotNull(keyword34); |
| 1572 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword32.type); | 1572 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword34.type); |
| 1573 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword32 as KeywordToken)).keyw
ord); | 1573 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword34 as KeywordToken)).keyw
ord); |
| 1574 JUnitTestCase.assertNotNull(result.type); | 1574 JUnitTestCase.assertNotNull(result.type); |
| 1575 } | 1575 } |
| 1576 void test_parseFinalConstVarOrType_type_parameterized() { | 1576 void test_parseFinalConstVarOrType_type_parameterized() { |
| 1577 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "A<B> a"); | 1577 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "A<B> a"); |
| 1578 JUnitTestCase.assertNull(result.keyword); | 1578 JUnitTestCase.assertNull(result.keyword); |
| 1579 JUnitTestCase.assertNotNull(result.type); | 1579 JUnitTestCase.assertNotNull(result.type); |
| 1580 } | 1580 } |
| 1581 void test_parseFinalConstVarOrType_type_prefixed() { | 1581 void test_parseFinalConstVarOrType_type_prefixed() { |
| 1582 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "p.A a"); | 1582 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "p.A a"); |
| 1583 JUnitTestCase.assertNull(result.keyword); | 1583 JUnitTestCase.assertNull(result.keyword); |
| 1584 JUnitTestCase.assertNotNull(result.type); | 1584 JUnitTestCase.assertNotNull(result.type); |
| 1585 } | 1585 } |
| 1586 void test_parseFinalConstVarOrType_type_prefixedAndParameterized() { | 1586 void test_parseFinalConstVarOrType_type_prefixedAndParameterized() { |
| 1587 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "p.A<B> a"); | 1587 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "p.A<B> a"); |
| 1588 JUnitTestCase.assertNull(result.keyword); | 1588 JUnitTestCase.assertNull(result.keyword); |
| 1589 JUnitTestCase.assertNotNull(result.type); | 1589 JUnitTestCase.assertNotNull(result.type); |
| 1590 } | 1590 } |
| 1591 void test_parseFinalConstVarOrType_type_simple() { | 1591 void test_parseFinalConstVarOrType_type_simple() { |
| 1592 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "A a"); | 1592 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "A a"); |
| 1593 JUnitTestCase.assertNull(result.keyword); | 1593 JUnitTestCase.assertNull(result.keyword); |
| 1594 JUnitTestCase.assertNotNull(result.type); | 1594 JUnitTestCase.assertNotNull(result.type); |
| 1595 } | 1595 } |
| 1596 void test_parseFinalConstVarOrType_var() { | 1596 void test_parseFinalConstVarOrType_var() { |
| 1597 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "var"); | 1597 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "var"); |
| 1598 Token keyword33 = result.keyword; | 1598 Token keyword35 = result.keyword; |
| 1599 JUnitTestCase.assertNotNull(keyword33); | 1599 JUnitTestCase.assertNotNull(keyword35); |
| 1600 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword33.type); | 1600 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword35.type); |
| 1601 JUnitTestCase.assertEquals(Keyword.VAR, ((keyword33 as KeywordToken)).keywor
d); | 1601 JUnitTestCase.assertEquals(Keyword.VAR, ((keyword35 as KeywordToken)).keywor
d); |
| 1602 JUnitTestCase.assertNull(result.type); | 1602 JUnitTestCase.assertNull(result.type); |
| 1603 } | 1603 } |
| 1604 void test_parseFormalParameter_final_withType_named() { | 1604 void test_parseFormalParameter_final_withType_named() { |
| 1605 ParameterKind kind = ParameterKind.NAMED; | 1605 ParameterKind kind = ParameterKind.NAMED; |
| 1606 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "final A a : null"); | 1606 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "final A a : null"); |
| 1607 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; | 1607 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; |
| 1608 JUnitTestCase.assertNotNull(simpleParameter.identifier); | 1608 JUnitTestCase.assertNotNull(simpleParameter.identifier); |
| 1609 JUnitTestCase.assertNotNull(simpleParameter.keyword); | 1609 JUnitTestCase.assertNotNull(simpleParameter.keyword); |
| 1610 JUnitTestCase.assertNotNull(simpleParameter.type); | 1610 JUnitTestCase.assertNotNull(simpleParameter.type); |
| 1611 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | 1611 JUnitTestCase.assertEquals(kind, simpleParameter.kind); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1766 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 1766 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 1767 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | 1767 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); |
| 1768 EngineTestCase.assertSize(1, parameterList.parameters); | 1768 EngineTestCase.assertSize(1, parameterList.parameters); |
| 1769 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | 1769 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); |
| 1770 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 1770 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 1771 } | 1771 } |
| 1772 void test_parseForStatement_each_identifier() { | 1772 void test_parseForStatement_each_identifier() { |
| 1773 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(element in list) {}", []); | 1773 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(element in list) {}", []); |
| 1774 JUnitTestCase.assertNotNull(statement.forKeyword); | 1774 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 1775 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1775 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 1776 JUnitTestCase.assertNotNull(statement.loopParameter); | 1776 JUnitTestCase.assertNotNull(statement.loopVariable); |
| 1777 JUnitTestCase.assertNotNull(statement.inKeyword); | 1777 JUnitTestCase.assertNotNull(statement.inKeyword); |
| 1778 JUnitTestCase.assertNotNull(statement.iterator); | 1778 JUnitTestCase.assertNotNull(statement.iterator); |
| 1779 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1779 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 1780 JUnitTestCase.assertNotNull(statement.body); | 1780 JUnitTestCase.assertNotNull(statement.body); |
| 1781 } | 1781 } |
| 1782 void test_parseForStatement_each_noType() { | 1782 void test_parseForStatement_each_noType() { |
| 1783 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(element in list) {}", []); | 1783 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(element in list) {}", []); |
| 1784 JUnitTestCase.assertNotNull(statement.forKeyword); | 1784 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 1785 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1785 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 1786 JUnitTestCase.assertNotNull(statement.loopParameter); | 1786 JUnitTestCase.assertNotNull(statement.loopVariable); |
| 1787 JUnitTestCase.assertNotNull(statement.inKeyword); | 1787 JUnitTestCase.assertNotNull(statement.inKeyword); |
| 1788 JUnitTestCase.assertNotNull(statement.iterator); | 1788 JUnitTestCase.assertNotNull(statement.iterator); |
| 1789 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1789 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 1790 JUnitTestCase.assertNotNull(statement.body); | 1790 JUnitTestCase.assertNotNull(statement.body); |
| 1791 } | 1791 } |
| 1792 void test_parseForStatement_each_type() { | 1792 void test_parseForStatement_each_type() { |
| 1793 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(A element in list) {}", []); | 1793 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(A element in list) {}", []); |
| 1794 JUnitTestCase.assertNotNull(statement.forKeyword); | 1794 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 1795 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1795 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 1796 JUnitTestCase.assertNotNull(statement.loopParameter); | 1796 JUnitTestCase.assertNotNull(statement.loopVariable); |
| 1797 JUnitTestCase.assertNotNull(statement.inKeyword); | 1797 JUnitTestCase.assertNotNull(statement.inKeyword); |
| 1798 JUnitTestCase.assertNotNull(statement.iterator); | 1798 JUnitTestCase.assertNotNull(statement.iterator); |
| 1799 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1799 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 1800 JUnitTestCase.assertNotNull(statement.body); | 1800 JUnitTestCase.assertNotNull(statement.body); |
| 1801 } | 1801 } |
| 1802 void test_parseForStatement_each_var() { | 1802 void test_parseForStatement_each_var() { |
| 1803 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(var element in list) {}", []); | 1803 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(var element in list) {}", []); |
| 1804 JUnitTestCase.assertNotNull(statement.forKeyword); | 1804 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 1805 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1805 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 1806 JUnitTestCase.assertNotNull(statement.loopParameter); | 1806 JUnitTestCase.assertNotNull(statement.loopVariable); |
| 1807 JUnitTestCase.assertNotNull(statement.inKeyword); | 1807 JUnitTestCase.assertNotNull(statement.inKeyword); |
| 1808 JUnitTestCase.assertNotNull(statement.iterator); | 1808 JUnitTestCase.assertNotNull(statement.iterator); |
| 1809 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1809 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 1810 JUnitTestCase.assertNotNull(statement.body); | 1810 JUnitTestCase.assertNotNull(statement.body); |
| 1811 } | 1811 } |
| 1812 void test_parseForStatement_loop_c() { | 1812 void test_parseForStatement_loop_c() { |
| 1813 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (;
i < count;) {}", []); | 1813 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (;
i < count;) {}", []); |
| 1814 JUnitTestCase.assertNotNull(statement.forKeyword); | 1814 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 1815 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1815 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 1816 JUnitTestCase.assertNull(statement.variables); | 1816 JUnitTestCase.assertNull(statement.variables); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1946 } | 1946 } |
| 1947 void test_parseFunctionBody_expression() { | 1947 void test_parseFunctionBody_expression() { |
| 1948 ExpressionFunctionBody functionBody = ParserTestCase.parse("parseFunctionBod
y", <Object> [false, false], "=> y;"); | 1948 ExpressionFunctionBody functionBody = ParserTestCase.parse("parseFunctionBod
y", <Object> [false, false], "=> y;"); |
| 1949 JUnitTestCase.assertNotNull(functionBody.functionDefinition); | 1949 JUnitTestCase.assertNotNull(functionBody.functionDefinition); |
| 1950 JUnitTestCase.assertNotNull(functionBody.expression); | 1950 JUnitTestCase.assertNotNull(functionBody.expression); |
| 1951 JUnitTestCase.assertNotNull(functionBody.semicolon); | 1951 JUnitTestCase.assertNotNull(functionBody.semicolon); |
| 1952 } | 1952 } |
| 1953 void test_parseFunctionDeclaration_function() { | 1953 void test_parseFunctionDeclaration_function() { |
| 1954 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | 1954 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); |
| 1955 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | 1955 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); |
| 1956 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType, false], "f()
{}"); | 1956 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType], "f() {}"); |
| 1957 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | 1957 JUnitTestCase.assertEquals(comment, declaration.documentationComment); |
| 1958 JUnitTestCase.assertEquals(returnType, declaration.returnType); | 1958 JUnitTestCase.assertEquals(returnType, declaration.returnType); |
| 1959 JUnitTestCase.assertNotNull(declaration.name); | 1959 JUnitTestCase.assertNotNull(declaration.name); |
| 1960 FunctionExpression expression = declaration.functionExpression; | |
| 1961 JUnitTestCase.assertNotNull(expression); | |
| 1962 JUnitTestCase.assertNotNull(expression.body); | |
| 1963 JUnitTestCase.assertNotNull(expression.parameters); | |
| 1964 JUnitTestCase.assertNull(declaration.propertyKeyword); | |
| 1965 } | |
| 1966 void test_parseFunctionDeclaration_function_inStatement() { | |
| 1967 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | |
| 1968 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | |
| 1969 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType, true], "f()
{};"); | |
| 1970 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | |
| 1971 JUnitTestCase.assertEquals(returnType, declaration.returnType); | |
| 1972 JUnitTestCase.assertNotNull(declaration.name); | |
| 1973 FunctionExpression expression = declaration.functionExpression; | 1960 FunctionExpression expression = declaration.functionExpression; |
| 1974 JUnitTestCase.assertNotNull(expression); | 1961 JUnitTestCase.assertNotNull(expression); |
| 1975 JUnitTestCase.assertNotNull(expression.body); | 1962 JUnitTestCase.assertNotNull(expression.body); |
| 1976 JUnitTestCase.assertNotNull(expression.parameters); | 1963 JUnitTestCase.assertNotNull(expression.parameters); |
| 1977 JUnitTestCase.assertNull(declaration.propertyKeyword); | 1964 JUnitTestCase.assertNull(declaration.propertyKeyword); |
| 1978 } | 1965 } |
| 1979 void test_parseFunctionDeclaration_getter() { | 1966 void test_parseFunctionDeclaration_getter() { |
| 1980 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | 1967 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); |
| 1981 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | 1968 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); |
| 1982 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType, false], "get
p => 0;"); | 1969 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType], "get p => 0
;"); |
| 1983 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | 1970 JUnitTestCase.assertEquals(comment, declaration.documentationComment); |
| 1984 JUnitTestCase.assertEquals(returnType, declaration.returnType); | 1971 JUnitTestCase.assertEquals(returnType, declaration.returnType); |
| 1985 JUnitTestCase.assertNotNull(declaration.name); | 1972 JUnitTestCase.assertNotNull(declaration.name); |
| 1986 FunctionExpression expression = declaration.functionExpression; | 1973 FunctionExpression expression = declaration.functionExpression; |
| 1987 JUnitTestCase.assertNotNull(expression); | 1974 JUnitTestCase.assertNotNull(expression); |
| 1988 JUnitTestCase.assertNotNull(expression.body); | 1975 JUnitTestCase.assertNotNull(expression.body); |
| 1989 JUnitTestCase.assertNull(expression.parameters); | 1976 JUnitTestCase.assertNull(expression.parameters); |
| 1990 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | 1977 JUnitTestCase.assertNotNull(declaration.propertyKeyword); |
| 1991 } | 1978 } |
| 1992 void test_parseFunctionDeclaration_setter() { | 1979 void test_parseFunctionDeclaration_setter() { |
| 1993 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | 1980 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); |
| 1994 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | 1981 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); |
| 1995 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType, false], "set
p(v) {}"); | 1982 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType], "set p(v) {
}"); |
| 1996 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | 1983 JUnitTestCase.assertEquals(comment, declaration.documentationComment); |
| 1997 JUnitTestCase.assertEquals(returnType, declaration.returnType); | 1984 JUnitTestCase.assertEquals(returnType, declaration.returnType); |
| 1998 JUnitTestCase.assertNotNull(declaration.name); | 1985 JUnitTestCase.assertNotNull(declaration.name); |
| 1999 FunctionExpression expression = declaration.functionExpression; | 1986 FunctionExpression expression = declaration.functionExpression; |
| 2000 JUnitTestCase.assertNotNull(expression); | 1987 JUnitTestCase.assertNotNull(expression); |
| 2001 JUnitTestCase.assertNotNull(expression.body); | 1988 JUnitTestCase.assertNotNull(expression.body); |
| 2002 JUnitTestCase.assertNotNull(expression.parameters); | 1989 JUnitTestCase.assertNotNull(expression.parameters); |
| 2003 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | 1990 JUnitTestCase.assertNotNull(declaration.propertyKeyword); |
| 2004 } | 1991 } |
| 2005 void test_parseFunctionDeclarationStatement() { | 1992 void test_parseFunctionDeclarationStatement() { |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2157 JUnitTestCase.assertNull(directive.prefix); | 2144 JUnitTestCase.assertNull(directive.prefix); |
| 2158 EngineTestCase.assertSize(1, directive.combinators); | 2145 EngineTestCase.assertSize(1, directive.combinators); |
| 2159 JUnitTestCase.assertNotNull(directive.semicolon); | 2146 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2160 } | 2147 } |
| 2161 void test_parseInitializedIdentifierList_type() { | 2148 void test_parseInitializedIdentifierList_type() { |
| 2162 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | 2149 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); |
| 2163 Token staticKeyword = TokenFactory.token(Keyword.STATIC); | 2150 Token staticKeyword = TokenFactory.token(Keyword.STATIC); |
| 2164 TypeName type = new TypeName.full(new SimpleIdentifier.full(null), null); | 2151 TypeName type = new TypeName.full(new SimpleIdentifier.full(null), null); |
| 2165 FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentif
ierList", <Object> [commentAndMetadata(comment, []), staticKeyword, null, type],
"a = 1, b, c = 3;"); | 2152 FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentif
ierList", <Object> [commentAndMetadata(comment, []), staticKeyword, null, type],
"a = 1, b, c = 3;"); |
| 2166 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | 2153 JUnitTestCase.assertEquals(comment, declaration.documentationComment); |
| 2167 VariableDeclarationList fields3 = declaration.fields; | 2154 VariableDeclarationList fields4 = declaration.fields; |
| 2168 JUnitTestCase.assertNotNull(fields3); | 2155 JUnitTestCase.assertNotNull(fields4); |
| 2169 JUnitTestCase.assertNull(fields3.keyword); | 2156 JUnitTestCase.assertNull(fields4.keyword); |
| 2170 JUnitTestCase.assertEquals(type, fields3.type); | 2157 JUnitTestCase.assertEquals(type, fields4.type); |
| 2171 EngineTestCase.assertSize(3, fields3.variables); | 2158 EngineTestCase.assertSize(3, fields4.variables); |
| 2172 JUnitTestCase.assertEquals(staticKeyword, declaration.keyword); | 2159 JUnitTestCase.assertEquals(staticKeyword, declaration.keyword); |
| 2173 JUnitTestCase.assertNotNull(declaration.semicolon); | 2160 JUnitTestCase.assertNotNull(declaration.semicolon); |
| 2174 } | 2161 } |
| 2175 void test_parseInitializedIdentifierList_var() { | 2162 void test_parseInitializedIdentifierList_var() { |
| 2176 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | 2163 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); |
| 2177 Token staticKeyword = TokenFactory.token(Keyword.STATIC); | 2164 Token staticKeyword = TokenFactory.token(Keyword.STATIC); |
| 2178 Token varKeyword = TokenFactory.token(Keyword.VAR); | 2165 Token varKeyword = TokenFactory.token(Keyword.VAR); |
| 2179 FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentif
ierList", <Object> [commentAndMetadata(comment, []), staticKeyword, varKeyword,
null], "a = 1, b, c = 3;"); | 2166 FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentif
ierList", <Object> [commentAndMetadata(comment, []), staticKeyword, varKeyword,
null], "a = 1, b, c = 3;"); |
| 2180 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | 2167 JUnitTestCase.assertEquals(comment, declaration.documentationComment); |
| 2181 VariableDeclarationList fields4 = declaration.fields; | 2168 VariableDeclarationList fields5 = declaration.fields; |
| 2182 JUnitTestCase.assertNotNull(fields4); | 2169 JUnitTestCase.assertNotNull(fields5); |
| 2183 JUnitTestCase.assertEquals(varKeyword, fields4.keyword); | 2170 JUnitTestCase.assertEquals(varKeyword, fields5.keyword); |
| 2184 JUnitTestCase.assertNull(fields4.type); | 2171 JUnitTestCase.assertNull(fields5.type); |
| 2185 EngineTestCase.assertSize(3, fields4.variables); | 2172 EngineTestCase.assertSize(3, fields5.variables); |
| 2186 JUnitTestCase.assertEquals(staticKeyword, declaration.keyword); | 2173 JUnitTestCase.assertEquals(staticKeyword, declaration.keyword); |
| 2187 JUnitTestCase.assertNotNull(declaration.semicolon); | 2174 JUnitTestCase.assertNotNull(declaration.semicolon); |
| 2188 } | 2175 } |
| 2189 void test_parseInstanceCreationExpression_qualifiedType() { | 2176 void test_parseInstanceCreationExpression_qualifiedType() { |
| 2190 Token token5 = TokenFactory.token(Keyword.NEW); | 2177 Token token5 = TokenFactory.token(Keyword.NEW); |
| 2191 InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceC
reationExpression", <Object> [token5], "A.B()"); | 2178 InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceC
reationExpression", <Object> [token5], "A.B()"); |
| 2192 JUnitTestCase.assertEquals(token5, expression.keyword); | 2179 JUnitTestCase.assertEquals(token5, expression.keyword); |
| 2193 ConstructorName name = expression.constructorName; | 2180 ConstructorName name = expression.constructorName; |
| 2194 JUnitTestCase.assertNotNull(name); | 2181 JUnitTestCase.assertNotNull(name); |
| 2195 JUnitTestCase.assertNotNull(name.type); | 2182 JUnitTestCase.assertNotNull(name.type); |
| (...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3504 JUnitTestCase.assertNotNull(following); | 3491 JUnitTestCase.assertNotNull(following); |
| 3505 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | 3492 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); |
| 3506 } | 3493 } |
| 3507 /** | 3494 /** |
| 3508 * Invoke the method {@link Parser#computeStringValue(String)} with the given
argument. | 3495 * Invoke the method {@link Parser#computeStringValue(String)} with the given
argument. |
| 3509 * @param lexeme the argument to the method | 3496 * @param lexeme the argument to the method |
| 3510 * @return the result of invoking the method | 3497 * @return the result of invoking the method |
| 3511 * @throws Exception if the method could not be invoked or throws an exception | 3498 * @throws Exception if the method could not be invoked or throws an exception |
| 3512 */ | 3499 */ |
| 3513 String computeStringValue(String lexeme) { | 3500 String computeStringValue(String lexeme) { |
| 3514 AnalysisErrorListener listener = new AnalysisErrorListener_12(); | 3501 AnalysisErrorListener listener = new AnalysisErrorListener_13(); |
| 3515 Parser parser = new Parser(null, listener); | 3502 Parser parser = new Parser(null, listener); |
| 3516 return invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexeme
], null) as String; | 3503 return invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexeme
], null) as String; |
| 3517 } | 3504 } |
| 3518 /** | 3505 /** |
| 3519 * Invoke the method {@link Parser#createSyntheticIdentifier()} with the parse
r set to the token | 3506 * Invoke the method {@link Parser#createSyntheticIdentifier()} with the parse
r set to the token |
| 3520 * stream produced by scanning the given source. | 3507 * stream produced by scanning the given source. |
| 3521 * @param source the source to be scanned to produce the token stream being te
sted | 3508 * @param source the source to be scanned to produce the token stream being te
sted |
| 3522 * @return the result of invoking the method | 3509 * @return the result of invoking the method |
| 3523 * @throws Exception if the method could not be invoked or throws an exception | 3510 * @throws Exception if the method could not be invoked or throws an exception |
| 3524 */ | 3511 */ |
| (...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4687 runJUnitTest(__test, __test.test_parseFunctionBody_expression); | 4674 runJUnitTest(__test, __test.test_parseFunctionBody_expression); |
| 4688 }); | 4675 }); |
| 4689 _ut.test('test_parseFunctionDeclarationStatement', () { | 4676 _ut.test('test_parseFunctionDeclarationStatement', () { |
| 4690 final __test = new SimpleParserTest(); | 4677 final __test = new SimpleParserTest(); |
| 4691 runJUnitTest(__test, __test.test_parseFunctionDeclarationStatement); | 4678 runJUnitTest(__test, __test.test_parseFunctionDeclarationStatement); |
| 4692 }); | 4679 }); |
| 4693 _ut.test('test_parseFunctionDeclaration_function', () { | 4680 _ut.test('test_parseFunctionDeclaration_function', () { |
| 4694 final __test = new SimpleParserTest(); | 4681 final __test = new SimpleParserTest(); |
| 4695 runJUnitTest(__test, __test.test_parseFunctionDeclaration_function); | 4682 runJUnitTest(__test, __test.test_parseFunctionDeclaration_function); |
| 4696 }); | 4683 }); |
| 4697 _ut.test('test_parseFunctionDeclaration_function_inStatement', () { | |
| 4698 final __test = new SimpleParserTest(); | |
| 4699 runJUnitTest(__test, __test.test_parseFunctionDeclaration_function_inSta
tement); | |
| 4700 }); | |
| 4701 _ut.test('test_parseFunctionDeclaration_getter', () { | 4684 _ut.test('test_parseFunctionDeclaration_getter', () { |
| 4702 final __test = new SimpleParserTest(); | 4685 final __test = new SimpleParserTest(); |
| 4703 runJUnitTest(__test, __test.test_parseFunctionDeclaration_getter); | 4686 runJUnitTest(__test, __test.test_parseFunctionDeclaration_getter); |
| 4704 }); | 4687 }); |
| 4705 _ut.test('test_parseFunctionDeclaration_setter', () { | 4688 _ut.test('test_parseFunctionDeclaration_setter', () { |
| 4706 final __test = new SimpleParserTest(); | 4689 final __test = new SimpleParserTest(); |
| 4707 runJUnitTest(__test, __test.test_parseFunctionDeclaration_setter); | 4690 runJUnitTest(__test, __test.test_parseFunctionDeclaration_setter); |
| 4708 }); | 4691 }); |
| 4709 _ut.test('test_parseFunctionExpression_body_inExpression', () { | 4692 _ut.test('test_parseFunctionExpression_body_inExpression', () { |
| 4710 final __test = new SimpleParserTest(); | 4693 final __test = new SimpleParserTest(); |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5598 final __test = new SimpleParserTest(); | 5581 final __test = new SimpleParserTest(); |
| 5599 runJUnitTest(__test, __test.test_skipTypeName_parameterized); | 5582 runJUnitTest(__test, __test.test_skipTypeName_parameterized); |
| 5600 }); | 5583 }); |
| 5601 _ut.test('test_skipTypeName_simple', () { | 5584 _ut.test('test_skipTypeName_simple', () { |
| 5602 final __test = new SimpleParserTest(); | 5585 final __test = new SimpleParserTest(); |
| 5603 runJUnitTest(__test, __test.test_skipTypeName_simple); | 5586 runJUnitTest(__test, __test.test_skipTypeName_simple); |
| 5604 }); | 5587 }); |
| 5605 }); | 5588 }); |
| 5606 } | 5589 } |
| 5607 } | 5590 } |
| 5608 class AnalysisErrorListener_12 implements AnalysisErrorListener { | 5591 class AnalysisErrorListener_13 implements AnalysisErrorListener { |
| 5609 void onError(AnalysisError event) { | 5592 void onError(AnalysisError event) { |
| 5610 JUnitTestCase.fail("Unexpected compilation error: ${event.message} (${event.
offset}, ${event.length})"); | 5593 JUnitTestCase.fail("Unexpected compilation error: ${event.message} (${event.
offset}, ${event.length})"); |
| 5611 } | 5594 } |
| 5612 } | 5595 } |
| 5613 /** | 5596 /** |
| 5614 * The class {@code ComplexParserTest} defines parser tests that test the parsin
g of more complex | 5597 * The class {@code ComplexParserTest} defines parser tests that test the parsin
g of more complex |
| 5615 * code fragments or the interactions between multiple parsing methods. For exam
ple, tests to ensure | 5598 * code fragments or the interactions between multiple parsing methods. For exam
ple, tests to ensure |
| 5616 * that the precedence of operations is being handled correctly should be define
d in this class. | 5599 * that the precedence of operations is being handled correctly should be define
d in this class. |
| 5617 * <p> | 5600 * <p> |
| 5618 * Simpler tests should be defined in the class {@link SimpleParserTest}. | 5601 * Simpler tests should be defined in the class {@link SimpleParserTest}. |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6674 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6657 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6675 } | 6658 } |
| 6676 void test_shiftExpression_precedence_unary_right() { | 6659 void test_shiftExpression_precedence_unary_right() { |
| 6677 BinaryExpression expression = ParserTestCase.parseExpression("<< +", [Parser
ErrorCode.USE_OF_UNARY_PLUS_OPERATOR]); | 6660 BinaryExpression expression = ParserTestCase.parseExpression("<< +", [Parser
ErrorCode.USE_OF_UNARY_PLUS_OPERATOR]); |
| 6678 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | 6661 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6679 } | 6662 } |
| 6680 void test_shiftExpression_super() { | 6663 void test_shiftExpression_super() { |
| 6681 BinaryExpression expression = ParserTestCase.parseExpression("super << <<",
[]); | 6664 BinaryExpression expression = ParserTestCase.parseExpression("super << <<",
[]); |
| 6682 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6665 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6683 } | 6666 } |
| 6684 void test_topLevelExternalFunction_extraSemicolon() { | 6667 void test_typedef_eof() { |
| 6685 CompilationUnit unit = ParserTestCase.parseCompilationUnit("external void f(
A a);", [ParserErrorCode.UNEXPECTED_TOKEN]); | 6668 CompilationUnit unit = ParserTestCase.parseCompilationUnit("typedef n", [Par
serErrorCode.EXPECTED_TOKEN, ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]); |
| 6686 NodeList<CompilationUnitMember> declarations3 = unit.declarations; | 6669 NodeList<CompilationUnitMember> declarations3 = unit.declarations; |
| 6687 EngineTestCase.assertSize(1, declarations3); | 6670 EngineTestCase.assertSize(1, declarations3); |
| 6688 FunctionDeclaration declaration = declarations3[0] as FunctionDeclaration; | 6671 CompilationUnitMember member = declarations3[0]; |
| 6689 JUnitTestCase.assertNotNull(declaration); | |
| 6690 } | |
| 6691 void test_typedef_eof() { | |
| 6692 CompilationUnit unit = ParserTestCase.parseCompilationUnit("typedef n", [Par
serErrorCode.EXPECTED_TOKEN, ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]); | |
| 6693 NodeList<CompilationUnitMember> declarations4 = unit.declarations; | |
| 6694 EngineTestCase.assertSize(1, declarations4); | |
| 6695 CompilationUnitMember member = declarations4[0]; | |
| 6696 EngineTestCase.assertInstanceOf(FunctionTypeAlias, member); | 6672 EngineTestCase.assertInstanceOf(FunctionTypeAlias, member); |
| 6697 } | 6673 } |
| 6698 static dartSuite() { | 6674 static dartSuite() { |
| 6699 _ut.group('RecoveryParserTest', () { | 6675 _ut.group('RecoveryParserTest', () { |
| 6700 _ut.test('test_additiveExpression_missing_LHS', () { | 6676 _ut.test('test_additiveExpression_missing_LHS', () { |
| 6701 final __test = new RecoveryParserTest(); | 6677 final __test = new RecoveryParserTest(); |
| 6702 runJUnitTest(__test, __test.test_additiveExpression_missing_LHS); | 6678 runJUnitTest(__test, __test.test_additiveExpression_missing_LHS); |
| 6703 }); | 6679 }); |
| 6704 _ut.test('test_additiveExpression_missing_LHS_RHS', () { | 6680 _ut.test('test_additiveExpression_missing_LHS_RHS', () { |
| 6705 final __test = new RecoveryParserTest(); | 6681 final __test = new RecoveryParserTest(); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6990 runJUnitTest(__test, __test.test_shiftExpression_precedence_unary_left); | 6966 runJUnitTest(__test, __test.test_shiftExpression_precedence_unary_left); |
| 6991 }); | 6967 }); |
| 6992 _ut.test('test_shiftExpression_precedence_unary_right', () { | 6968 _ut.test('test_shiftExpression_precedence_unary_right', () { |
| 6993 final __test = new RecoveryParserTest(); | 6969 final __test = new RecoveryParserTest(); |
| 6994 runJUnitTest(__test, __test.test_shiftExpression_precedence_unary_right)
; | 6970 runJUnitTest(__test, __test.test_shiftExpression_precedence_unary_right)
; |
| 6995 }); | 6971 }); |
| 6996 _ut.test('test_shiftExpression_super', () { | 6972 _ut.test('test_shiftExpression_super', () { |
| 6997 final __test = new RecoveryParserTest(); | 6973 final __test = new RecoveryParserTest(); |
| 6998 runJUnitTest(__test, __test.test_shiftExpression_super); | 6974 runJUnitTest(__test, __test.test_shiftExpression_super); |
| 6999 }); | 6975 }); |
| 7000 _ut.test('test_topLevelExternalFunction_extraSemicolon', () { | |
| 7001 final __test = new RecoveryParserTest(); | |
| 7002 runJUnitTest(__test, __test.test_topLevelExternalFunction_extraSemicolon
); | |
| 7003 }); | |
| 7004 _ut.test('test_typedef_eof', () { | 6976 _ut.test('test_typedef_eof', () { |
| 7005 final __test = new RecoveryParserTest(); | 6977 final __test = new RecoveryParserTest(); |
| 7006 runJUnitTest(__test, __test.test_typedef_eof); | 6978 runJUnitTest(__test, __test.test_typedef_eof); |
| 7007 }); | 6979 }); |
| 7008 }); | 6980 }); |
| 7009 } | 6981 } |
| 7010 } | 6982 } |
| 7011 /** | 6983 /** |
| 7012 * The class {@code ErrorParserTest} defines parser tests that test the parsing
of code to ensure | 6984 * The class {@code ErrorParserTest} defines parser tests that test the parsing
of code to ensure |
| 7013 * that errors are correctly reported, and in some cases, not reported. | 6985 * that errors are correctly reported, and in some cases, not reported. |
| (...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8246 'parseExportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.parseExportDirective(arg0)), | 8218 'parseExportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.parseExportDirective(arg0)), |
| 8247 'parseExpression_0': new MethodTrampoline(0, (Parser target) => target.parseEx
pression2()), | 8219 'parseExpression_0': new MethodTrampoline(0, (Parser target) => target.parseEx
pression2()), |
| 8248 'parseExpressionList_0': new MethodTrampoline(0, (Parser target) => target.par
seExpressionList()), | 8220 'parseExpressionList_0': new MethodTrampoline(0, (Parser target) => target.par
seExpressionList()), |
| 8249 'parseExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target) =>
target.parseExpressionWithoutCascade()), | 8221 'parseExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target) =>
target.parseExpressionWithoutCascade()), |
| 8250 'parseExtendsClause_0': new MethodTrampoline(0, (Parser target) => target.pars
eExtendsClause()), | 8222 'parseExtendsClause_0': new MethodTrampoline(0, (Parser target) => target.pars
eExtendsClause()), |
| 8251 'parseFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) =>
target.parseFinalConstVarOrType(arg0)), | 8223 'parseFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) =>
target.parseFinalConstVarOrType(arg0)), |
| 8252 'parseFormalParameter_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.parseFormalParameter(arg0)), | 8224 'parseFormalParameter_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.parseFormalParameter(arg0)), |
| 8253 'parseFormalParameterList_0': new MethodTrampoline(0, (Parser target) => targe
t.parseFormalParameterList()), | 8225 'parseFormalParameterList_0': new MethodTrampoline(0, (Parser target) => targe
t.parseFormalParameterList()), |
| 8254 'parseForStatement_0': new MethodTrampoline(0, (Parser target) => target.parse
ForStatement()), | 8226 'parseForStatement_0': new MethodTrampoline(0, (Parser target) => target.parse
ForStatement()), |
| 8255 'parseFunctionBody_2': new MethodTrampoline(2, (Parser target, arg0, arg1) =>
target.parseFunctionBody(arg0, arg1)), | 8227 'parseFunctionBody_2': new MethodTrampoline(2, (Parser target, arg0, arg1) =>
target.parseFunctionBody(arg0, arg1)), |
| 8256 'parseFunctionDeclaration_4': new MethodTrampoline(4, (Parser target, arg0, ar
g1, arg2, arg3) => target.parseFunctionDeclaration(arg0, arg1, arg2, arg3)), | 8228 'parseFunctionDeclaration_3': new MethodTrampoline(3, (Parser target, arg0, ar
g1, arg2) => target.parseFunctionDeclaration(arg0, arg1, arg2)), |
| 8257 'parseFunctionDeclarationStatement_0': new MethodTrampoline(0, (Parser target)
=> target.parseFunctionDeclarationStatement()), | 8229 'parseFunctionDeclarationStatement_0': new MethodTrampoline(0, (Parser target)
=> target.parseFunctionDeclarationStatement()), |
| 8258 'parseFunctionDeclarationStatement_2': new MethodTrampoline(2, (Parser target,
arg0, arg1) => target.parseFunctionDeclarationStatement2(arg0, arg1)), | 8230 'parseFunctionDeclarationStatement_2': new MethodTrampoline(2, (Parser target,
arg0, arg1) => target.parseFunctionDeclarationStatement2(arg0, arg1)), |
| 8259 'parseFunctionExpression_0': new MethodTrampoline(0, (Parser target) => target
.parseFunctionExpression()), | 8231 'parseFunctionExpression_0': new MethodTrampoline(0, (Parser target) => target
.parseFunctionExpression()), |
| 8260 'parseFunctionTypeAlias_2': new MethodTrampoline(2, (Parser target, arg0, arg1
) => target.parseFunctionTypeAlias(arg0, arg1)), | 8232 'parseFunctionTypeAlias_2': new MethodTrampoline(2, (Parser target, arg0, arg1
) => target.parseFunctionTypeAlias(arg0, arg1)), |
| 8261 'parseGetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg
3) => target.parseGetter(arg0, arg1, arg2, arg3)), | 8233 'parseGetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg
3) => target.parseGetter(arg0, arg1, arg2, arg3)), |
| 8262 'parseIdentifierList_0': new MethodTrampoline(0, (Parser target) => target.par
seIdentifierList()), | 8234 'parseIdentifierList_0': new MethodTrampoline(0, (Parser target) => target.par
seIdentifierList()), |
| 8263 'parseIfStatement_0': new MethodTrampoline(0, (Parser target) => target.parseI
fStatement()), | 8235 'parseIfStatement_0': new MethodTrampoline(0, (Parser target) => target.parseI
fStatement()), |
| 8264 'parseImplementsClause_0': new MethodTrampoline(0, (Parser target) => target.p
arseImplementsClause()), | 8236 'parseImplementsClause_0': new MethodTrampoline(0, (Parser target) => target.p
arseImplementsClause()), |
| 8265 'parseImportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.parseImportDirective(arg0)), | 8237 'parseImportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.parseImportDirective(arg0)), |
| 8266 'parseInitializedIdentifierList_4': new MethodTrampoline(4, (Parser target, ar
g0, arg1, arg2, arg3) => target.parseInitializedIdentifierList(arg0, arg1, arg2,
arg3)), | 8238 'parseInitializedIdentifierList_4': new MethodTrampoline(4, (Parser target, ar
g0, arg1, arg2, arg3) => target.parseInitializedIdentifierList(arg0, arg1, arg2,
arg3)), |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8341 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelFunction(arg0)), | 8313 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelFunction(arg0)), |
| 8342 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelVariable(arg0)), | 8314 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelVariable(arg0)), |
| 8343 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.validateModifiersForTypedef(arg0)),}; | 8315 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.validateModifiersForTypedef(arg0)),}; |
| 8344 | 8316 |
| 8345 | 8317 |
| 8346 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj
ects, Token tokenStream) { | 8318 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj
ects, Token tokenStream) { |
| 8347 parser.currentToken = tokenStream; | 8319 parser.currentToken = tokenStream; |
| 8348 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length}
']; | 8320 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length}
']; |
| 8349 return method.invoke(parser, objects); | 8321 return method.invoke(parser, objects); |
| 8350 } | 8322 } |
| OLD | NEW |