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

Side by Side Diff: pkg/analyzer_experimental/lib/src/generated/parser.dart

Issue 14308011: New Analysis Engine snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
OLDNEW
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; 4 library engine.parser;
5 5
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'java_core.dart'; 7 import 'java_core.dart';
8 import 'java_engine.dart'; 8 import 'java_engine.dart';
9 import 'instrumentation.dart';
9 import 'error.dart'; 10 import 'error.dart';
10 import 'source.dart'; 11 import 'source.dart';
11 import 'scanner.dart'; 12 import 'scanner.dart';
12 import 'ast.dart'; 13 import 'ast.dart';
13 import 'utilities_dart.dart'; 14 import 'utilities_dart.dart';
14 15
15 /** 16 /**
16 * Instances of the class {@code CommentAndMetadata} implement a simple data-hol der for a method 17 * Instances of the class {@code CommentAndMetadata} implement a simple data-hol der for a method
17 * that needs to return multiple values. 18 * that needs to return multiple values.
18 * @coverage dart.engine.parser 19 * @coverage dart.engine.parser
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 */ 262 */
262 bool _inLoop = false; 263 bool _inLoop = false;
263 /** 264 /**
264 * A flag indicating whether the parser is currently in a switch statement. 265 * A flag indicating whether the parser is currently in a switch statement.
265 */ 266 */
266 bool _inSwitch = false; 267 bool _inSwitch = false;
267 static String _HIDE = "hide"; 268 static String _HIDE = "hide";
268 static String _OF = "of"; 269 static String _OF = "of";
269 static String _ON = "on"; 270 static String _ON = "on";
270 static String _SHOW = "show"; 271 static String _SHOW = "show";
272 static String _NATIVE = "native";
271 /** 273 /**
272 * Initialize a newly created parser. 274 * Initialize a newly created parser.
273 * @param source the source being parsed 275 * @param source the source being parsed
274 * @param errorListener the error listener that will be informed of any errors that are found 276 * @param errorListener the error listener that will be informed of any errors that are found
275 * during the parse 277 * during the parse
276 */ 278 */
277 Parser(Source source, AnalysisErrorListener errorListener) { 279 Parser(Source source, AnalysisErrorListener errorListener) {
278 this._source = source; 280 this._source = source;
279 this._errorListener = errorListener; 281 this._errorListener = errorListener;
280 } 282 }
281 /** 283 /**
282 * Parse a compilation unit, starting with the given token. 284 * Parse a compilation unit, starting with the given token.
283 * @param token the first token of the compilation unit 285 * @param token the first token of the compilation unit
284 * @return the compilation unit that was parsed 286 * @return the compilation unit that was parsed
285 */ 287 */
286 CompilationUnit parseCompilationUnit(Token token) { 288 CompilationUnit parseCompilationUnit(Token token) {
287 _currentToken = token; 289 InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engi ne.Parser.parseCompilationUnit");
288 return parseCompilationUnit2(); 290 try {
291 _currentToken = token;
292 return parseCompilationUnit2();
293 } finally {
294 instrumentation.log();
295 }
289 } 296 }
290 /** 297 /**
291 * Parse an expression, starting with the given token. 298 * Parse an expression, starting with the given token.
292 * @param token the first token of the expression 299 * @param token the first token of the expression
293 * @return the expression that was parsed, or {@code null} if the tokens do no t represent a 300 * @return the expression that was parsed, or {@code null} if the tokens do no t represent a
294 * recognizable expression 301 * recognizable expression
295 */ 302 */
296 Expression parseExpression(Token token) { 303 Expression parseExpression(Token token) {
297 _currentToken = token; 304 InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engi ne.Parser.parseExpression");
298 return parseExpression2(); 305 try {
306 _currentToken = token;
307 return parseExpression2();
308 } finally {
309 instrumentation.log();
310 }
299 } 311 }
300 /** 312 /**
301 * Parse a statement, starting with the given token. 313 * Parse a statement, starting with the given token.
302 * @param token the first token of the statement 314 * @param token the first token of the statement
303 * @return the statement that was parsed, or {@code null} if the tokens do not represent a 315 * @return the statement that was parsed, or {@code null} if the tokens do not represent a
304 * recognizable statement 316 * recognizable statement
305 */ 317 */
306 Statement parseStatement(Token token) { 318 Statement parseStatement(Token token) {
307 _currentToken = token; 319 InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engi ne.Parser.parseStatement");
308 return parseStatement2(); 320 try {
321 _currentToken = token;
322 return parseStatement2();
323 } finally {
324 instrumentation.log();
325 }
309 } 326 }
310 /** 327 /**
311 * Parse a sequence of statements, starting with the given token. 328 * Parse a sequence of statements, starting with the given token.
312 * @param token the first token of the sequence of statement 329 * @param token the first token of the sequence of statement
313 * @return the statements that were parsed, or {@code null} if the tokens do n ot represent a 330 * @return the statements that were parsed, or {@code null} if the tokens do n ot represent a
314 * recognizable sequence of statements 331 * recognizable sequence of statements
315 */ 332 */
316 List<Statement> parseStatements(Token token) { 333 List<Statement> parseStatements(Token token) {
317 _currentToken = token; 334 InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engi ne.Parser.parseStatements");
318 return parseStatements2(); 335 try {
336 _currentToken = token;
337 return parseStatements2();
338 } finally {
339 instrumentation.log();
340 }
319 } 341 }
320 void set currentToken(Token currentToken2) { 342 void set currentToken(Token currentToken2) {
321 this._currentToken = currentToken2; 343 this._currentToken = currentToken2;
322 } 344 }
323 /** 345 /**
324 * Advance to the next token in the token stream. 346 * Advance to the next token in the token stream.
325 */ 347 */
326 void advance() { 348 void advance() {
327 _currentToken = _currentToken.next; 349 _currentToken = _currentToken.next;
328 } 350 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 int index = start; 400 int index = start;
379 while (index < end) { 401 while (index < end) {
380 index = translateCharacter(builder, lexeme, index); 402 index = translateCharacter(builder, lexeme, index);
381 } 403 }
382 return builder.toString(); 404 return builder.toString();
383 } 405 }
384 /** 406 /**
385 * Create a synthetic identifier. 407 * Create a synthetic identifier.
386 * @return the synthetic identifier that was created 408 * @return the synthetic identifier that was created
387 */ 409 */
388 SimpleIdentifier createSyntheticIdentifier() => new SimpleIdentifier.full(crea teSyntheticToken(TokenType.IDENTIFIER)); 410 SimpleIdentifier createSyntheticIdentifier() => new SimpleIdentifier.full(crea teSyntheticToken2(TokenType.IDENTIFIER));
389 /** 411 /**
390 * Create a synthetic string literal. 412 * Create a synthetic string literal.
391 * @return the synthetic string literal that was created 413 * @return the synthetic string literal that was created
392 */ 414 */
393 SimpleStringLiteral createSyntheticStringLiteral() => new SimpleStringLiteral. full(createSyntheticToken(TokenType.STRING), ""); 415 SimpleStringLiteral createSyntheticStringLiteral() => new SimpleStringLiteral. full(createSyntheticToken2(TokenType.STRING), "");
416 /**
417 * Create a synthetic token representing the given keyword.
418 * @return the synthetic token that was created
419 */
420 Token createSyntheticToken(Keyword keyword) => new KeywordToken_11(keyword, _c urrentToken.offset);
394 /** 421 /**
395 * Create a synthetic token with the given type. 422 * Create a synthetic token with the given type.
396 * @return the synthetic token that was created 423 * @return the synthetic token that was created
397 */ 424 */
398 Token createSyntheticToken(TokenType type) => new StringToken(type, "", _curre ntToken.offset); 425 Token createSyntheticToken2(TokenType type) => new StringToken(type, "", _curr entToken.offset);
399 /** 426 /**
400 * Check that the given expression is assignable and report an error if it isn 't. 427 * Check that the given expression is assignable and report an error if it isn 't.
401 * <pre> 428 * <pre>
402 * assignableExpression ::= 429 * assignableExpression ::=
403 * primary (arguments* assignableSelector)+ 430 * primary (arguments* assignableSelector)+
404 * | 'super' assignableSelector 431 * | 'super' assignableSelector
405 * | identifier 432 * | identifier
406 * assignableSelector ::= 433 * assignableSelector ::=
407 * '[' expression ']' 434 * '[' expression ']'
408 * | '.' identifier 435 * | '.' identifier
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 return true; 561 return true;
535 } 562 }
536 Token token = skipTypeName(_currentToken); 563 Token token = skipTypeName(_currentToken);
537 if (token == null) { 564 if (token == null) {
538 return false; 565 return false;
539 } 566 }
540 token = skipSimpleIdentifier(token); 567 token = skipSimpleIdentifier(token);
541 if (token == null) { 568 if (token == null) {
542 return false; 569 return false;
543 } 570 }
544 TokenType type21 = token.type; 571 TokenType type26 = token.type;
545 return identical(type21, TokenType.EQ) || identical(type21, TokenType.COMMA) || identical(type21, TokenType.SEMICOLON) || matches3(token, Keyword.IN); 572 return identical(type26, TokenType.EQ) || identical(type26, TokenType.COMMA) || identical(type26, TokenType.SEMICOLON) || matches3(token, Keyword.IN);
573 }
574 /**
575 * Return {@code true} if the given token appears to be the beginning of an op erator declaration.
576 * @param startToken the token that might be the start of an operator declarat ion
577 * @return {@code true} if the given token appears to be the beginning of an o perator declaration
578 */
579 bool isOperator(Token startToken) {
580 if (startToken.isOperator()) {
581 Token token = startToken.next;
582 while (token.isOperator()) {
583 token = token.next;
584 }
585 return matches4(token, TokenType.OPEN_PAREN);
586 }
587 return false;
546 } 588 }
547 /** 589 /**
548 * Return {@code true} if the current token appears to be the beginning of a s witch member. 590 * Return {@code true} if the current token appears to be the beginning of a s witch member.
549 * @return {@code true} if the current token appears to be the beginning of a switch member 591 * @return {@code true} if the current token appears to be the beginning of a switch member
550 */ 592 */
551 bool isSwitchMember() { 593 bool isSwitchMember() {
552 Token token = _currentToken; 594 Token token = _currentToken;
553 while (matches4(token, TokenType.IDENTIFIER) && matches4(token.next, TokenTy pe.COLON)) { 595 while (matches4(token, TokenType.IDENTIFIER) && matches4(token.next, TokenTy pe.COLON)) {
554 token = token.next.next; 596 token = token.next.next;
555 } 597 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 * @param keyword the keyword that is being tested for 640 * @param keyword the keyword that is being tested for
599 * @return {@code true} if the given token matches the given keyword 641 * @return {@code true} if the given token matches the given keyword
600 */ 642 */
601 bool matches3(Token token, Keyword keyword38) => identical(token.type, TokenTy pe.KEYWORD) && identical(((token as KeywordToken)).keyword, keyword38); 643 bool matches3(Token token, Keyword keyword38) => identical(token.type, TokenTy pe.KEYWORD) && identical(((token as KeywordToken)).keyword, keyword38);
602 /** 644 /**
603 * Return {@code true} if the given token has the given type. 645 * Return {@code true} if the given token has the given type.
604 * @param token the token being tested 646 * @param token the token being tested
605 * @param type the type of token that is being tested for 647 * @param type the type of token that is being tested for
606 * @return {@code true} if the given token has the given type 648 * @return {@code true} if the given token has the given type
607 */ 649 */
608 bool matches4(Token token, TokenType type31) => identical(token.type, type31); 650 bool matches4(Token token, TokenType type40) => identical(token.type, type40);
609 /** 651 /**
610 * Return {@code true} if the current token has the given type. Note that this method, unlike 652 * Return {@code true} if the current token has the given type. Note that this method, unlike
611 * other variants, will modify the token stream if possible to match a wider r ange of tokens. In 653 * other variants, will modify the token stream if possible to match a wider r ange of tokens. In
612 * particular, if we are attempting to match a '>' and the next token is eithe r a '>>' or '>>>', 654 * particular, if we are attempting to match a '>' and the next token is eithe r a '>>' or '>>>',
613 * the token stream will be re-written and {@code true} will be returned. 655 * the token stream will be re-written and {@code true} will be returned.
614 * @param type the type of token that can optionally appear in the current loc ation 656 * @param type the type of token that can optionally appear in the current loc ation
615 * @return {@code true} if the current token has the given type 657 * @return {@code true} if the current token has the given type
616 */ 658 */
617 bool matches5(TokenType type32) { 659 bool matches5(TokenType type41) {
618 TokenType currentType = _currentToken.type; 660 TokenType currentType = _currentToken.type;
619 if (currentType != type32) { 661 if (currentType != type41) {
620 if (identical(type32, TokenType.GT)) { 662 if (identical(type41, TokenType.GT)) {
621 if (identical(currentType, TokenType.GT_GT)) { 663 if (identical(currentType, TokenType.GT_GT)) {
622 int offset6 = _currentToken.offset; 664 int offset6 = _currentToken.offset;
623 Token first = new Token(TokenType.GT, offset6); 665 Token first = new Token(TokenType.GT, offset6);
624 Token second = new Token(TokenType.GT, offset6 + 1); 666 Token second = new Token(TokenType.GT, offset6 + 1);
625 second.setNext(_currentToken.next); 667 second.setNext(_currentToken.next);
626 first.setNext(second); 668 first.setNext(second);
627 _currentToken.previous.setNext(first); 669 _currentToken.previous.setNext(first);
628 _currentToken = first; 670 _currentToken = first;
629 return true; 671 return true;
630 } else if (identical(currentType, TokenType.GT_EQ)) { 672 } else if (identical(currentType, TokenType.GT_EQ)) {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 while (_currentToken.type.isAdditiveOperator()) { 753 while (_currentToken.type.isAdditiveOperator()) {
712 Token operator = andAdvance; 754 Token operator = andAdvance;
713 expression = new BinaryExpression.full(expression, operator, parseMultipli cativeExpression()); 755 expression = new BinaryExpression.full(expression, operator, parseMultipli cativeExpression());
714 } 756 }
715 return expression; 757 return expression;
716 } 758 }
717 /** 759 /**
718 * Parse an annotation. 760 * Parse an annotation.
719 * <pre> 761 * <pre>
720 * annotation ::= 762 * annotation ::=
721 * '@' qualified (‘.’ identifier)? arguments? 763 * '@' qualified ('.' identifier)? arguments?
722 * </pre> 764 * </pre>
723 * @return the annotation that was parsed 765 * @return the annotation that was parsed
724 */ 766 */
725 Annotation parseAnnotation() { 767 Annotation parseAnnotation() {
726 Token atSign = expect2(TokenType.AT); 768 Token atSign = expect2(TokenType.AT);
727 Identifier name = parsePrefixedIdentifier(); 769 Identifier name = parsePrefixedIdentifier();
728 Token period = null; 770 Token period = null;
729 SimpleIdentifier constructorName = null; 771 SimpleIdentifier constructorName = null;
730 if (matches5(TokenType.PERIOD)) { 772 if (matches5(TokenType.PERIOD)) {
731 period = andAdvance; 773 period = andAdvance;
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 reportError5(ParserErrorCode.WITH_WITHOUT_EXTENDS, withClause.withKeyword, []); 1176 reportError5(ParserErrorCode.WITH_WITHOUT_EXTENDS, withClause.withKeyword, []);
1135 } 1177 }
1136 Token leftBracket = null; 1178 Token leftBracket = null;
1137 List<ClassMember> members = null; 1179 List<ClassMember> members = null;
1138 Token rightBracket = null; 1180 Token rightBracket = null;
1139 if (matches5(TokenType.OPEN_CURLY_BRACKET)) { 1181 if (matches5(TokenType.OPEN_CURLY_BRACKET)) {
1140 leftBracket = expect2(TokenType.OPEN_CURLY_BRACKET); 1182 leftBracket = expect2(TokenType.OPEN_CURLY_BRACKET);
1141 members = parseClassMembers(className, ((leftBracket as BeginToken)).endTo ken != null); 1183 members = parseClassMembers(className, ((leftBracket as BeginToken)).endTo ken != null);
1142 rightBracket = expect2(TokenType.CLOSE_CURLY_BRACKET); 1184 rightBracket = expect2(TokenType.CLOSE_CURLY_BRACKET);
1143 } else { 1185 } else {
1144 leftBracket = createSyntheticToken(TokenType.OPEN_CURLY_BRACKET); 1186 leftBracket = createSyntheticToken2(TokenType.OPEN_CURLY_BRACKET);
1145 rightBracket = createSyntheticToken(TokenType.CLOSE_CURLY_BRACKET); 1187 rightBracket = createSyntheticToken2(TokenType.CLOSE_CURLY_BRACKET);
1146 reportError4(ParserErrorCode.MISSING_CLASS_BODY, []); 1188 reportError4(ParserErrorCode.MISSING_CLASS_BODY, []);
1147 } 1189 }
1148 return new ClassDeclaration.full(commentAndMetadata.comment, commentAndMetad ata.metadata, abstractKeyword, keyword, name, typeParameters, extendsClause, wit hClause, implementsClause, leftBracket, members, rightBracket); 1190 return new ClassDeclaration.full(commentAndMetadata.comment, commentAndMetad ata.metadata, abstractKeyword, keyword, name, typeParameters, extendsClause, wit hClause, implementsClause, leftBracket, members, rightBracket);
1149 } 1191 }
1150 /** 1192 /**
1151 * Parse a class member. 1193 * Parse a class member.
1152 * <pre> 1194 * <pre>
1153 * classMemberDefinition ::= 1195 * classMemberDefinition ::=
1154 * declaration ';' 1196 * declaration ';'
1155 * | methodSignature functionBody 1197 * | methodSignature functionBody
1156 * </pre> 1198 * </pre>
1157 * @param className the name of the class containing the member being parsed 1199 * @param className the name of the class containing the member being parsed
1158 * @return the class member that was parsed 1200 * @return the class member that was parsed
1159 */ 1201 */
1160 ClassMember parseClassMember(String className) { 1202 ClassMember parseClassMember(String className) {
1161 CommentAndMetadata commentAndMetadata = parseCommentAndMetadata(); 1203 CommentAndMetadata commentAndMetadata = parseCommentAndMetadata();
1162 Modifiers modifiers = parseModifiers(); 1204 Modifiers modifiers = parseModifiers();
1163 if (matches(Keyword.VOID)) { 1205 if (matches(Keyword.VOID)) {
1164 TypeName returnType = parseReturnType(); 1206 TypeName returnType = parseReturnType();
1165 if (matches(Keyword.GET) && matchesIdentifier2(peek())) { 1207 if (matches(Keyword.GET) && matchesIdentifier2(peek())) {
1166 validateModifiersForGetterOrSetterOrMethod(modifiers); 1208 validateModifiersForGetterOrSetterOrMethod(modifiers);
1167 return parseGetter(commentAndMetadata, modifiers.externalKeyword, modifi ers.staticKeyword, returnType); 1209 return parseGetter(commentAndMetadata, modifiers.externalKeyword, modifi ers.staticKeyword, returnType);
1168 } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) { 1210 } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) {
1169 validateModifiersForGetterOrSetterOrMethod(modifiers); 1211 validateModifiersForGetterOrSetterOrMethod(modifiers);
1170 return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifi ers.staticKeyword, returnType); 1212 return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifi ers.staticKeyword, returnType);
1171 } else if (matches(Keyword.OPERATOR) && peek().isOperator()) { 1213 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
1172 validateModifiersForOperator(modifiers); 1214 validateModifiersForOperator(modifiers);
1173 return parseOperator(commentAndMetadata, modifiers.externalKeyword, retu rnType); 1215 return parseOperator(commentAndMetadata, modifiers.externalKeyword, retu rnType);
1174 } else if (matchesIdentifier() && matchesAny(peek(), [TokenType.OPEN_PAREN , TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) { 1216 } else if (matchesIdentifier() && matchesAny(peek(), [TokenType.OPEN_PAREN , TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) {
1175 validateModifiersForGetterOrSetterOrMethod(modifiers); 1217 validateModifiersForGetterOrSetterOrMethod(modifiers);
1176 return parseMethodDeclaration(commentAndMetadata, modifiers.externalKeyw ord, modifiers.staticKeyword, returnType); 1218 return parseMethodDeclaration(commentAndMetadata, modifiers.externalKeyw ord, modifiers.staticKeyword, returnType);
1177 } else { 1219 } else {
1178 if (matchesIdentifier()) { 1220 if (matchesIdentifier()) {
1179 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMIC OLON])) { 1221 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMIC OLON])) {
1180 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []); 1222 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []);
1181 return parseInitializedIdentifierList(commentAndMetadata, modifiers. staticKeyword, validateModifiersForField(modifiers), returnType); 1223 return parseInitializedIdentifierList(commentAndMetadata, modifiers. staticKeyword, validateModifiersForField(modifiers), returnType);
1182 } 1224 }
1183 } 1225 }
1226 if (isOperator(peek())) {
1227 validateModifiersForOperator(modifiers);
1228 return parseOperator(commentAndMetadata, modifiers.externalKeyword, re turnType);
1229 }
1230 reportError5(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
1184 return null; 1231 return null;
1185 } 1232 }
1186 } else if (matches(Keyword.GET) && matchesIdentifier2(peek())) { 1233 } else if (matches(Keyword.GET) && matchesIdentifier2(peek())) {
1187 validateModifiersForGetterOrSetterOrMethod(modifiers); 1234 validateModifiersForGetterOrSetterOrMethod(modifiers);
1188 return parseGetter(commentAndMetadata, modifiers.externalKeyword, modifier s.staticKeyword, null); 1235 return parseGetter(commentAndMetadata, modifiers.externalKeyword, modifier s.staticKeyword, null);
1189 } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) { 1236 } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) {
1190 validateModifiersForGetterOrSetterOrMethod(modifiers); 1237 validateModifiersForGetterOrSetterOrMethod(modifiers);
1191 return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifier s.staticKeyword, null); 1238 return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifier s.staticKeyword, null);
1192 } else if (matches(Keyword.OPERATOR) && peek().isOperator() && matches4(peek 2(2), TokenType.OPEN_PAREN)) { 1239 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
1193 validateModifiersForOperator(modifiers); 1240 validateModifiersForOperator(modifiers);
1194 return parseOperator(commentAndMetadata, modifiers.externalKeyword, null); 1241 return parseOperator(commentAndMetadata, modifiers.externalKeyword, null);
1195 } else if (!matchesIdentifier()) { 1242 } else if (!matchesIdentifier()) {
1243 if (isOperator(peek())) {
1244 validateModifiersForOperator(modifiers);
1245 return parseOperator(commentAndMetadata, modifiers.externalKeyword, null );
1246 }
1247 reportError5(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken, []);
1196 return null; 1248 return null;
1197 } else if (matches4(peek(), TokenType.PERIOD) && matchesIdentifier2(peek2(2) ) && matches4(peek2(3), TokenType.OPEN_PAREN)) { 1249 } else if (matches4(peek(), TokenType.PERIOD) && matchesIdentifier2(peek2(2) ) && matches4(peek2(3), TokenType.OPEN_PAREN)) {
1198 return parseConstructor(commentAndMetadata, modifiers.externalKeyword, val idateModifiersForConstructor(modifiers), modifiers.factoryKeyword, parseSimpleId entifier(), andAdvance, parseSimpleIdentifier(), parseFormalParameterList()); 1250 return parseConstructor(commentAndMetadata, modifiers.externalKeyword, val idateModifiersForConstructor(modifiers), modifiers.factoryKeyword, parseSimpleId entifier(), andAdvance, parseSimpleIdentifier(), parseFormalParameterList());
1199 } else if (matches4(peek(), TokenType.OPEN_PAREN)) { 1251 } else if (matches4(peek(), TokenType.OPEN_PAREN)) {
1200 SimpleIdentifier methodName = parseSimpleIdentifier(); 1252 SimpleIdentifier methodName = parseSimpleIdentifier();
1201 FormalParameterList parameters = parseFormalParameterList(); 1253 FormalParameterList parameters = parseFormalParameterList();
1202 if (matches5(TokenType.COLON) || modifiers.factoryKeyword != null || metho dName.name == className) { 1254 if (matches5(TokenType.COLON) || modifiers.factoryKeyword != null || metho dName.name == className) {
1203 return parseConstructor(commentAndMetadata, modifiers.externalKeyword, v alidateModifiersForConstructor(modifiers), modifiers.factoryKeyword, methodName, null, null, parameters); 1255 return parseConstructor(commentAndMetadata, modifiers.externalKeyword, v alidateModifiersForConstructor(modifiers), modifiers.factoryKeyword, methodName, null, null, parameters);
1204 } 1256 }
1205 validateModifiersForGetterOrSetterOrMethod(modifiers); 1257 validateModifiersForGetterOrSetterOrMethod(modifiers);
1206 validateFormalParameterList(parameters); 1258 validateFormalParameterList(parameters);
1207 return parseMethodDeclaration2(commentAndMetadata, modifiers.externalKeywo rd, modifiers.staticKeyword, null, methodName, parameters); 1259 return parseMethodDeclaration2(commentAndMetadata, modifiers.externalKeywo rd, modifiers.staticKeyword, null, methodName, parameters);
1208 } else if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMI COLON])) { 1260 } else if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMI COLON])) {
1209 return parseInitializedIdentifierList(commentAndMetadata, modifiers.static Keyword, validateModifiersForField(modifiers), null); 1261 return parseInitializedIdentifierList(commentAndMetadata, modifiers.static Keyword, validateModifiersForField(modifiers), null);
1210 } 1262 }
1211 TypeName type = parseTypeName(); 1263 TypeName type = parseTypeName();
1212 if (matches(Keyword.GET) && matchesIdentifier2(peek())) { 1264 if (matches(Keyword.GET) && matchesIdentifier2(peek())) {
1213 validateModifiersForGetterOrSetterOrMethod(modifiers); 1265 validateModifiersForGetterOrSetterOrMethod(modifiers);
1214 return parseGetter(commentAndMetadata, modifiers.externalKeyword, modifier s.staticKeyword, type); 1266 return parseGetter(commentAndMetadata, modifiers.externalKeyword, modifier s.staticKeyword, type);
1215 } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) { 1267 } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) {
1216 validateModifiersForGetterOrSetterOrMethod(modifiers); 1268 validateModifiersForGetterOrSetterOrMethod(modifiers);
1217 return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifier s.staticKeyword, type); 1269 return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifier s.staticKeyword, type);
1218 } else if (matches(Keyword.OPERATOR) && peek().isOperator() && matches4(peek 2(2), TokenType.OPEN_PAREN)) { 1270 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
1219 validateModifiersForOperator(modifiers); 1271 validateModifiersForOperator(modifiers);
1220 return parseOperator(commentAndMetadata, modifiers.externalKeyword, type); 1272 return parseOperator(commentAndMetadata, modifiers.externalKeyword, type);
1221 } else if (!matchesIdentifier()) { 1273 } else if (!matchesIdentifier()) {
1274 if (matches5(TokenType.CLOSE_CURLY_BRACKET)) {
1275 return parseInitializedIdentifierList(commentAndMetadata, modifiers.stat icKeyword, validateModifiersForField(modifiers), type);
1276 }
1277 if (isOperator(peek())) {
1278 validateModifiersForOperator(modifiers);
1279 return parseOperator(commentAndMetadata, modifiers.externalKeyword, type );
1280 }
1281 reportError5(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken, []);
1282 return null;
1222 } else if (matches4(peek(), TokenType.OPEN_PAREN)) { 1283 } else if (matches4(peek(), TokenType.OPEN_PAREN)) {
1223 validateModifiersForGetterOrSetterOrMethod(modifiers); 1284 validateModifiersForGetterOrSetterOrMethod(modifiers);
1224 return parseMethodDeclaration(commentAndMetadata, modifiers.externalKeywor d, modifiers.staticKeyword, type); 1285 return parseMethodDeclaration(commentAndMetadata, modifiers.externalKeywor d, modifiers.staticKeyword, type);
1225 } 1286 }
1226 return parseInitializedIdentifierList(commentAndMetadata, modifiers.staticKe yword, validateModifiersForField(modifiers), type); 1287 return parseInitializedIdentifierList(commentAndMetadata, modifiers.staticKe yword, validateModifiersForField(modifiers), type);
1227 } 1288 }
1228 /** 1289 /**
1229 * Parse a list of class members. 1290 * Parse a list of class members.
1230 * <pre> 1291 * <pre>
1231 * classMembers ::= 1292 * classMembers ::=
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 TypeParameterList typeParameters = null; 1335 TypeParameterList typeParameters = null;
1275 if (matches5(TokenType.LT)) { 1336 if (matches5(TokenType.LT)) {
1276 typeParameters = parseTypeParameterList(); 1337 typeParameters = parseTypeParameterList();
1277 } 1338 }
1278 Token equals = expect2(TokenType.EQ); 1339 Token equals = expect2(TokenType.EQ);
1279 Token abstractKeyword = null; 1340 Token abstractKeyword = null;
1280 if (matches(Keyword.ABSTRACT)) { 1341 if (matches(Keyword.ABSTRACT)) {
1281 abstractKeyword = andAdvance; 1342 abstractKeyword = andAdvance;
1282 } 1343 }
1283 TypeName superclass = parseTypeName(); 1344 TypeName superclass = parseTypeName();
1284 WithClause withClause = parseWithClause(); 1345 WithClause withClause = null;
1346 if (matches(Keyword.WITH)) {
1347 withClause = parseWithClause();
1348 }
1285 ImplementsClause implementsClause = null; 1349 ImplementsClause implementsClause = null;
1286 if (matches(Keyword.IMPLEMENTS)) { 1350 if (matches(Keyword.IMPLEMENTS)) {
1287 implementsClause = parseImplementsClause(); 1351 implementsClause = parseImplementsClause();
1288 } 1352 }
1289 Token semicolon = expect2(TokenType.SEMICOLON); 1353 Token semicolon = expect2(TokenType.SEMICOLON);
1290 return new ClassTypeAlias.full(commentAndMetadata.comment, commentAndMetadat a.metadata, keyword, name, typeParameters, equals, abstractKeyword, superclass, withClause, implementsClause, semicolon); 1354 return new ClassTypeAlias.full(commentAndMetadata.comment, commentAndMetadat a.metadata, keyword, name, typeParameters, equals, abstractKeyword, superclass, withClause, implementsClause, semicolon);
1291 } 1355 }
1292 /** 1356 /**
1293 * Parse a list of combinators in a directive. 1357 * Parse a list of combinators in a directive.
1294 * <pre> 1358 * <pre>
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 * comment 1408 * comment
1345 * @param sourceOffset the offset of the first character of the reference sour ce 1409 * @param sourceOffset the offset of the first character of the reference sour ce
1346 * @return the comment reference that was parsed 1410 * @return the comment reference that was parsed
1347 */ 1411 */
1348 CommentReference parseCommentReference(String referenceSource, int sourceOffse t) { 1412 CommentReference parseCommentReference(String referenceSource, int sourceOffse t) {
1349 if (referenceSource.length == 0) { 1413 if (referenceSource.length == 0) {
1350 return null; 1414 return null;
1351 } 1415 }
1352 try { 1416 try {
1353 List<bool> errorFound = [false]; 1417 List<bool> errorFound = [false];
1354 AnalysisErrorListener listener = new AnalysisErrorListener_8(errorFound); 1418 AnalysisErrorListener listener = new AnalysisErrorListener_12(errorFound);
1355 StringScanner scanner = new StringScanner(null, referenceSource, listener) ; 1419 StringScanner scanner = new StringScanner(null, referenceSource, listener) ;
1356 scanner.setSourceStart(1, 1, sourceOffset); 1420 scanner.setSourceStart(1, 1, sourceOffset);
1357 Token firstToken = scanner.tokenize(); 1421 Token firstToken = scanner.tokenize();
1358 if (!errorFound[0]) { 1422 if (!errorFound[0]) {
1359 Token newKeyword = null; 1423 Token newKeyword = null;
1360 if (matches3(firstToken, Keyword.NEW)) { 1424 if (matches3(firstToken, Keyword.NEW)) {
1361 newKeyword = firstToken; 1425 newKeyword = firstToken;
1362 firstToken = firstToken.next; 1426 firstToken = firstToken.next;
1363 } 1427 }
1364 if (matchesIdentifier2(firstToken)) { 1428 if (matchesIdentifier2(firstToken)) {
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 return parseClassDeclaration(commentAndMetadata, validateModifiersForClass (modifiers)); 1596 return parseClassDeclaration(commentAndMetadata, validateModifiersForClass (modifiers));
1533 } else if (matches(Keyword.TYPEDEF) && !matches4(peek(), TokenType.PERIOD) & & !matches4(peek(), TokenType.LT)) { 1597 } else if (matches(Keyword.TYPEDEF) && !matches4(peek(), TokenType.PERIOD) & & !matches4(peek(), TokenType.LT)) {
1534 validateModifiersForTypedef(modifiers); 1598 validateModifiersForTypedef(modifiers);
1535 return parseTypeAlias(commentAndMetadata); 1599 return parseTypeAlias(commentAndMetadata);
1536 } 1600 }
1537 if (matches(Keyword.VOID)) { 1601 if (matches(Keyword.VOID)) {
1538 TypeName returnType = parseReturnType(); 1602 TypeName returnType = parseReturnType();
1539 if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifier2(p eek())) { 1603 if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifier2(p eek())) {
1540 validateModifiersForTopLevelFunction(modifiers); 1604 validateModifiersForTopLevelFunction(modifiers);
1541 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKe yword, null); 1605 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKe yword, null);
1542 } else if (matches(Keyword.OPERATOR) && peek().isOperator()) { 1606 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
1607 reportError5(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []);
1543 return null; 1608 return null;
1544 } else if (matchesIdentifier() && matchesAny(peek(), [TokenType.OPEN_PAREN , TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) { 1609 } else if (matchesIdentifier() && matchesAny(peek(), [TokenType.OPEN_PAREN , TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) {
1545 validateModifiersForTopLevelFunction(modifiers); 1610 validateModifiersForTopLevelFunction(modifiers);
1546 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKe yword, null); 1611 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKe yword, returnType);
1547 } else { 1612 } else {
1548 if (matchesIdentifier()) { 1613 if (matchesIdentifier()) {
1549 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMIC OLON])) { 1614 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMIC OLON])) {
1550 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []); 1615 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []);
1551 return new TopLevelVariableDeclaration.full(commentAndMetadata.comme nt, commentAndMetadata.metadata, parseVariableDeclarationList2(null, validateMod ifiersForTopLevelVariable(modifiers), null), expect2(TokenType.SEMICOLON)); 1616 return new TopLevelVariableDeclaration.full(commentAndMetadata.comme nt, commentAndMetadata.metadata, parseVariableDeclarationList2(null, validateMod ifiersForTopLevelVariable(modifiers), null), expect2(TokenType.SEMICOLON));
1552 } 1617 }
1553 } 1618 }
1619 reportError5(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
1554 return null; 1620 return null;
1555 } 1621 }
1556 } else if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifi er2(peek())) { 1622 } else if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifi er2(peek())) {
1557 validateModifiersForTopLevelFunction(modifiers); 1623 validateModifiersForTopLevelFunction(modifiers);
1558 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, null); 1624 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, null);
1559 } else if (matches(Keyword.OPERATOR) && peek().isOperator() && matches4(peek 2(2), TokenType.OPEN_PAREN)) { 1625 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
1626 reportError5(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []);
1560 return null; 1627 return null;
1561 } else if (!matchesIdentifier()) { 1628 } else if (!matchesIdentifier()) {
1629 reportError5(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
1562 return null; 1630 return null;
1563 } else if (matches4(peek(), TokenType.OPEN_PAREN)) { 1631 } else if (matches4(peek(), TokenType.OPEN_PAREN)) {
1564 validateModifiersForTopLevelFunction(modifiers); 1632 validateModifiersForTopLevelFunction(modifiers);
1565 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, null); 1633 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, null);
1566 } else if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMI COLON])) { 1634 } else if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMI COLON])) {
1567 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co mmentAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiers ForTopLevelVariable(modifiers), null), expect2(TokenType.SEMICOLON)); 1635 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co mmentAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiers ForTopLevelVariable(modifiers), null), expect2(TokenType.SEMICOLON));
1568 } 1636 }
1569 TypeName returnType = parseReturnType(); 1637 TypeName returnType = parseReturnType();
1570 if (matches(Keyword.GET) || matches(Keyword.SET)) { 1638 if (matches(Keyword.GET) || matches(Keyword.SET)) {
1571 validateModifiersForTopLevelFunction(modifiers); 1639 validateModifiersForTopLevelFunction(modifiers);
1572 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, returnType); 1640 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, returnType);
1641 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
1642 reportError5(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []);
1643 return null;
1573 } else if (!matchesIdentifier()) { 1644 } else if (!matchesIdentifier()) {
1645 reportError5(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
1574 return null; 1646 return null;
1575 } 1647 }
1576 if (matchesAny(peek(), [TokenType.OPEN_PAREN, TokenType.FUNCTION, TokenType. OPEN_CURLY_BRACKET])) { 1648 if (matchesAny(peek(), [TokenType.OPEN_PAREN, TokenType.FUNCTION, TokenType. OPEN_CURLY_BRACKET])) {
1577 validateModifiersForTopLevelFunction(modifiers); 1649 validateModifiersForTopLevelFunction(modifiers);
1578 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, returnType); 1650 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, returnType);
1579 } 1651 }
1580 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, comm entAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiersFo rTopLevelVariable(modifiers), returnType), expect2(TokenType.SEMICOLON)); 1652 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, comm entAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiersFo rTopLevelVariable(modifiers), returnType), expect2(TokenType.SEMICOLON));
1581 } 1653 }
1582 /** 1654 /**
1583 * Parse a conditional expression. 1655 * Parse a conditional expression.
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 * optionalPositionalFormalParameters 2103 * optionalPositionalFormalParameters
2032 * | namedFormalParameters 2104 * | namedFormalParameters
2033 * optionalPositionalFormalParameters ::= 2105 * optionalPositionalFormalParameters ::=
2034 * '[' defaultFormalParameter (',' defaultFormalParameter)* ']' 2106 * '[' defaultFormalParameter (',' defaultFormalParameter)* ']'
2035 * namedFormalParameters ::= 2107 * namedFormalParameters ::=
2036 * '{' defaultNamedParameter (',' defaultNamedParameter)* '}' 2108 * '{' defaultNamedParameter (',' defaultNamedParameter)* '}'
2037 * </pre> 2109 * </pre>
2038 * @return the formal parameters that were parsed 2110 * @return the formal parameters that were parsed
2039 */ 2111 */
2040 FormalParameterList parseFormalParameterList() { 2112 FormalParameterList parseFormalParameterList() {
2041 if (matches5(TokenType.EQ) && matches4(peek(), TokenType.OPEN_PAREN)) {
2042 Token previous4 = _currentToken.previous;
2043 if ((matches4(previous4, TokenType.EQ_EQ) || matches4(previous4, TokenType .BANG_EQ)) && _currentToken.offset == previous4.offset + 2) {
2044 advance();
2045 }
2046 }
2047 Token leftParenthesis = expect2(TokenType.OPEN_PAREN); 2113 Token leftParenthesis = expect2(TokenType.OPEN_PAREN);
2048 if (matches5(TokenType.CLOSE_PAREN)) { 2114 if (matches5(TokenType.CLOSE_PAREN)) {
2049 return new FormalParameterList.full(leftParenthesis, null, null, null, and Advance); 2115 return new FormalParameterList.full(leftParenthesis, null, null, null, and Advance);
2050 } 2116 }
2051 List<FormalParameter> parameters = new List<FormalParameter>(); 2117 List<FormalParameter> parameters = new List<FormalParameter>();
2052 List<FormalParameter> normalParameters = new List<FormalParameter>(); 2118 List<FormalParameter> normalParameters = new List<FormalParameter>();
2053 List<FormalParameter> positionalParameters = new List<FormalParameter>(); 2119 List<FormalParameter> positionalParameters = new List<FormalParameter>();
2054 List<FormalParameter> namedParameters = new List<FormalParameter>(); 2120 List<FormalParameter> namedParameters = new List<FormalParameter>();
2055 List<FormalParameter> currentParameters = normalParameters; 2121 List<FormalParameter> currentParameters = normalParameters;
2056 Token leftSquareBracket = null; 2122 Token leftSquareBracket = null;
2057 Token rightSquareBracket = null; 2123 Token rightSquareBracket = null;
2058 Token leftCurlyBracket = null; 2124 Token leftCurlyBracket = null;
2059 Token rightCurlyBracket = null; 2125 Token rightCurlyBracket = null;
2060 ParameterKind kind = ParameterKind.REQUIRED; 2126 ParameterKind kind = ParameterKind.REQUIRED;
2061 bool firstParameter = true; 2127 bool firstParameter = true;
2062 bool reportedMuliplePositionalGroups = false; 2128 bool reportedMuliplePositionalGroups = false;
2063 bool reportedMulipleNamedGroups = false; 2129 bool reportedMulipleNamedGroups = false;
2064 bool reportedMixedGroups = false; 2130 bool reportedMixedGroups = false;
2065 Token initialToken = null; 2131 Token initialToken = null;
2066 do { 2132 do {
2067 if (firstParameter) { 2133 if (firstParameter) {
2068 firstParameter = false; 2134 firstParameter = false;
2069 } else if (!optional(TokenType.COMMA)) { 2135 } else if (!optional(TokenType.COMMA)) {
2070 if (((leftParenthesis as BeginToken)).endToken != null) { 2136 if ((leftParenthesis is BeginToken) && ((leftParenthesis as BeginToken)) .endToken != null) {
2071 reportError4(ParserErrorCode.EXPECTED_TOKEN, [TokenType.COMMA.lexeme]) ; 2137 reportError4(ParserErrorCode.EXPECTED_TOKEN, [TokenType.COMMA.lexeme]) ;
2072 } else { 2138 } else {
2139 reportError5(ParserErrorCode.MISSING_CLOSING_PARENTHESIS, _currentToke n.previous, []);
2073 break; 2140 break;
2074 } 2141 }
2075 } 2142 }
2076 initialToken = _currentToken; 2143 initialToken = _currentToken;
2077 if (matches5(TokenType.OPEN_SQUARE_BRACKET)) { 2144 if (matches5(TokenType.OPEN_SQUARE_BRACKET)) {
2078 if (leftSquareBracket != null && !reportedMuliplePositionalGroups) { 2145 if (leftSquareBracket != null && !reportedMuliplePositionalGroups) {
2079 reportError4(ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS, []) ; 2146 reportError4(ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS, []) ;
2080 reportedMuliplePositionalGroups = true; 2147 reportedMuliplePositionalGroups = true;
2081 } 2148 }
2082 if (leftCurlyBracket != null && !reportedMixedGroups) { 2149 if (leftCurlyBracket != null && !reportedMixedGroups) {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
2178 } else if (isInitializedVariableDeclaration()) { 2245 } else if (isInitializedVariableDeclaration()) {
2179 variableList = parseVariableDeclarationList(commentAndMetadata); 2246 variableList = parseVariableDeclarationList(commentAndMetadata);
2180 } else { 2247 } else {
2181 initialization = parseExpression2(); 2248 initialization = parseExpression2();
2182 } 2249 }
2183 if (matches(Keyword.IN)) { 2250 if (matches(Keyword.IN)) {
2184 DeclaredIdentifier loopVariable = null; 2251 DeclaredIdentifier loopVariable = null;
2185 if (variableList == null) { 2252 if (variableList == null) {
2186 reportError4(ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH, []); 2253 reportError4(ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH, []);
2187 } else { 2254 } else {
2188 NodeList<VariableDeclaration> variables3 = variableList.variables; 2255 NodeList<VariableDeclaration> variables4 = variableList.variables;
2189 if (variables3.length > 1) { 2256 if (variables4.length > 1) {
2190 reportError4(ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH, [vari ables3.length.toString()]); 2257 reportError4(ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH, [vari ables4.length.toString()]);
2191 } 2258 }
2192 VariableDeclaration variable = variables3[0]; 2259 VariableDeclaration variable = variables4[0];
2193 if (variable.initializer != null) { 2260 if (variable.initializer != null) {
2194 reportError4(ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, []) ; 2261 reportError4(ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, []) ;
2195 } 2262 }
2196 loopVariable = new DeclaredIdentifier.full(commentAndMetadata.commen t, commentAndMetadata.metadata, variableList.keyword, variableList.type, variabl e.name); 2263 loopVariable = new DeclaredIdentifier.full(commentAndMetadata.commen t, commentAndMetadata.metadata, variableList.keyword, variableList.type, variabl e.name);
2197 } 2264 }
2198 Token inKeyword = expect(Keyword.IN); 2265 Token inKeyword = expect(Keyword.IN);
2199 Expression iterator = parseExpression2(); 2266 Expression iterator = parseExpression2();
2200 Token rightParenthesis = expect2(TokenType.CLOSE_PAREN); 2267 Token rightParenthesis = expect2(TokenType.CLOSE_PAREN);
2201 Statement body = parseStatement2(); 2268 Statement body = parseStatement2();
2202 return new ForEachStatement.full(forKeyword, leftParenthesis, loopVari able, inKeyword, iterator, rightParenthesis, body); 2269 return new ForEachStatement.full(forKeyword, leftParenthesis, loopVari able, inKeyword, iterator, rightParenthesis, body);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2248 } else if (matches5(TokenType.FUNCTION)) { 2315 } else if (matches5(TokenType.FUNCTION)) {
2249 Token functionDefinition = andAdvance; 2316 Token functionDefinition = andAdvance;
2250 Expression expression = parseExpression2(); 2317 Expression expression = parseExpression2();
2251 Token semicolon = null; 2318 Token semicolon = null;
2252 if (!inExpression) { 2319 if (!inExpression) {
2253 semicolon = expect2(TokenType.SEMICOLON); 2320 semicolon = expect2(TokenType.SEMICOLON);
2254 } 2321 }
2255 return new ExpressionFunctionBody.full(functionDefinition, expression, s emicolon); 2322 return new ExpressionFunctionBody.full(functionDefinition, expression, s emicolon);
2256 } else if (matches5(TokenType.OPEN_CURLY_BRACKET)) { 2323 } else if (matches5(TokenType.OPEN_CURLY_BRACKET)) {
2257 return new BlockFunctionBody.full(parseBlock()); 2324 return new BlockFunctionBody.full(parseBlock());
2258 } else if (matches2("native")) { 2325 } else if (matches2(_NATIVE)) {
2259 advance(); 2326 Token nativeToken = andAdvance;
2260 parseStringLiteral(); 2327 StringLiteral stringLiteral = parseStringLiteral();
2261 return new EmptyFunctionBody.full(andAdvance); 2328 return new NativeFunctionBody.full(nativeToken, stringLiteral, expect2(T okenType.SEMICOLON));
2262 } else { 2329 } else {
2263 reportError4(ParserErrorCode.MISSING_FUNCTION_BODY, []); 2330 reportError4(ParserErrorCode.MISSING_FUNCTION_BODY, []);
2264 return new EmptyFunctionBody.full(createSyntheticToken(TokenType.SEMICOL ON)); 2331 return new EmptyFunctionBody.full(createSyntheticToken2(TokenType.SEMICO LON));
2265 } 2332 }
2266 } finally { 2333 } finally {
2267 _inLoop = wasInLoop; 2334 _inLoop = wasInLoop;
2268 _inSwitch = wasInSwitch; 2335 _inSwitch = wasInSwitch;
2269 } 2336 }
2270 } 2337 }
2271 /** 2338 /**
2272 * Parse a function declaration. 2339 * Parse a function declaration.
2273 * <pre> 2340 * <pre>
2274 * functionDeclaration ::= 2341 * functionDeclaration ::=
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
2330 * @param commentAndMetadata the documentation comment and metadata to be asso ciated with the 2397 * @param commentAndMetadata the documentation comment and metadata to be asso ciated with the
2331 * declaration 2398 * declaration
2332 * @param returnType the return type, or {@code null} if there is no return ty pe 2399 * @param returnType the return type, or {@code null} if there is no return ty pe
2333 * @return the function declaration statement that was parsed 2400 * @return the function declaration statement that was parsed
2334 */ 2401 */
2335 Statement parseFunctionDeclarationStatement2(CommentAndMetadata commentAndMeta data, TypeName returnType) => new FunctionDeclarationStatement.full(parseFunctio nDeclaration(commentAndMetadata, null, returnType)); 2402 Statement parseFunctionDeclarationStatement2(CommentAndMetadata commentAndMeta data, TypeName returnType) => new FunctionDeclarationStatement.full(parseFunctio nDeclaration(commentAndMetadata, null, returnType));
2336 /** 2403 /**
2337 * Parse a function expression. 2404 * Parse a function expression.
2338 * <pre> 2405 * <pre>
2339 * functionExpression ::= 2406 * functionExpression ::=
2340 * (returnType? identifier)? formalParameterList functionExpressionBody 2407 * formalParameterList functionExpressionBody
2341 * </pre> 2408 * </pre>
2342 * @return the function expression that was parsed 2409 * @return the function expression that was parsed
2343 */ 2410 */
2344 FunctionExpression parseFunctionExpression() { 2411 FunctionExpression parseFunctionExpression() {
2345 FormalParameterList parameters = parseFormalParameterList(); 2412 FormalParameterList parameters = parseFormalParameterList();
2346 validateFormalParameterList(parameters); 2413 validateFormalParameterList(parameters);
2347 FunctionBody body = parseFunctionBody(false, true); 2414 FunctionBody body = parseFunctionBody(false, true);
2348 return new FunctionExpression.full(parameters, body); 2415 return new FunctionExpression.full(parameters, body);
2349 } 2416 }
2350 /** 2417 /**
(...skipping 13 matching lines...) Expand all
2364 if (hasReturnTypeInTypeAlias()) { 2431 if (hasReturnTypeInTypeAlias()) {
2365 returnType = parseReturnType(); 2432 returnType = parseReturnType();
2366 } 2433 }
2367 SimpleIdentifier name = parseSimpleIdentifier(); 2434 SimpleIdentifier name = parseSimpleIdentifier();
2368 TypeParameterList typeParameters = null; 2435 TypeParameterList typeParameters = null;
2369 if (matches5(TokenType.LT)) { 2436 if (matches5(TokenType.LT)) {
2370 typeParameters = parseTypeParameterList(); 2437 typeParameters = parseTypeParameterList();
2371 } 2438 }
2372 if (matches5(TokenType.SEMICOLON) || matches5(TokenType.EOF)) { 2439 if (matches5(TokenType.SEMICOLON) || matches5(TokenType.EOF)) {
2373 reportError4(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, []); 2440 reportError4(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, []);
2374 FormalParameterList parameters = new FormalParameterList.full(createSynthe ticToken(TokenType.OPEN_PAREN), null, null, null, createSyntheticToken(TokenType .CLOSE_PAREN)); 2441 FormalParameterList parameters = new FormalParameterList.full(createSynthe ticToken2(TokenType.OPEN_PAREN), null, null, null, createSyntheticToken2(TokenTy pe.CLOSE_PAREN));
2375 Token semicolon = expect2(TokenType.SEMICOLON); 2442 Token semicolon = expect2(TokenType.SEMICOLON);
2376 return new FunctionTypeAlias.full(commentAndMetadata.comment, commentAndMe tadata.metadata, keyword, returnType, name, typeParameters, parameters, semicolo n); 2443 return new FunctionTypeAlias.full(commentAndMetadata.comment, commentAndMe tadata.metadata, keyword, returnType, name, typeParameters, parameters, semicolo n);
2377 } else if (!matches5(TokenType.OPEN_PAREN)) { 2444 } else if (!matches5(TokenType.OPEN_PAREN)) {
2445 reportError4(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, []);
2378 return null; 2446 return null;
2379 } 2447 }
2380 FormalParameterList parameters = parseFormalParameterList(); 2448 FormalParameterList parameters = parseFormalParameterList();
2381 validateFormalParameterList(parameters); 2449 validateFormalParameterList(parameters);
2382 Token semicolon = expect2(TokenType.SEMICOLON); 2450 Token semicolon = expect2(TokenType.SEMICOLON);
2383 return new FunctionTypeAlias.full(commentAndMetadata.comment, commentAndMeta data.metadata, keyword, returnType, name, typeParameters, parameters, semicolon) ; 2451 return new FunctionTypeAlias.full(commentAndMetadata.comment, commentAndMeta data.metadata, keyword, returnType, name, typeParameters, parameters, semicolon) ;
2384 } 2452 }
2385 /** 2453 /**
2386 * Parse a getter. 2454 * Parse a getter.
2387 * <pre> 2455 * <pre>
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
2636 TypeArgumentList typeArguments = null; 2704 TypeArgumentList typeArguments = null;
2637 if (matches5(TokenType.LT)) { 2705 if (matches5(TokenType.LT)) {
2638 typeArguments = parseTypeArgumentList(); 2706 typeArguments = parseTypeArgumentList();
2639 } 2707 }
2640 if (matches5(TokenType.OPEN_CURLY_BRACKET)) { 2708 if (matches5(TokenType.OPEN_CURLY_BRACKET)) {
2641 return parseMapLiteral(modifier, typeArguments); 2709 return parseMapLiteral(modifier, typeArguments);
2642 } else if (matches5(TokenType.OPEN_SQUARE_BRACKET) || matches5(TokenType.IND EX)) { 2710 } else if (matches5(TokenType.OPEN_SQUARE_BRACKET) || matches5(TokenType.IND EX)) {
2643 return parseListLiteral(modifier, typeArguments); 2711 return parseListLiteral(modifier, typeArguments);
2644 } 2712 }
2645 reportError4(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL, []); 2713 reportError4(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL, []);
2646 return new ListLiteral.full(modifier, typeArguments, createSyntheticToken(To kenType.OPEN_SQUARE_BRACKET), null, createSyntheticToken(TokenType.CLOSE_SQUARE_ BRACKET)); 2714 return new ListLiteral.full(modifier, typeArguments, createSyntheticToken2(T okenType.OPEN_SQUARE_BRACKET), null, createSyntheticToken2(TokenType.CLOSE_SQUAR E_BRACKET));
2647 } 2715 }
2648 /** 2716 /**
2649 * Parse a logical and expression. 2717 * Parse a logical and expression.
2650 * <pre> 2718 * <pre>
2651 * logicalAndExpression ::= 2719 * logicalAndExpression ::=
2652 * bitwiseOrExpression ('&&' bitwiseOrExpression) 2720 * bitwiseOrExpression ('&&' bitwiseOrExpression)
2653 * </pre> 2721 * </pre>
2654 * @return the logical and expression that was parsed 2722 * @return the logical and expression that was parsed
2655 */ 2723 */
2656 Expression parseLogicalAndExpression() { 2724 Expression parseLogicalAndExpression() {
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
2931 } else if (identical(keyword31, Keyword.VOID)) { 2999 } else if (identical(keyword31, Keyword.VOID)) {
2932 TypeName returnType = parseReturnType(); 3000 TypeName returnType = parseReturnType();
2933 if (matchesIdentifier() && matchesAny(peek(), [TokenType.OPEN_PAREN, Tok enType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) { 3001 if (matchesIdentifier() && matchesAny(peek(), [TokenType.OPEN_PAREN, Tok enType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) {
2934 return parseFunctionDeclarationStatement2(commentAndMetadata, returnTy pe); 3002 return parseFunctionDeclarationStatement2(commentAndMetadata, returnTy pe);
2935 } else { 3003 } else {
2936 if (matchesIdentifier()) { 3004 if (matchesIdentifier()) {
2937 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEM ICOLON])) { 3005 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEM ICOLON])) {
2938 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []); 3006 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []);
2939 return parseVariableDeclarationStatement(commentAndMetadata); 3007 return parseVariableDeclarationStatement(commentAndMetadata);
2940 } 3008 }
3009 } else if (matches5(TokenType.CLOSE_CURLY_BRACKET)) {
3010 return parseVariableDeclarationStatement2(commentAndMetadata, null, returnType);
2941 } 3011 }
3012 reportError4(ParserErrorCode.MISSING_STATEMENT, []);
2942 return null; 3013 return null;
2943 } 3014 }
2944 } else if (identical(keyword31, Keyword.CONST)) { 3015 } else if (identical(keyword31, Keyword.CONST)) {
2945 if (matchesAny(peek(), [TokenType.LT, TokenType.OPEN_CURLY_BRACKET, Toke nType.OPEN_SQUARE_BRACKET, TokenType.INDEX])) { 3016 if (matchesAny(peek(), [TokenType.LT, TokenType.OPEN_CURLY_BRACKET, Toke nType.OPEN_SQUARE_BRACKET, TokenType.INDEX])) {
2946 return new ExpressionStatement.full(parseExpression2(), expect2(TokenT ype.SEMICOLON)); 3017 return new ExpressionStatement.full(parseExpression2(), expect2(TokenT ype.SEMICOLON));
2947 } else if (matches4(peek(), TokenType.IDENTIFIER)) { 3018 } else if (matches4(peek(), TokenType.IDENTIFIER)) {
2948 Token afterType = skipTypeName(peek()); 3019 Token afterType = skipTypeName(peek());
2949 if (afterType != null) { 3020 if (afterType != null) {
2950 if (matches4(afterType, TokenType.OPEN_PAREN) || (matches4(afterType , TokenType.PERIOD) && matches4(afterType.next, TokenType.IDENTIFIER) && matches 4(afterType.next.next, TokenType.OPEN_PAREN))) { 3021 if (matches4(afterType, TokenType.OPEN_PAREN) || (matches4(afterType , TokenType.PERIOD) && matches4(afterType.next, TokenType.IDENTIFIER) && matches 4(afterType.next.next, TokenType.OPEN_PAREN))) {
2951 return new ExpressionStatement.full(parseExpression2(), expect2(To kenType.SEMICOLON)); 3022 return new ExpressionStatement.full(parseExpression2(), expect2(To kenType.SEMICOLON));
2952 } 3023 }
2953 } 3024 }
2954 } 3025 }
2955 return parseVariableDeclarationStatement(commentAndMetadata); 3026 return parseVariableDeclarationStatement(commentAndMetadata);
2956 } else if (identical(keyword31, Keyword.NEW) || identical(keyword31, Keywo rd.TRUE) || identical(keyword31, Keyword.FALSE) || identical(keyword31, Keyword. NULL) || identical(keyword31, Keyword.SUPER) || identical(keyword31, Keyword.THI S)) { 3027 } else if (identical(keyword31, Keyword.NEW) || identical(keyword31, Keywo rd.TRUE) || identical(keyword31, Keyword.FALSE) || identical(keyword31, Keyword. NULL) || identical(keyword31, Keyword.SUPER) || identical(keyword31, Keyword.THI S)) {
2957 return new ExpressionStatement.full(parseExpression2(), expect2(TokenTyp e.SEMICOLON)); 3028 return new ExpressionStatement.full(parseExpression2(), expect2(TokenTyp e.SEMICOLON));
2958 } else { 3029 } else {
3030 reportError4(ParserErrorCode.MISSING_STATEMENT, []);
2959 return null; 3031 return null;
2960 } 3032 }
2961 } else if (matches5(TokenType.SEMICOLON)) { 3033 } else if (matches5(TokenType.SEMICOLON)) {
2962 return parseEmptyStatement(); 3034 return parseEmptyStatement();
2963 } else if (isInitializedVariableDeclaration()) { 3035 } else if (isInitializedVariableDeclaration()) {
2964 return parseVariableDeclarationStatement(commentAndMetadata); 3036 return parseVariableDeclarationStatement(commentAndMetadata);
2965 } else if (isFunctionDeclaration()) { 3037 } else if (isFunctionDeclaration()) {
2966 return parseFunctionDeclarationStatement(); 3038 return parseFunctionDeclarationStatement();
2967 } else if (matches5(TokenType.CLOSE_CURLY_BRACKET)) { 3039 } else if (matches5(TokenType.CLOSE_CURLY_BRACKET)) {
2968 reportError4(ParserErrorCode.MISSING_STATEMENT, []); 3040 reportError4(ParserErrorCode.MISSING_STATEMENT, []);
2969 return new EmptyStatement.full(createSyntheticToken(TokenType.SEMICOLON)); 3041 return new EmptyStatement.full(createSyntheticToken2(TokenType.SEMICOLON)) ;
2970 } else { 3042 } else {
2971 return new ExpressionStatement.full(parseExpression2(), expect2(TokenType. SEMICOLON)); 3043 return new ExpressionStatement.full(parseExpression2(), expect2(TokenType. SEMICOLON));
2972 } 3044 }
2973 } 3045 }
2974 /** 3046 /**
2975 * Parse a normal formal parameter. 3047 * Parse a normal formal parameter.
2976 * <pre> 3048 * <pre>
2977 * normalFormalParameter ::= 3049 * normalFormalParameter ::=
2978 * functionSignature 3050 * functionSignature
2979 * | fieldFormalParameter 3051 * | fieldFormalParameter
(...skipping 17 matching lines...) Expand all
2997 thisKeyword = andAdvance; 3069 thisKeyword = andAdvance;
2998 period = expect2(TokenType.PERIOD); 3070 period = expect2(TokenType.PERIOD);
2999 } 3071 }
3000 SimpleIdentifier identifier = parseSimpleIdentifier(); 3072 SimpleIdentifier identifier = parseSimpleIdentifier();
3001 if (matches5(TokenType.OPEN_PAREN)) { 3073 if (matches5(TokenType.OPEN_PAREN)) {
3002 if (thisKeyword != null) { 3074 if (thisKeyword != null) {
3003 } 3075 }
3004 FormalParameterList parameters = parseFormalParameterList(); 3076 FormalParameterList parameters = parseFormalParameterList();
3005 return new FunctionTypedFormalParameter.full(commentAndMetadata.comment, c ommentAndMetadata.metadata, holder.type, identifier, parameters); 3077 return new FunctionTypedFormalParameter.full(commentAndMetadata.comment, c ommentAndMetadata.metadata, holder.type, identifier, parameters);
3006 } 3078 }
3007 TypeName type22 = holder.type; 3079 TypeName type27 = holder.type;
3008 if (type22 != null && matches3(type22.name.beginToken, Keyword.VOID)) { 3080 if (type27 != null && matches3(type27.name.beginToken, Keyword.VOID)) {
3009 reportError5(ParserErrorCode.VOID_PARAMETER, type22.name.beginToken, []); 3081 reportError5(ParserErrorCode.VOID_PARAMETER, type27.name.beginToken, []);
3010 } 3082 }
3011 if (thisKeyword != null) { 3083 if (thisKeyword != null) {
3012 return new FieldFormalParameter.full(commentAndMetadata.comment, commentAn dMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifier ); 3084 return new FieldFormalParameter.full(commentAndMetadata.comment, commentAn dMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifier );
3013 } 3085 }
3014 return new SimpleFormalParameter.full(commentAndMetadata.comment, commentAnd Metadata.metadata, holder.keyword, holder.type, identifier); 3086 return new SimpleFormalParameter.full(commentAndMetadata.comment, commentAnd Metadata.metadata, holder.keyword, holder.type, identifier);
3015 } 3087 }
3016 /** 3088 /**
3017 * Parse an operator declaration. 3089 * Parse an operator declaration.
3018 * <pre> 3090 * <pre>
3019 * operatorDeclaration ::= 3091 * operatorDeclaration ::=
3020 * operatorSignature (';' | functionBody) 3092 * operatorSignature (';' | functionBody)
3021 * operatorSignature ::= 3093 * operatorSignature ::=
3022 * 'external'? returnType? 'operator' operator formalParameterList 3094 * 'external'? returnType? 'operator' operator formalParameterList
3023 * </pre> 3095 * </pre>
3024 * @param commentAndMetadata the documentation comment and metadata to be asso ciated with the 3096 * @param commentAndMetadata the documentation comment and metadata to be asso ciated with the
3025 * declaration 3097 * declaration
3026 * @param externalKeyword the 'external' token 3098 * @param externalKeyword the 'external' token
3027 * @param the return type that has already been parsed, or {@code null} if the re was no return 3099 * @param the return type that has already been parsed, or {@code null} if the re was no return
3028 * type 3100 * type
3029 * @return the operator declaration that was parsed 3101 * @return the operator declaration that was parsed
3030 */ 3102 */
3031 MethodDeclaration parseOperator(CommentAndMetadata commentAndMetadata, Token e xternalKeyword, TypeName returnType) { 3103 MethodDeclaration parseOperator(CommentAndMetadata commentAndMetadata, Token e xternalKeyword, TypeName returnType) {
3032 Token operatorKeyword = expect(Keyword.OPERATOR); 3104 Token operatorKeyword;
3105 if (matches(Keyword.OPERATOR)) {
3106 operatorKeyword = andAdvance;
3107 } else {
3108 reportError5(ParserErrorCode.MISSING_KEYWORD_OPERATOR, _currentToken, []);
3109 operatorKeyword = createSyntheticToken(Keyword.OPERATOR);
3110 }
3033 if (!_currentToken.isUserDefinableOperator()) { 3111 if (!_currentToken.isUserDefinableOperator()) {
3034 reportError4(ParserErrorCode.NON_USER_DEFINABLE_OPERATOR, [_currentToken.l exeme]); 3112 reportError4(ParserErrorCode.NON_USER_DEFINABLE_OPERATOR, [_currentToken.l exeme]);
3035 } 3113 }
3036 SimpleIdentifier name = new SimpleIdentifier.full(andAdvance); 3114 SimpleIdentifier name = new SimpleIdentifier.full(andAdvance);
3115 if (matches5(TokenType.EQ)) {
3116 Token previous4 = _currentToken.previous;
3117 if ((matches4(previous4, TokenType.EQ_EQ) || matches4(previous4, TokenType .BANG_EQ)) && _currentToken.offset == previous4.offset + 2) {
3118 reportError4(ParserErrorCode.INVALID_OPERATOR, ["${previous4.lexeme}${_c urrentToken.lexeme}"]);
3119 advance();
3120 }
3121 }
3037 FormalParameterList parameters = parseFormalParameterList(); 3122 FormalParameterList parameters = parseFormalParameterList();
3038 validateFormalParameterList(parameters); 3123 validateFormalParameterList(parameters);
3039 FunctionBody body = parseFunctionBody(true, false); 3124 FunctionBody body = parseFunctionBody(true, false);
3040 if (externalKeyword != null && body is! EmptyFunctionBody) { 3125 if (externalKeyword != null && body is! EmptyFunctionBody) {
3041 reportError4(ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY, []); 3126 reportError4(ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY, []);
3042 } 3127 }
3043 return new MethodDeclaration.full(commentAndMetadata.comment, commentAndMeta data.metadata, externalKeyword, null, returnType, null, operatorKeyword, name, p arameters, body); 3128 return new MethodDeclaration.full(commentAndMetadata.comment, commentAndMeta data.metadata, externalKeyword, null, returnType, null, operatorKeyword, name, p arameters, body);
3044 } 3129 }
3045 /** 3130 /**
3046 * Parse a return type if one is given, otherwise return {@code null} without advancing. 3131 * Parse a return type if one is given, otherwise return {@code null} without advancing.
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
3834 VariableDeclarationList parseVariableDeclarationList(CommentAndMetadata commen tAndMetadata) { 3919 VariableDeclarationList parseVariableDeclarationList(CommentAndMetadata commen tAndMetadata) {
3835 FinalConstVarOrType holder = parseFinalConstVarOrType(false); 3920 FinalConstVarOrType holder = parseFinalConstVarOrType(false);
3836 return parseVariableDeclarationList2(commentAndMetadata, holder.keyword, hol der.type); 3921 return parseVariableDeclarationList2(commentAndMetadata, holder.keyword, hol der.type);
3837 } 3922 }
3838 /** 3923 /**
3839 * Parse a variable declaration list. 3924 * Parse a variable declaration list.
3840 * <pre> 3925 * <pre>
3841 * variableDeclarationList ::= 3926 * variableDeclarationList ::=
3842 * finalConstVarOrType variableDeclaration (',' variableDeclaration) 3927 * finalConstVarOrType variableDeclaration (',' variableDeclaration)
3843 * </pre> 3928 * </pre>
3844 * @param commentAndMetadata the metadata to be associated with the variable d eclaration list, or 3929 * @param commentAndMetadata the metadata to be associated with the variable d eclaration list, or{@code null} if there is no attempt at parsing the comment an d metadata
3845 * <code>null</code> if there is no attempt at parsing the comment and metadat a
3846 * @param keyword the token representing the 'final', 'const' or 'var' keyword , or {@code null} if 3930 * @param keyword the token representing the 'final', 'const' or 'var' keyword , or {@code null} if
3847 * there is no keyword 3931 * there is no keyword
3848 * @param type the type of the variables in the list 3932 * @param type the type of the variables in the list
3849 * @return the variable declaration list that was parsed 3933 * @return the variable declaration list that was parsed
3850 */ 3934 */
3851 VariableDeclarationList parseVariableDeclarationList2(CommentAndMetadata comme ntAndMetadata, Token keyword, TypeName type) { 3935 VariableDeclarationList parseVariableDeclarationList2(CommentAndMetadata comme ntAndMetadata, Token keyword, TypeName type) {
3852 List<VariableDeclaration> variables = new List<VariableDeclaration>(); 3936 List<VariableDeclaration> variables = new List<VariableDeclaration>();
3853 variables.add(parseVariableDeclaration()); 3937 variables.add(parseVariableDeclaration());
3854 while (matches5(TokenType.COMMA)) { 3938 while (matches5(TokenType.COMMA)) {
3855 advance(); 3939 advance();
3856 variables.add(parseVariableDeclaration()); 3940 variables.add(parseVariableDeclaration());
3857 } 3941 }
3858 return new VariableDeclarationList.full(commentAndMetadata != null ? comment AndMetadata.comment : null, commentAndMetadata != null ? commentAndMetadata.meta data : null, keyword, type, variables); 3942 return new VariableDeclarationList.full(commentAndMetadata != null ? comment AndMetadata.comment : null, commentAndMetadata != null ? commentAndMetadata.meta data : null, keyword, type, variables);
3859 } 3943 }
3860 /** 3944 /**
3861 * Parse a variable declaration statement. 3945 * Parse a variable declaration statement.
3862 * <pre> 3946 * <pre>
3863 * variableDeclarationStatement ::= 3947 * variableDeclarationStatement ::=
3864 * variableDeclarationList ';' 3948 * variableDeclarationList ';'
3865 * </pre> 3949 * </pre>
3950 * @param commentAndMetadata the metadata to be associated with the variable d eclaration
3951 * statement, or {@code null} if there is no attempt at parsing the comment an d metadata
3866 * @return the variable declaration statement that was parsed 3952 * @return the variable declaration statement that was parsed
3867 */ 3953 */
3868 VariableDeclarationStatement parseVariableDeclarationStatement(CommentAndMetad ata commentAndMetadata) { 3954 VariableDeclarationStatement parseVariableDeclarationStatement(CommentAndMetad ata commentAndMetadata) {
3869 VariableDeclarationList variableList = parseVariableDeclarationList(commentA ndMetadata); 3955 VariableDeclarationList variableList = parseVariableDeclarationList(commentA ndMetadata);
3870 Token semicolon = expect2(TokenType.SEMICOLON); 3956 Token semicolon = expect2(TokenType.SEMICOLON);
3871 return new VariableDeclarationStatement.full(variableList, semicolon); 3957 return new VariableDeclarationStatement.full(variableList, semicolon);
3872 } 3958 }
3873 /** 3959 /**
3960 * Parse a variable declaration statement.
3961 * <pre>
3962 * variableDeclarationStatement ::=
3963 * variableDeclarationList ';'
3964 * </pre>
3965 * @param commentAndMetadata the metadata to be associated with the variable d eclaration
3966 * statement, or {@code null} if there is no attempt at parsing the comment an d metadata
3967 * @param keyword the token representing the 'final', 'const' or 'var' keyword , or {@code null} if
3968 * there is no keyword
3969 * @param type the type of the variables in the list
3970 * @return the variable declaration statement that was parsed
3971 */
3972 VariableDeclarationStatement parseVariableDeclarationStatement2(CommentAndMeta data commentAndMetadata, Token keyword, TypeName type) {
3973 VariableDeclarationList variableList = parseVariableDeclarationList2(comment AndMetadata, keyword, type);
3974 Token semicolon = expect2(TokenType.SEMICOLON);
3975 return new VariableDeclarationStatement.full(variableList, semicolon);
3976 }
3977 /**
3874 * Parse a while statement. 3978 * Parse a while statement.
3875 * <pre> 3979 * <pre>
3876 * whileStatement ::= 3980 * whileStatement ::=
3877 * 'while' '(' expression ')' statement 3981 * 'while' '(' expression ')' statement
3878 * </pre> 3982 * </pre>
3879 * @return the while statement that was parsed 3983 * @return the while statement that was parsed
3880 */ 3984 */
3881 Statement parseWhileStatement() { 3985 Statement parseWhileStatement() {
3882 bool wasInLoop = _inLoop; 3986 bool wasInLoop = _inLoop;
3883 _inLoop = true; 3987 _inLoop = true;
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
4124 * actually creating a string literal or changing the current token. Return th e token following 4228 * actually creating a string literal or changing the current token. Return th e token following
4125 * the string literal that was parsed, or {@code null} if the given token is n ot the first token 4229 * the string literal that was parsed, or {@code null} if the given token is n ot the first token
4126 * in a valid string literal. 4230 * in a valid string literal.
4127 * <p> 4231 * <p>
4128 * This method must be kept in sync with {@link #parseStringInterpolation(Toke n)}. 4232 * This method must be kept in sync with {@link #parseStringInterpolation(Toke n)}.
4129 * @param startToken the token at which parsing is to begin 4233 * @param startToken the token at which parsing is to begin
4130 * @return the string literal that was parsed 4234 * @return the string literal that was parsed
4131 */ 4235 */
4132 Token skipStringInterpolation(Token startToken) { 4236 Token skipStringInterpolation(Token startToken) {
4133 Token token = startToken; 4237 Token token = startToken;
4134 TokenType type23 = token.type; 4238 TokenType type28 = token.type;
4135 while (identical(type23, TokenType.STRING_INTERPOLATION_EXPRESSION) || ident ical(type23, TokenType.STRING_INTERPOLATION_IDENTIFIER)) { 4239 while (identical(type28, TokenType.STRING_INTERPOLATION_EXPRESSION) || ident ical(type28, TokenType.STRING_INTERPOLATION_IDENTIFIER)) {
4136 if (identical(type23, TokenType.STRING_INTERPOLATION_EXPRESSION)) { 4240 if (identical(type28, TokenType.STRING_INTERPOLATION_EXPRESSION)) {
4137 token = token.next; 4241 token = token.next;
4138 type23 = token.type; 4242 type28 = token.type;
4139 int bracketNestingLevel = 1; 4243 int bracketNestingLevel = 1;
4140 while (bracketNestingLevel > 0) { 4244 while (bracketNestingLevel > 0) {
4141 if (identical(type23, TokenType.EOF)) { 4245 if (identical(type28, TokenType.EOF)) {
4142 return null; 4246 return null;
4143 } else if (identical(type23, TokenType.OPEN_CURLY_BRACKET)) { 4247 } else if (identical(type28, TokenType.OPEN_CURLY_BRACKET)) {
4144 bracketNestingLevel++; 4248 bracketNestingLevel++;
4145 } else if (identical(type23, TokenType.CLOSE_CURLY_BRACKET)) { 4249 } else if (identical(type28, TokenType.CLOSE_CURLY_BRACKET)) {
4146 bracketNestingLevel--; 4250 bracketNestingLevel--;
4147 } else if (identical(type23, TokenType.STRING)) { 4251 } else if (identical(type28, TokenType.STRING)) {
4148 token = skipStringLiteral(token); 4252 token = skipStringLiteral(token);
4149 if (token == null) { 4253 if (token == null) {
4150 return null; 4254 return null;
4151 } 4255 }
4152 } else { 4256 } else {
4153 token = token.next; 4257 token = token.next;
4154 } 4258 }
4155 type23 = token.type; 4259 type28 = token.type;
4156 } 4260 }
4157 token = token.next; 4261 token = token.next;
4158 type23 = token.type; 4262 type28 = token.type;
4159 } else { 4263 } else {
4160 token = token.next; 4264 token = token.next;
4161 if (token.type != TokenType.IDENTIFIER) { 4265 if (token.type != TokenType.IDENTIFIER) {
4162 return null; 4266 return null;
4163 } 4267 }
4164 token = token.next; 4268 token = token.next;
4165 } 4269 }
4166 type23 = token.type; 4270 type28 = token.type;
4167 if (identical(type23, TokenType.STRING)) { 4271 if (identical(type28, TokenType.STRING)) {
4168 token = token.next; 4272 token = token.next;
4169 type23 = token.type; 4273 type28 = token.type;
4170 } 4274 }
4171 } 4275 }
4172 return token; 4276 return token;
4173 } 4277 }
4174 /** 4278 /**
4175 * Parse a string literal, starting at the given token, without actually creat ing a string literal 4279 * Parse a string literal, starting at the given token, without actually creat ing a string literal
4176 * or changing the current token. Return the token following the string litera l that was parsed, 4280 * or changing the current token. Return the token following the string litera l that was parsed,
4177 * or {@code null} if the given token is not the first token in a valid string literal. 4281 * or {@code null} if the given token is not the first token in a valid string literal.
4178 * <p> 4282 * <p>
4179 * This method must be kept in sync with {@link #parseStringLiteral()}. 4283 * This method must be kept in sync with {@link #parseStringLiteral()}.
4180 * <pre> 4284 * <pre>
4181 * stringLiteral ::= 4285 * stringLiteral ::=
4182 * MULTI_LINE_STRING+ 4286 * MULTI_LINE_STRING+
4183 * | SINGLE_LINE_STRING+ 4287 * | SINGLE_LINE_STRING+
4184 * </pre> 4288 * </pre>
4185 * @param startToken the token at which parsing is to begin 4289 * @param startToken the token at which parsing is to begin
4186 * @return the token following the string literal that was parsed 4290 * @return the token following the string literal that was parsed
4187 */ 4291 */
4188 Token skipStringLiteral(Token startToken) { 4292 Token skipStringLiteral(Token startToken) {
4189 Token token = startToken; 4293 Token token = startToken;
4190 while (token != null && matches4(token, TokenType.STRING)) { 4294 while (token != null && matches4(token, TokenType.STRING)) {
4191 token = token.next; 4295 token = token.next;
4192 TokenType type24 = token.type; 4296 TokenType type29 = token.type;
4193 if (identical(type24, TokenType.STRING_INTERPOLATION_EXPRESSION) || identi cal(type24, TokenType.STRING_INTERPOLATION_IDENTIFIER)) { 4297 if (identical(type29, TokenType.STRING_INTERPOLATION_EXPRESSION) || identi cal(type29, TokenType.STRING_INTERPOLATION_IDENTIFIER)) {
4194 token = skipStringInterpolation(token); 4298 token = skipStringInterpolation(token);
4195 } 4299 }
4196 } 4300 }
4197 if (identical(token, startToken)) { 4301 if (identical(token, startToken)) {
4198 return null; 4302 return null;
4199 } 4303 }
4200 return token; 4304 return token;
4201 } 4305 }
4202 /** 4306 /**
4203 * Parse a list of type arguments, starting at the given token, without actual ly creating a type argument list 4307 * Parse a list of type arguments, starting at the given token, without actual ly creating a type argument list
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
4648 reportError5(ParserErrorCode.EXTERNAL_TYPEDEF, modifiers.externalKeyword, []); 4752 reportError5(ParserErrorCode.EXTERNAL_TYPEDEF, modifiers.externalKeyword, []);
4649 } 4753 }
4650 if (modifiers.finalKeyword != null) { 4754 if (modifiers.finalKeyword != null) {
4651 reportError5(ParserErrorCode.FINAL_TYPEDEF, modifiers.finalKeyword, []); 4755 reportError5(ParserErrorCode.FINAL_TYPEDEF, modifiers.finalKeyword, []);
4652 } 4756 }
4653 if (modifiers.varKeyword != null) { 4757 if (modifiers.varKeyword != null) {
4654 reportError5(ParserErrorCode.VAR_TYPEDEF, modifiers.varKeyword, []); 4758 reportError5(ParserErrorCode.VAR_TYPEDEF, modifiers.varKeyword, []);
4655 } 4759 }
4656 } 4760 }
4657 } 4761 }
4658 class AnalysisErrorListener_8 implements AnalysisErrorListener { 4762 class KeywordToken_11 extends KeywordToken {
4763 KeywordToken_11(Keyword arg0, int arg1) : super(arg0, arg1);
4764 int get length => 0;
4765 }
4766 class AnalysisErrorListener_12 implements AnalysisErrorListener {
4659 List<bool> errorFound; 4767 List<bool> errorFound;
4660 AnalysisErrorListener_8(this.errorFound); 4768 AnalysisErrorListener_12(this.errorFound);
4661 void onError(AnalysisError error) { 4769 void onError(AnalysisError error) {
4662 errorFound[0] = true; 4770 errorFound[0] = true;
4663 } 4771 }
4664 } 4772 }
4665 /** 4773 /**
4666 * The enumeration {@code ParserErrorCode} defines the error codes used for erro rs detected by the 4774 * The enumeration {@code ParserErrorCode} defines the error codes used for erro rs detected by the
4667 * parser. The convention for this class is for the name of the error code to in dicate the problem 4775 * parser. The convention for this class is for the name of the error code to in dicate the problem
4668 * that caused the error to be generated and for the error message to explain wh at is wrong and, 4776 * that caused the error to be generated and for the error message to explain wh at is wrong and,
4669 * when appropriate, how the problem can be corrected. 4777 * when appropriate, how the problem can be corrected.
4670 * @coverage dart.engine.parser 4778 * @coverage dart.engine.parser
4671 */ 4779 */
4672 class ParserErrorCode implements ErrorCode { 4780 class ParserErrorCode implements Comparable<ParserErrorCode>, ErrorCode {
4673 static final ParserErrorCode ABSTRACT_CLASS_MEMBER = new ParserErrorCode.con2( 'ABSTRACT_CLASS_MEMBER', 0, "Members of classes cannot be declared to be 'abstra ct'"); 4781 static final ParserErrorCode ABSTRACT_CLASS_MEMBER = new ParserErrorCode.con2( 'ABSTRACT_CLASS_MEMBER', 0, "Members of classes cannot be declared to be 'abstra ct'");
4674 static final ParserErrorCode ABSTRACT_STATIC_METHOD = new ParserErrorCode.con2 ('ABSTRACT_STATIC_METHOD', 1, "Static methods cannot be declared to be 'abstract '"); 4782 static final ParserErrorCode ABSTRACT_STATIC_METHOD = new ParserErrorCode.con2 ('ABSTRACT_STATIC_METHOD', 1, "Static methods cannot be declared to be 'abstract '");
4675 static final ParserErrorCode ABSTRACT_TOP_LEVEL_FUNCTION = new ParserErrorCode .con2('ABSTRACT_TOP_LEVEL_FUNCTION', 2, "Top-level functions cannot be declared to be 'abstract'"); 4783 static final ParserErrorCode ABSTRACT_TOP_LEVEL_FUNCTION = new ParserErrorCode .con2('ABSTRACT_TOP_LEVEL_FUNCTION', 2, "Top-level functions cannot be declared to be 'abstract'");
4676 static final ParserErrorCode ABSTRACT_TOP_LEVEL_VARIABLE = new ParserErrorCode .con2('ABSTRACT_TOP_LEVEL_VARIABLE', 3, "Top-level variables cannot be declared to be 'abstract'"); 4784 static final ParserErrorCode ABSTRACT_TOP_LEVEL_VARIABLE = new ParserErrorCode .con2('ABSTRACT_TOP_LEVEL_VARIABLE', 3, "Top-level variables cannot be declared to be 'abstract'");
4677 static final ParserErrorCode ABSTRACT_TYPEDEF = new ParserErrorCode.con2('ABST RACT_TYPEDEF', 4, "Type aliases cannot be declared to be 'abstract'"); 4785 static final ParserErrorCode ABSTRACT_TYPEDEF = new ParserErrorCode.con2('ABST RACT_TYPEDEF', 4, "Type aliases cannot be declared to be 'abstract'");
4678 static final ParserErrorCode BREAK_OUTSIDE_OF_LOOP = new ParserErrorCode.con2( 'BREAK_OUTSIDE_OF_LOOP', 5, "A break statement cannot be used outside of a loop or switch statement"); 4786 static final ParserErrorCode BREAK_OUTSIDE_OF_LOOP = new ParserErrorCode.con2( 'BREAK_OUTSIDE_OF_LOOP', 5, "A break statement cannot be used outside of a loop or switch statement");
4679 static final ParserErrorCode CONST_AND_FINAL = new ParserErrorCode.con2('CONST _AND_FINAL', 6, "Members cannot be declared to be both 'const' and 'final'"); 4787 static final ParserErrorCode CONST_AND_FINAL = new ParserErrorCode.con2('CONST _AND_FINAL', 6, "Members cannot be declared to be both 'const' and 'final'");
4680 static final ParserErrorCode CONST_AND_VAR = new ParserErrorCode.con2('CONST_A ND_VAR', 7, "Members cannot be declared to be both 'const' and 'var'"); 4788 static final ParserErrorCode CONST_AND_VAR = new ParserErrorCode.con2('CONST_A ND_VAR', 7, "Members cannot be declared to be both 'const' and 'var'");
4681 static final ParserErrorCode CONST_CLASS = new ParserErrorCode.con2('CONST_CLA SS', 8, "Classes cannot be declared to be 'const'"); 4789 static final ParserErrorCode CONST_CLASS = new ParserErrorCode.con2('CONST_CLA SS', 8, "Classes cannot be declared to be 'const'");
4682 static final ParserErrorCode CONST_METHOD = new ParserErrorCode.con2('CONST_ME THOD', 9, "Getters, setters and methods cannot be declared to be 'const'"); 4790 static final ParserErrorCode CONST_METHOD = new ParserErrorCode.con2('CONST_ME THOD', 9, "Getters, setters and methods cannot be declared to be 'const'");
4683 static final ParserErrorCode CONST_TYPEDEF = new ParserErrorCode.con2('CONST_T YPEDEF', 10, "Type aliases cannot be declared to be 'const'"); 4791 static final ParserErrorCode CONST_TYPEDEF = new ParserErrorCode.con2('CONST_T YPEDEF', 10, "Type aliases cannot be declared to be 'const'");
4684 static final ParserErrorCode CONSTRUCTOR_WITH_RETURN_TYPE = new ParserErrorCod e.con2('CONSTRUCTOR_WITH_RETURN_TYPE', 11, "Constructors cannot have a return ty pe"); 4792 static final ParserErrorCode CONSTRUCTOR_WITH_RETURN_TYPE = new ParserErrorCod e.con2('CONSTRUCTOR_WITH_RETURN_TYPE', 11, "Constructors cannot have a return ty pe");
4685 static final ParserErrorCode CONTINUE_OUTSIDE_OF_LOOP = new ParserErrorCode.co n2('CONTINUE_OUTSIDE_OF_LOOP', 12, "A continue statement cannot be used outside of a loop or switch statement"); 4793 static final ParserErrorCode CONTINUE_OUTSIDE_OF_LOOP = new ParserErrorCode.co n2('CONTINUE_OUTSIDE_OF_LOOP', 12, "A continue statement cannot be used outside of a loop or switch statement");
4686 static final ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE = new ParserErrorC ode.con2('CONTINUE_WITHOUT_LABEL_IN_CASE', 13, "A continue statement in a switch statement must have a label as a target"); 4794 static final ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE = new ParserErrorC ode.con2('CONTINUE_WITHOUT_LABEL_IN_CASE', 13, "A continue statement in a switch statement must have a label as a target");
4687 static final ParserErrorCode DIRECTIVE_AFTER_DECLARATION = new ParserErrorCode .con2('DIRECTIVE_AFTER_DECLARATION', 14, "Directives must appear before any decl arations"); 4795 static final ParserErrorCode DIRECTIVE_AFTER_DECLARATION = new ParserErrorCode .con2('DIRECTIVE_AFTER_DECLARATION', 14, "Directives must appear before any decl arations");
4688 static final ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT = new ParserE rrorCode.con2('DUPLICATE_LABEL_IN_SWITCH_STATEMENT', 15, "The label %s was alrea dy used in this switch statement"); 4796 static final ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT = new ParserE rrorCode.con2('DUPLICATE_LABEL_IN_SWITCH_STATEMENT', 15, "The label %s was alrea dy used in this switch statement");
4689 static final ParserErrorCode DUPLICATED_MODIFIER = new ParserErrorCode.con2('D UPLICATED_MODIFIER', 16, "The modifier '%s' was already specified."); 4797 static final ParserErrorCode DUPLICATED_MODIFIER = new ParserErrorCode.con2('D UPLICATED_MODIFIER', 16, "The modifier '%s' was already specified.");
4690 static final ParserErrorCode EXPECTED_CASE_OR_DEFAULT = new ParserErrorCode.co n2('EXPECTED_CASE_OR_DEFAULT', 17, "Expected 'case' or 'default'"); 4798 static final ParserErrorCode EXPECTED_CASE_OR_DEFAULT = new ParserErrorCode.co n2('EXPECTED_CASE_OR_DEFAULT', 17, "Expected 'case' or 'default'");
4691 static final ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL = new ParserErrorCod e.con2('EXPECTED_LIST_OR_MAP_LITERAL', 18, "Expected a list or map literal"); 4799 static final ParserErrorCode EXPECTED_CLASS_MEMBER = new ParserErrorCode.con2( 'EXPECTED_CLASS_MEMBER', 18, "Expected a class member");
4692 static final ParserErrorCode EXPECTED_STRING_LITERAL = new ParserErrorCode.con 2('EXPECTED_STRING_LITERAL', 19, "Expected a string literal"); 4800 static final ParserErrorCode EXPECTED_EXECUTABLE = new ParserErrorCode.con2('E XPECTED_EXECUTABLE', 19, "Expected a method, getter, setter or operator declarat ion");
4693 static final ParserErrorCode EXPECTED_TOKEN = new ParserErrorCode.con2('EXPECT ED_TOKEN', 20, "Expected to find '%s'"); 4801 static final ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL = new ParserErrorCod e.con2('EXPECTED_LIST_OR_MAP_LITERAL', 20, "Expected a list or map literal");
4694 static final ParserErrorCode EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new Parse rErrorCode.con2('EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 21, "Export directives must preceed part directives"); 4802 static final ParserErrorCode EXPECTED_STRING_LITERAL = new ParserErrorCode.con 2('EXPECTED_STRING_LITERAL', 21, "Expected a string literal");
4695 static final ParserErrorCode EXTERNAL_AFTER_CONST = new ParserErrorCode.con2(' EXTERNAL_AFTER_CONST', 22, "The modifier 'external' should be before the modifie r 'const'"); 4803 static final ParserErrorCode EXPECTED_TOKEN = new ParserErrorCode.con2('EXPECT ED_TOKEN', 22, "Expected to find '%s'");
4696 static final ParserErrorCode EXTERNAL_AFTER_FACTORY = new ParserErrorCode.con2 ('EXTERNAL_AFTER_FACTORY', 23, "The modifier 'external' should be before the mod ifier 'factory'"); 4804 static final ParserErrorCode EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new Parse rErrorCode.con2('EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 23, "Export directives must preceed part directives");
4697 static final ParserErrorCode EXTERNAL_AFTER_STATIC = new ParserErrorCode.con2( 'EXTERNAL_AFTER_STATIC', 24, "The modifier 'external' should be before the modif ier 'static'"); 4805 static final ParserErrorCode EXTERNAL_AFTER_CONST = new ParserErrorCode.con2(' EXTERNAL_AFTER_CONST', 24, "The modifier 'external' should be before the modifie r 'const'");
4698 static final ParserErrorCode EXTERNAL_CLASS = new ParserErrorCode.con2('EXTERN AL_CLASS', 25, "Classes cannot be declared to be 'external'"); 4806 static final ParserErrorCode EXTERNAL_AFTER_FACTORY = new ParserErrorCode.con2 ('EXTERNAL_AFTER_FACTORY', 25, "The modifier 'external' should be before the mod ifier 'factory'");
4699 static final ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_BODY = new ParserErrorC ode.con2('EXTERNAL_CONSTRUCTOR_WITH_BODY', 26, "External constructors cannot hav e a body"); 4807 static final ParserErrorCode EXTERNAL_AFTER_STATIC = new ParserErrorCode.con2( 'EXTERNAL_AFTER_STATIC', 26, "The modifier 'external' should be before the modif ier 'static'");
4700 static final ParserErrorCode EXTERNAL_FIELD = new ParserErrorCode.con2('EXTERN AL_FIELD', 27, "Fields cannot be declared to be 'external'"); 4808 static final ParserErrorCode EXTERNAL_CLASS = new ParserErrorCode.con2('EXTERN AL_CLASS', 27, "Classes cannot be declared to be 'external'");
4701 static final ParserErrorCode EXTERNAL_GETTER_WITH_BODY = new ParserErrorCode.c on2('EXTERNAL_GETTER_WITH_BODY', 28, "External getters cannot have a body"); 4809 static final ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_BODY = new ParserErrorC ode.con2('EXTERNAL_CONSTRUCTOR_WITH_BODY', 28, "External constructors cannot hav e a body");
4702 static final ParserErrorCode EXTERNAL_METHOD_WITH_BODY = new ParserErrorCode.c on2('EXTERNAL_METHOD_WITH_BODY', 29, "External methods cannot have a body"); 4810 static final ParserErrorCode EXTERNAL_FIELD = new ParserErrorCode.con2('EXTERN AL_FIELD', 29, "Fields cannot be declared to be 'external'");
4703 static final ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY = new ParserErrorCode .con2('EXTERNAL_OPERATOR_WITH_BODY', 30, "External operators cannot have a body" ); 4811 static final ParserErrorCode EXTERNAL_GETTER_WITH_BODY = new ParserErrorCode.c on2('EXTERNAL_GETTER_WITH_BODY', 30, "External getters cannot have a body");
4704 static final ParserErrorCode EXTERNAL_SETTER_WITH_BODY = new ParserErrorCode.c on2('EXTERNAL_SETTER_WITH_BODY', 31, "External setters cannot have a body"); 4812 static final ParserErrorCode EXTERNAL_METHOD_WITH_BODY = new ParserErrorCode.c on2('EXTERNAL_METHOD_WITH_BODY', 31, "External methods cannot have a body");
4705 static final ParserErrorCode EXTERNAL_TYPEDEF = new ParserErrorCode.con2('EXTE RNAL_TYPEDEF', 32, "Type aliases cannot be declared to be 'external'"); 4813 static final ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY = new ParserErrorCode .con2('EXTERNAL_OPERATOR_WITH_BODY', 32, "External operators cannot have a body" );
4706 static final ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION = new ParserErrorCo de.con2('FACTORY_TOP_LEVEL_DECLARATION', 33, "Top-level declarations cannot be d eclared to be 'factory'"); 4814 static final ParserErrorCode EXTERNAL_SETTER_WITH_BODY = new ParserErrorCode.c on2('EXTERNAL_SETTER_WITH_BODY', 33, "External setters cannot have a body");
4707 static final ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new Parse rErrorCode.con2('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 34, "Field initializers can only be used in a constructor"); 4815 static final ParserErrorCode EXTERNAL_TYPEDEF = new ParserErrorCode.con2('EXTE RNAL_TYPEDEF', 34, "Type aliases cannot be declared to be 'external'");
4708 static final ParserErrorCode FINAL_AND_VAR = new ParserErrorCode.con2('FINAL_A ND_VAR', 35, "Members cannot be declared to be both 'final' and 'var'"); 4816 static final ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION = new ParserErrorCo de.con2('FACTORY_TOP_LEVEL_DECLARATION', 35, "Top-level declarations cannot be d eclared to be 'factory'");
4709 static final ParserErrorCode FINAL_CLASS = new ParserErrorCode.con2('FINAL_CLA SS', 36, "Classes cannot be declared to be 'final'"); 4817 static final ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new Parse rErrorCode.con2('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 36, "Field initializers can only be used in a constructor");
4710 static final ParserErrorCode FINAL_CONSTRUCTOR = new ParserErrorCode.con2('FIN AL_CONSTRUCTOR', 37, "A constructor cannot be declared to be 'final'"); 4818 static final ParserErrorCode FINAL_AND_VAR = new ParserErrorCode.con2('FINAL_A ND_VAR', 37, "Members cannot be declared to be both 'final' and 'var'");
4711 static final ParserErrorCode FINAL_METHOD = new ParserErrorCode.con2('FINAL_ME THOD', 38, "Getters, setters and methods cannot be declared to be 'final'"); 4819 static final ParserErrorCode FINAL_CLASS = new ParserErrorCode.con2('FINAL_CLA SS', 38, "Classes cannot be declared to be 'final'");
4712 static final ParserErrorCode FINAL_TYPEDEF = new ParserErrorCode.con2('FINAL_T YPEDEF', 39, "Type aliases cannot be declared to be 'final'"); 4820 static final ParserErrorCode FINAL_CONSTRUCTOR = new ParserErrorCode.con2('FIN AL_CONSTRUCTOR', 39, "A constructor cannot be declared to be 'final'");
4713 static final ParserErrorCode GETTER_WITH_PARAMETERS = new ParserErrorCode.con2 ('GETTER_WITH_PARAMETERS', 40, "Getter should be declared without a parameter li st"); 4821 static final ParserErrorCode FINAL_METHOD = new ParserErrorCode.con2('FINAL_ME THOD', 40, "Getters, setters and methods cannot be declared to be 'final'");
4714 static final ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE = new Parser ErrorCode.con2('ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', 41, "Illegal assignment t o non-assignable expression"); 4822 static final ParserErrorCode FINAL_TYPEDEF = new ParserErrorCode.con2('FINAL_T YPEDEF', 41, "Type aliases cannot be declared to be 'final'");
4715 static final ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS = new ParserErrorCode.c on2('IMPLEMENTS_BEFORE_EXTENDS', 42, "The extends clause must be before the impl ements clause"); 4823 static final ParserErrorCode GETTER_WITH_PARAMETERS = new ParserErrorCode.con2 ('GETTER_WITH_PARAMETERS', 42, "Getter should be declared without a parameter li st");
4716 static final ParserErrorCode IMPLEMENTS_BEFORE_WITH = new ParserErrorCode.con2 ('IMPLEMENTS_BEFORE_WITH', 43, "The with clause must be before the implements cl ause"); 4824 static final ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE = new Parser ErrorCode.con2('ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', 43, "Illegal assignment t o non-assignable expression");
4717 static final ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new Parse rErrorCode.con2('IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 44, "Import directives must preceed part directives"); 4825 static final ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS = new ParserErrorCode.c on2('IMPLEMENTS_BEFORE_EXTENDS', 44, "The extends clause must be before the impl ements clause");
4718 static final ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH = new ParserErro rCode.con2('INITIALIZED_VARIABLE_IN_FOR_EACH', 45, "The loop variable in a for-e ach loop cannot be initialized"); 4826 static final ParserErrorCode IMPLEMENTS_BEFORE_WITH = new ParserErrorCode.con2 ('IMPLEMENTS_BEFORE_WITH', 45, "The with clause must be before the implements cl ause");
4719 static final ParserErrorCode INVALID_CODE_POINT = new ParserErrorCode.con2('IN VALID_CODE_POINT', 46, "The escape sequence '%s' is not a valid code point"); 4827 static final ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new Parse rErrorCode.con2('IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 46, "Import directives must preceed part directives");
4720 static final ParserErrorCode INVALID_COMMENT_REFERENCE = new ParserErrorCode.c on2('INVALID_COMMENT_REFERENCE', 47, "Comment references should contain a possib ly prefixed identifier and can start with 'new', but should not contain anything else"); 4828 static final ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH = new ParserErro rCode.con2('INITIALIZED_VARIABLE_IN_FOR_EACH', 47, "The loop variable in a for-e ach loop cannot be initialized");
4721 static final ParserErrorCode INVALID_HEX_ESCAPE = new ParserErrorCode.con2('IN VALID_HEX_ESCAPE', 48, "An escape sequence starting with '\\x' must be followed by 2 hexidecimal digits"); 4829 static final ParserErrorCode INVALID_CODE_POINT = new ParserErrorCode.con2('IN VALID_CODE_POINT', 48, "The escape sequence '%s' is not a valid code point");
4722 static final ParserErrorCode INVALID_OPERATOR_FOR_SUPER = new ParserErrorCode. con2('INVALID_OPERATOR_FOR_SUPER', 49, "The operator '%s' cannot be used with 's uper'"); 4830 static final ParserErrorCode INVALID_COMMENT_REFERENCE = new ParserErrorCode.c on2('INVALID_COMMENT_REFERENCE', 49, "Comment references should contain a possib ly prefixed identifier and can start with 'new', but should not contain anything else");
4723 static final ParserErrorCode INVALID_UNICODE_ESCAPE = new ParserErrorCode.con2 ('INVALID_UNICODE_ESCAPE', 50, "An escape sequence starting with '\\u' must be f ollowed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'"); 4831 static final ParserErrorCode INVALID_HEX_ESCAPE = new ParserErrorCode.con2('IN VALID_HEX_ESCAPE', 50, "An escape sequence starting with '\\x' must be followed by 2 hexidecimal digits");
4724 static final ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST = new ParserErrorCode .con2('LIBRARY_DIRECTIVE_NOT_FIRST', 51, "The library directive must appear befo re all other directives"); 4832 static final ParserErrorCode INVALID_OPERATOR = new ParserErrorCode.con2('INVA LID_OPERATOR', 51, "The string '%s' is not a valid operator");
4725 static final ParserErrorCode MISSING_ASSIGNABLE_SELECTOR = new ParserErrorCode .con2('MISSING_ASSIGNABLE_SELECTOR', 52, "Missing selector such as \".<identifie r>\" or \"[0]\""); 4833 static final ParserErrorCode INVALID_OPERATOR_FOR_SUPER = new ParserErrorCode. con2('INVALID_OPERATOR_FOR_SUPER', 52, "The operator '%s' cannot be used with 's uper'");
4726 static final ParserErrorCode MISSING_CATCH_OR_FINALLY = new ParserErrorCode.co n2('MISSING_CATCH_OR_FINALLY', 53, "A try statement must have either a catch or finally clause"); 4834 static final ParserErrorCode INVALID_UNICODE_ESCAPE = new ParserErrorCode.con2 ('INVALID_UNICODE_ESCAPE', 53, "An escape sequence starting with '\\u' must be f ollowed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'");
4727 static final ParserErrorCode MISSING_CLASS_BODY = new ParserErrorCode.con2('MI SSING_CLASS_BODY', 54, "A class definition must have a body, even if it is empty "); 4835 static final ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST = new ParserErrorCode .con2('LIBRARY_DIRECTIVE_NOT_FIRST', 54, "The library directive must appear befo re all other directives");
4728 static final ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE = new ParserError Code.con2('MISSING_CONST_FINAL_VAR_OR_TYPE', 55, "Variables must be declared usi ng the keywords 'const', 'final', 'var' or a type name"); 4836 static final ParserErrorCode MISSING_ASSIGNABLE_SELECTOR = new ParserErrorCode .con2('MISSING_ASSIGNABLE_SELECTOR', 55, "Missing selector such as \".<identifie r>\" or \"[0]\"");
4729 static final ParserErrorCode MISSING_EXPRESSION_IN_THROW = new ParserErrorCode .con2('MISSING_EXPRESSION_IN_THROW', 56, "Throw expressions must compute the obj ect to be thrown"); 4837 static final ParserErrorCode MISSING_CATCH_OR_FINALLY = new ParserErrorCode.co n2('MISSING_CATCH_OR_FINALLY', 56, "A try statement must have either a catch or finally clause");
4730 static final ParserErrorCode MISSING_FUNCTION_BODY = new ParserErrorCode.con2( 'MISSING_FUNCTION_BODY', 57, "A function body must be provided"); 4838 static final ParserErrorCode MISSING_CLASS_BODY = new ParserErrorCode.con2('MI SSING_CLASS_BODY', 57, "A class definition must have a body, even if it is empty ");
4731 static final ParserErrorCode MISSING_FUNCTION_PARAMETERS = new ParserErrorCode .con2('MISSING_FUNCTION_PARAMETERS', 58, "Functions must have an explicit list o f parameters"); 4839 static final ParserErrorCode MISSING_CLOSING_PARENTHESIS = new ParserErrorCode .con2('MISSING_CLOSING_PARENTHESIS', 58, "The closing parenthesis is missing");
4732 static final ParserErrorCode MISSING_IDENTIFIER = new ParserErrorCode.con2('MI SSING_IDENTIFIER', 59, "Expected an identifier"); 4840 static final ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE = new ParserError Code.con2('MISSING_CONST_FINAL_VAR_OR_TYPE', 59, "Variables must be declared usi ng the keywords 'const', 'final', 'var' or a type name");
4733 static final ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE = new ParserErr orCode.con2('MISSING_NAME_IN_LIBRARY_DIRECTIVE', 60, "Library directives must in clude a library name"); 4841 static final ParserErrorCode MISSING_EXPRESSION_IN_THROW = new ParserErrorCode .con2('MISSING_EXPRESSION_IN_THROW', 60, "Throw expressions must compute the obj ect to be thrown");
4734 static final ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE = new ParserErr orCode.con2('MISSING_NAME_IN_PART_OF_DIRECTIVE', 61, "Library directives must in clude a library name"); 4842 static final ParserErrorCode MISSING_FUNCTION_BODY = new ParserErrorCode.con2( 'MISSING_FUNCTION_BODY', 61, "A function body must be provided");
4735 static final ParserErrorCode MISSING_STATEMENT = new ParserErrorCode.con2('MIS SING_STATEMENT', 62, "Expected a statement"); 4843 static final ParserErrorCode MISSING_FUNCTION_PARAMETERS = new ParserErrorCode .con2('MISSING_FUNCTION_PARAMETERS', 62, "Functions must have an explicit list o f parameters");
4736 static final ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP = new Pars erErrorCode.con2('MISSING_TERMINATOR_FOR_PARAMETER_GROUP', 63, "There is no '%s' to close the parameter group"); 4844 static final ParserErrorCode MISSING_IDENTIFIER = new ParserErrorCode.con2('MI SSING_IDENTIFIER', 63, "Expected an identifier");
4737 static final ParserErrorCode MISSING_TYPEDEF_PARAMETERS = new ParserErrorCode. con2('MISSING_TYPEDEF_PARAMETERS', 64, "Type aliases for functions must have an explicit list of parameters"); 4845 static final ParserErrorCode MISSING_KEYWORD_OPERATOR = new ParserErrorCode.co n2('MISSING_KEYWORD_OPERATOR', 64, "Operator declarations must be preceeded by t he keyword 'operator'");
4738 static final ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = new ParserErrorCod e.con2('MISSING_VARIABLE_IN_FOR_EACH', 65, "A loop variable must be declared in a for-each loop before the 'in', but none were found"); 4846 static final ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE = new ParserErr orCode.con2('MISSING_NAME_IN_LIBRARY_DIRECTIVE', 65, "Library directives must in clude a library name");
4739 static final ParserErrorCode MIXED_PARAMETER_GROUPS = new ParserErrorCode.con2 ('MIXED_PARAMETER_GROUPS', 66, "Cannot have both positional and named parameters in a single parameter list"); 4847 static final ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE = new ParserErr orCode.con2('MISSING_NAME_IN_PART_OF_DIRECTIVE', 66, "Library directives must in clude a library name");
4740 static final ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = new ParserErrorCode.co n2('MULTIPLE_EXTENDS_CLAUSES', 67, "Each class definition can have at most one e xtends clause"); 4848 static final ParserErrorCode MISSING_STATEMENT = new ParserErrorCode.con2('MIS SING_STATEMENT', 67, "Expected a statement");
4741 static final ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = new ParserErrorCode .con2('MULTIPLE_IMPLEMENTS_CLAUSES', 68, "Each class definition can have at most one implements clause"); 4849 static final ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP = new Pars erErrorCode.con2('MISSING_TERMINATOR_FOR_PARAMETER_GROUP', 68, "There is no '%s' to close the parameter group");
4742 static final ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES = new ParserErrorCode .con2('MULTIPLE_LIBRARY_DIRECTIVES', 69, "Only one library directive may be decl ared in a file"); 4850 static final ParserErrorCode MISSING_TYPEDEF_PARAMETERS = new ParserErrorCode. con2('MISSING_TYPEDEF_PARAMETERS', 69, "Type aliases for functions must have an explicit list of parameters");
4743 static final ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS = new ParserError Code.con2('MULTIPLE_NAMED_PARAMETER_GROUPS', 70, "Cannot have multiple groups of named parameters in a single parameter list"); 4851 static final ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = new ParserErrorCod e.con2('MISSING_VARIABLE_IN_FOR_EACH', 70, "A loop variable must be declared in a for-each loop before the 'in', but none were found");
4744 static final ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES = new ParserErrorCode .con2('MULTIPLE_PART_OF_DIRECTIVES', 71, "Only one part-of directive may be decl ared in a file"); 4852 static final ParserErrorCode MIXED_PARAMETER_GROUPS = new ParserErrorCode.con2 ('MIXED_PARAMETER_GROUPS', 71, "Cannot have both positional and named parameters in a single parameter list");
4745 static final ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS = new Parser ErrorCode.con2('MULTIPLE_POSITIONAL_PARAMETER_GROUPS', 72, "Cannot have multiple groups of positional parameters in a single parameter list"); 4853 static final ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = new ParserErrorCode.co n2('MULTIPLE_EXTENDS_CLAUSES', 72, "Each class definition can have at most one e xtends clause");
4746 static final ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH = new ParserErrorC ode.con2('MULTIPLE_VARIABLES_IN_FOR_EACH', 73, "A single loop variable must be d eclared in a for-each loop before the 'in', but %s were found"); 4854 static final ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = new ParserErrorCode .con2('MULTIPLE_IMPLEMENTS_CLAUSES', 73, "Each class definition can have at most one implements clause");
4747 static final ParserErrorCode MULTIPLE_WITH_CLAUSES = new ParserErrorCode.con2( 'MULTIPLE_WITH_CLAUSES', 74, "Each class definition can have at most one with cl ause"); 4855 static final ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES = new ParserErrorCode .con2('MULTIPLE_LIBRARY_DIRECTIVES', 74, "Only one library directive may be decl ared in a file");
4748 static final ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = new ParserErrorCo de.con2('NAMED_PARAMETER_OUTSIDE_GROUP', 75, "Named parameters must be enclosed in curly braces ('{' and '}')"); 4856 static final ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS = new ParserError Code.con2('MULTIPLE_NAMED_PARAMETER_GROUPS', 75, "Cannot have multiple groups of named parameters in a single parameter list");
4749 static final ParserErrorCode NON_CONSTRUCTOR_FACTORY = new ParserErrorCode.con 2('NON_CONSTRUCTOR_FACTORY', 76, "Only constructors can be declared to be a 'fac tory'"); 4857 static final ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES = new ParserErrorCode .con2('MULTIPLE_PART_OF_DIRECTIVES', 76, "Only one part-of directive may be decl ared in a file");
4750 static final ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = new ParserErrorCode .con2('NON_IDENTIFIER_LIBRARY_NAME', 77, "The name of a library must be an ident ifier"); 4858 static final ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS = new Parser ErrorCode.con2('MULTIPLE_POSITIONAL_PARAMETER_GROUPS', 77, "Cannot have multiple groups of positional parameters in a single parameter list");
4751 static final ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = new ParserErrorCo de.con2('NON_PART_OF_DIRECTIVE_IN_PART', 78, "The part-of directive must be the only directive in a part"); 4859 static final ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH = new ParserErrorC ode.con2('MULTIPLE_VARIABLES_IN_FOR_EACH', 78, "A single loop variable must be d eclared in a for-each loop before the 'in', but %s were found");
4752 static final ParserErrorCode NON_USER_DEFINABLE_OPERATOR = new ParserErrorCode .con2('NON_USER_DEFINABLE_OPERATOR', 79, "The operator '%s' is not user definabl e"); 4860 static final ParserErrorCode MULTIPLE_WITH_CLAUSES = new ParserErrorCode.con2( 'MULTIPLE_WITH_CLAUSES', 79, "Each class definition can have at most one with cl ause");
4753 static final ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = new ParserError Code.con2('POSITIONAL_AFTER_NAMED_ARGUMENT', 80, "Positional arguments must occu r before named arguments"); 4861 static final ParserErrorCode NAMED_FUNCTION_EXPRESSION = new ParserErrorCode.c on2('NAMED_FUNCTION_EXPRESSION', 80, "Function expressions cannot be named");
4754 static final ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = new ParserEr rorCode.con2('POSITIONAL_PARAMETER_OUTSIDE_GROUP', 81, "Positional parameters mu st be enclosed in square brackets ('[' and ']')"); 4862 static final ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = new ParserErrorCo de.con2('NAMED_PARAMETER_OUTSIDE_GROUP', 81, "Named parameters must be enclosed in curly braces ('{' and '}')");
4755 static final ParserErrorCode STATIC_AFTER_CONST = new ParserErrorCode.con2('ST ATIC_AFTER_CONST', 82, "The modifier 'static' should be before the modifier 'con st'"); 4863 static final ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = new Parser ErrorCode.con2('NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', 82, "Native functions can only be declared in the SDK and code that is loaded through native extensions") ;
4756 static final ParserErrorCode STATIC_AFTER_FINAL = new ParserErrorCode.con2('ST ATIC_AFTER_FINAL', 83, "The modifier 'static' should be before the modifier 'fin al'"); 4864 static final ParserErrorCode NON_CONSTRUCTOR_FACTORY = new ParserErrorCode.con 2('NON_CONSTRUCTOR_FACTORY', 83, "Only constructors can be declared to be a 'fac tory'");
4757 static final ParserErrorCode STATIC_AFTER_VAR = new ParserErrorCode.con2('STAT IC_AFTER_VAR', 84, "The modifier 'static' should be before the modifier 'var'"); 4865 static final ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = new ParserErrorCode .con2('NON_IDENTIFIER_LIBRARY_NAME', 84, "The name of a library must be an ident ifier");
4758 static final ParserErrorCode STATIC_CONSTRUCTOR = new ParserErrorCode.con2('ST ATIC_CONSTRUCTOR', 85, "Constructors cannot be static"); 4866 static final ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = new ParserErrorCo de.con2('NON_PART_OF_DIRECTIVE_IN_PART', 85, "The part-of directive must be the only directive in a part");
4759 static final ParserErrorCode STATIC_OPERATOR = new ParserErrorCode.con2('STATI C_OPERATOR', 86, "Operators cannot be static"); 4867 static final ParserErrorCode NON_USER_DEFINABLE_OPERATOR = new ParserErrorCode .con2('NON_USER_DEFINABLE_OPERATOR', 86, "The operator '%s' is not user definabl e");
4760 static final ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = new ParserErrorCod e.con2('STATIC_TOP_LEVEL_DECLARATION', 87, "Top-level declarations cannot be dec lared to be 'static'"); 4868 static final ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = new ParserError Code.con2('POSITIONAL_AFTER_NAMED_ARGUMENT', 87, "Positional arguments must occu r before named arguments");
4761 static final ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = new P arserErrorCode.con2('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', 88, "There is n o '%s' to open a parameter group"); 4869 static final ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = new ParserEr rorCode.con2('POSITIONAL_PARAMETER_OUTSIDE_GROUP', 88, "Positional parameters mu st be enclosed in square brackets ('[' and ']')");
4762 static final ParserErrorCode UNEXPECTED_TOKEN = new ParserErrorCode.con2('UNEX PECTED_TOKEN', 89, "Unexpected token '%s'"); 4870 static final ParserErrorCode STATIC_AFTER_CONST = new ParserErrorCode.con2('ST ATIC_AFTER_CONST', 89, "The modifier 'static' should be before the modifier 'con st'");
4763 static final ParserErrorCode USE_OF_UNARY_PLUS_OPERATOR = new ParserErrorCode. con2('USE_OF_UNARY_PLUS_OPERATOR', 90, "There is no unary plus operator in Dart" ); 4871 static final ParserErrorCode STATIC_AFTER_FINAL = new ParserErrorCode.con2('ST ATIC_AFTER_FINAL', 90, "The modifier 'static' should be before the modifier 'fin al'");
4764 static final ParserErrorCode WITH_BEFORE_EXTENDS = new ParserErrorCode.con2('W ITH_BEFORE_EXTENDS', 91, "The extends clause must be before the with clause"); 4872 static final ParserErrorCode STATIC_AFTER_VAR = new ParserErrorCode.con2('STAT IC_AFTER_VAR', 91, "The modifier 'static' should be before the modifier 'var'");
4765 static final ParserErrorCode WITH_WITHOUT_EXTENDS = new ParserErrorCode.con2(' WITH_WITHOUT_EXTENDS', 92, "The with clause cannot be used without an extends cl ause"); 4873 static final ParserErrorCode STATIC_CONSTRUCTOR = new ParserErrorCode.con2('ST ATIC_CONSTRUCTOR', 92, "Constructors cannot be static");
4766 static final ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = new ParserE rrorCode.con2('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', 93, "The default value of a named parameter should be preceeded by ':'"); 4874 static final ParserErrorCode STATIC_OPERATOR = new ParserErrorCode.con2('STATI C_OPERATOR', 93, "Operators cannot be static");
4767 static final ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = new Pa rserErrorCode.con2('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', 94, "The default value of a positional parameter should be preceeded by '='"); 4875 static final ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = new ParserErrorCod e.con2('STATIC_TOP_LEVEL_DECLARATION', 94, "Top-level declarations cannot be dec lared to be 'static'");
4768 static final ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = new Parser ErrorCode.con2('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', 95, "Expected '%s' to clo se parameter group"); 4876 static final ParserErrorCode TOP_LEVEL_OPERATOR = new ParserErrorCode.con2('TO P_LEVEL_OPERATOR', 95, "Operators must be declared within a class");
4769 static final ParserErrorCode VAR_CLASS = new ParserErrorCode.con2('VAR_CLASS', 96, "Classes cannot be declared to be 'var'"); 4877 static final ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = new P arserErrorCode.con2('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', 96, "There is n o '%s' to open a parameter group");
4770 static final ParserErrorCode VAR_RETURN_TYPE = new ParserErrorCode.con2('VAR_R ETURN_TYPE', 97, "The return type cannot be 'var'"); 4878 static final ParserErrorCode UNEXPECTED_TOKEN = new ParserErrorCode.con2('UNEX PECTED_TOKEN', 97, "Unexpected token '%s'");
4771 static final ParserErrorCode VAR_TYPEDEF = new ParserErrorCode.con2('VAR_TYPED EF', 98, "Type aliases cannot be declared to be 'var'"); 4879 static final ParserErrorCode USE_OF_UNARY_PLUS_OPERATOR = new ParserErrorCode. con2('USE_OF_UNARY_PLUS_OPERATOR', 98, "There is no unary plus operator in Dart" );
4772 static final ParserErrorCode VOID_PARAMETER = new ParserErrorCode.con2('VOID_P ARAMETER', 99, "Parameters cannot have a type of 'void'"); 4880 static final ParserErrorCode WITH_BEFORE_EXTENDS = new ParserErrorCode.con2('W ITH_BEFORE_EXTENDS', 99, "The extends clause must be before the with clause");
4773 static final ParserErrorCode VOID_VARIABLE = new ParserErrorCode.con2('VOID_VA RIABLE', 100, "Variables cannot have a type of 'void'"); 4881 static final ParserErrorCode WITH_WITHOUT_EXTENDS = new ParserErrorCode.con2(' WITH_WITHOUT_EXTENDS', 100, "The with clause cannot be used without an extends c lause");
4774 static final List<ParserErrorCode> values = [ABSTRACT_CLASS_MEMBER, ABSTRACT_S TATIC_METHOD, ABSTRACT_TOP_LEVEL_FUNCTION, ABSTRACT_TOP_LEVEL_VARIABLE, ABSTRACT _TYPEDEF, BREAK_OUTSIDE_OF_LOOP, CONST_AND_FINAL, CONST_AND_VAR, CONST_CLASS, CO NST_METHOD, CONST_TYPEDEF, CONSTRUCTOR_WITH_RETURN_TYPE, CONTINUE_OUTSIDE_OF_LOO P, CONTINUE_WITHOUT_LABEL_IN_CASE, DIRECTIVE_AFTER_DECLARATION, DUPLICATE_LABEL_ IN_SWITCH_STATEMENT, DUPLICATED_MODIFIER, EXPECTED_CASE_OR_DEFAULT, EXPECTED_LIS T_OR_MAP_LITERAL, EXPECTED_STRING_LITERAL, EXPECTED_TOKEN, EXPORT_DIRECTIVE_AFTE R_PART_DIRECTIVE, EXTERNAL_AFTER_CONST, EXTERNAL_AFTER_FACTORY, EXTERNAL_AFTER_S TATIC, EXTERNAL_CLASS, EXTERNAL_CONSTRUCTOR_WITH_BODY, EXTERNAL_FIELD, EXTERNAL_ GETTER_WITH_BODY, EXTERNAL_METHOD_WITH_BODY, EXTERNAL_OPERATOR_WITH_BODY, EXTERN AL_SETTER_WITH_BODY, EXTERNAL_TYPEDEF, FACTORY_TOP_LEVEL_DECLARATION, FIELD_INIT IALIZER_OUTSIDE_CONSTRUCTOR, FINAL_AND_VAR, FINAL_CLASS, FINAL_CONSTRUCTOR, FINA L_METHOD, FINAL_TYPEDEF, GETTER_WITH_PARAMETERS, ILLEGAL_ASSIGNMENT_TO_NON_ASSIG NABLE, IMPLEMENTS_BEFORE_EXTENDS, IMPLEMENTS_BEFORE_WITH, IMPORT_DIRECTIVE_AFTER _PART_DIRECTIVE, INITIALIZED_VARIABLE_IN_FOR_EACH, INVALID_CODE_POINT, INVALID_C OMMENT_REFERENCE, INVALID_HEX_ESCAPE, INVALID_OPERATOR_FOR_SUPER, INVALID_UNICOD E_ESCAPE, LIBRARY_DIRECTIVE_NOT_FIRST, MISSING_ASSIGNABLE_SELECTOR, MISSING_CATC H_OR_FINALLY, MISSING_CLASS_BODY, MISSING_CONST_FINAL_VAR_OR_TYPE, MISSING_EXPRE SSION_IN_THROW, MISSING_FUNCTION_BODY, MISSING_FUNCTION_PARAMETERS, MISSING_IDEN TIFIER, MISSING_NAME_IN_LIBRARY_DIRECTIVE, MISSING_NAME_IN_PART_OF_DIRECTIVE, MI SSING_STATEMENT, MISSING_TERMINATOR_FOR_PARAMETER_GROUP, MISSING_TYPEDEF_PARAMET ERS, MISSING_VARIABLE_IN_FOR_EACH, MIXED_PARAMETER_GROUPS, MULTIPLE_EXTENDS_CLAU SES, MULTIPLE_IMPLEMENTS_CLAUSES, MULTIPLE_LIBRARY_DIRECTIVES, MULTIPLE_NAMED_PA RAMETER_GROUPS, MULTIPLE_PART_OF_DIRECTIVES, MULTIPLE_POSITIONAL_PARAMETER_GROUP S, MULTIPLE_VARIABLES_IN_FOR_EACH, MULTIPLE_WITH_CLAUSES, NAMED_PARAMETER_OUTSID E_GROUP, NON_CONSTRUCTOR_FACTORY, NON_IDENTIFIER_LIBRARY_NAME, NON_PART_OF_DIREC TIVE_IN_PART, NON_USER_DEFINABLE_OPERATOR, POSITIONAL_AFTER_NAMED_ARGUMENT, POSI TIONAL_PARAMETER_OUTSIDE_GROUP, STATIC_AFTER_CONST, STATIC_AFTER_FINAL, STATIC_A FTER_VAR, STATIC_CONSTRUCTOR, STATIC_OPERATOR, STATIC_TOP_LEVEL_DECLARATION, UNE XPECTED_TERMINATOR_FOR_PARAMETER_GROUP, UNEXPECTED_TOKEN, USE_OF_UNARY_PLUS_OPER ATOR, WITH_BEFORE_EXTENDS, WITH_WITHOUT_EXTENDS, WRONG_SEPARATOR_FOR_NAMED_PARAM ETER, WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER, WRONG_TERMINATOR_FOR_PARAMETER_G ROUP, VAR_CLASS, VAR_RETURN_TYPE, VAR_TYPEDEF, VOID_PARAMETER, VOID_VARIABLE]; 4882 static final ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = new ParserE rrorCode.con2('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', 101, "The default value of a named parameter should be preceeded by ':'");
4883 static final ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = new Pa rserErrorCode.con2('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', 102, "The default value of a positional parameter should be preceeded by '='");
4884 static final ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = new Parser ErrorCode.con2('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', 103, "Expected '%s' to cl ose parameter group");
4885 static final ParserErrorCode VAR_CLASS = new ParserErrorCode.con2('VAR_CLASS', 104, "Classes cannot be declared to be 'var'");
4886 static final ParserErrorCode VAR_RETURN_TYPE = new ParserErrorCode.con2('VAR_R ETURN_TYPE', 105, "The return type cannot be 'var'");
4887 static final ParserErrorCode VAR_TYPEDEF = new ParserErrorCode.con2('VAR_TYPED EF', 106, "Type aliases cannot be declared to be 'var'");
4888 static final ParserErrorCode VOID_PARAMETER = new ParserErrorCode.con2('VOID_P ARAMETER', 107, "Parameters cannot have a type of 'void'");
4889 static final ParserErrorCode VOID_VARIABLE = new ParserErrorCode.con2('VOID_VA RIABLE', 108, "Variables cannot have a type of 'void'");
4890 static final List<ParserErrorCode> values = [ABSTRACT_CLASS_MEMBER, ABSTRACT_S TATIC_METHOD, ABSTRACT_TOP_LEVEL_FUNCTION, ABSTRACT_TOP_LEVEL_VARIABLE, ABSTRACT _TYPEDEF, BREAK_OUTSIDE_OF_LOOP, CONST_AND_FINAL, CONST_AND_VAR, CONST_CLASS, CO NST_METHOD, CONST_TYPEDEF, CONSTRUCTOR_WITH_RETURN_TYPE, CONTINUE_OUTSIDE_OF_LOO P, CONTINUE_WITHOUT_LABEL_IN_CASE, DIRECTIVE_AFTER_DECLARATION, DUPLICATE_LABEL_ IN_SWITCH_STATEMENT, DUPLICATED_MODIFIER, EXPECTED_CASE_OR_DEFAULT, EXPECTED_CLA SS_MEMBER, EXPECTED_EXECUTABLE, EXPECTED_LIST_OR_MAP_LITERAL, EXPECTED_STRING_LI TERAL, EXPECTED_TOKEN, EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, EXTERNAL_AFTER_CON ST, EXTERNAL_AFTER_FACTORY, EXTERNAL_AFTER_STATIC, EXTERNAL_CLASS, EXTERNAL_CONS TRUCTOR_WITH_BODY, EXTERNAL_FIELD, EXTERNAL_GETTER_WITH_BODY, EXTERNAL_METHOD_WI TH_BODY, EXTERNAL_OPERATOR_WITH_BODY, EXTERNAL_SETTER_WITH_BODY, EXTERNAL_TYPEDE F, FACTORY_TOP_LEVEL_DECLARATION, FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, FINAL_A ND_VAR, FINAL_CLASS, FINAL_CONSTRUCTOR, FINAL_METHOD, FINAL_TYPEDEF, GETTER_WITH _PARAMETERS, ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, IMPLEMENTS_BEFORE_EXTENDS, IM PLEMENTS_BEFORE_WITH, IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, INITIALIZED_VARIABL E_IN_FOR_EACH, INVALID_CODE_POINT, INVALID_COMMENT_REFERENCE, INVALID_HEX_ESCAPE , INVALID_OPERATOR, INVALID_OPERATOR_FOR_SUPER, INVALID_UNICODE_ESCAPE, LIBRARY_ DIRECTIVE_NOT_FIRST, MISSING_ASSIGNABLE_SELECTOR, MISSING_CATCH_OR_FINALLY, MISS ING_CLASS_BODY, MISSING_CLOSING_PARENTHESIS, MISSING_CONST_FINAL_VAR_OR_TYPE, MI SSING_EXPRESSION_IN_THROW, MISSING_FUNCTION_BODY, MISSING_FUNCTION_PARAMETERS, M ISSING_IDENTIFIER, MISSING_KEYWORD_OPERATOR, MISSING_NAME_IN_LIBRARY_DIRECTIVE, MISSING_NAME_IN_PART_OF_DIRECTIVE, MISSING_STATEMENT, MISSING_TERMINATOR_FOR_PAR AMETER_GROUP, MISSING_TYPEDEF_PARAMETERS, MISSING_VARIABLE_IN_FOR_EACH, MIXED_PA RAMETER_GROUPS, MULTIPLE_EXTENDS_CLAUSES, MULTIPLE_IMPLEMENTS_CLAUSES, MULTIPLE_ LIBRARY_DIRECTIVES, MULTIPLE_NAMED_PARAMETER_GROUPS, MULTIPLE_PART_OF_DIRECTIVES , MULTIPLE_POSITIONAL_PARAMETER_GROUPS, MULTIPLE_VARIABLES_IN_FOR_EACH, MULTIPLE _WITH_CLAUSES, NAMED_FUNCTION_EXPRESSION, NAMED_PARAMETER_OUTSIDE_GROUP, NATIVE_ FUNCTION_BODY_IN_NON_SDK_CODE, NON_CONSTRUCTOR_FACTORY, NON_IDENTIFIER_LIBRARY_N AME, NON_PART_OF_DIRECTIVE_IN_PART, NON_USER_DEFINABLE_OPERATOR, POSITIONAL_AFTE R_NAMED_ARGUMENT, POSITIONAL_PARAMETER_OUTSIDE_GROUP, STATIC_AFTER_CONST, STATIC _AFTER_FINAL, STATIC_AFTER_VAR, STATIC_CONSTRUCTOR, STATIC_OPERATOR, STATIC_TOP_ LEVEL_DECLARATION, TOP_LEVEL_OPERATOR, UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP , UNEXPECTED_TOKEN, USE_OF_UNARY_PLUS_OPERATOR, WITH_BEFORE_EXTENDS, WITH_WITHOU T_EXTENDS, WRONG_SEPARATOR_FOR_NAMED_PARAMETER, WRONG_SEPARATOR_FOR_POSITIONAL_P ARAMETER, WRONG_TERMINATOR_FOR_PARAMETER_GROUP, VAR_CLASS, VAR_RETURN_TYPE, VAR_ TYPEDEF, VOID_PARAMETER, VOID_VARIABLE];
4775 String __name; 4891 String __name;
4776 int __ordinal = 0; 4892 int __ordinal = 0;
4777 int get ordinal => __ordinal; 4893 int get ordinal => __ordinal;
4778 /** 4894 /**
4779 * The severity of this error. 4895 * The severity of this error.
4780 */ 4896 */
4781 ErrorSeverity _severity; 4897 ErrorSeverity _severity;
4782 /** 4898 /**
4783 * The message template used to create the message to be displayed for this er ror. 4899 * The message template used to create the message to be displayed for this er ror.
4784 */ 4900 */
4785 String _message; 4901 String _message;
4786 /** 4902 /**
4787 * Initialize a newly created error code to have the given severity and messag e. 4903 * Initialize a newly created error code to have the given severity and messag e.
4788 * @param severity the severity of the error 4904 * @param severity the severity of the error
4789 * @param message the message template used to create the message to be displa yed for the error 4905 * @param message the message template used to create the message to be displa yed for the error
4790 */ 4906 */
4791 ParserErrorCode.con1(String ___name, int ___ordinal, ErrorSeverity severity2, String message2) { 4907 ParserErrorCode.con1(String ___name, int ___ordinal, ErrorSeverity severity2, String message2) {
4792 _jtd_constructor_275_impl(___name, ___ordinal, severity2, message2); 4908 _jtd_constructor_301_impl(___name, ___ordinal, severity2, message2);
4793 } 4909 }
4794 _jtd_constructor_275_impl(String ___name, int ___ordinal, ErrorSeverity severi ty2, String message2) { 4910 _jtd_constructor_301_impl(String ___name, int ___ordinal, ErrorSeverity severi ty2, String message2) {
4795 __name = ___name; 4911 __name = ___name;
4796 __ordinal = ___ordinal; 4912 __ordinal = ___ordinal;
4797 this._severity = severity2; 4913 this._severity = severity2;
4798 this._message = message2; 4914 this._message = message2;
4799 } 4915 }
4800 /** 4916 /**
4801 * Initialize a newly created error code to have the given message and a sever ity of ERROR. 4917 * Initialize a newly created error code to have the given message and a sever ity of ERROR.
4802 * @param message the message template used to create the message to be displa yed for the error 4918 * @param message the message template used to create the message to be displa yed for the error
4803 */ 4919 */
4804 ParserErrorCode.con2(String ___name, int ___ordinal, String message) { 4920 ParserErrorCode.con2(String ___name, int ___ordinal, String message) {
4805 _jtd_constructor_276_impl(___name, ___ordinal, message); 4921 _jtd_constructor_302_impl(___name, ___ordinal, message);
4806 } 4922 }
4807 _jtd_constructor_276_impl(String ___name, int ___ordinal, String message) { 4923 _jtd_constructor_302_impl(String ___name, int ___ordinal, String message) {
4808 _jtd_constructor_275_impl(___name, ___ordinal, ErrorSeverity.ERROR, message) ; 4924 _jtd_constructor_301_impl(___name, ___ordinal, ErrorSeverity.ERROR, message) ;
4809 } 4925 }
4810 ErrorSeverity get errorSeverity => _severity; 4926 ErrorSeverity get errorSeverity => _severity;
4811 String get message => _message; 4927 String get message => _message;
4812 ErrorType get type => ErrorType.SYNTACTIC_ERROR; 4928 ErrorType get type => ErrorType.SYNTACTIC_ERROR;
4813 bool needsRecompilation() => true; 4929 bool needsRecompilation() => true;
4930 int compareTo(ParserErrorCode other) => __ordinal - other.__ordinal;
4814 String toString() => __name; 4931 String toString() => __name;
4815 } 4932 }
4816 /** 4933 /**
4817 * Instances of the class {link ToFormattedSourceVisitor} write a source represe ntation of a visited 4934 * Instances of the class {link ToFormattedSourceVisitor} write a source represe ntation of a visited
4818 * AST node (and all of it's children) to a writer. 4935 * AST node (and all of it's children) to a writer.
4819 */ 4936 */
4820 class ToFormattedSourceVisitor implements ASTVisitor<Object> { 4937 class ToFormattedSourceVisitor implements ASTVisitor<Object> {
4821 /** 4938 /**
4822 * The writer to which the source is to be written. 4939 * The writer to which the source is to be written.
4823 */ 4940 */
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
4977 } 5094 }
4978 if (identical(token, node.endToken)) { 5095 if (identical(token, node.endToken)) {
4979 break; 5096 break;
4980 } 5097 }
4981 } 5098 }
4982 return null; 5099 return null;
4983 } 5100 }
4984 Object visitCommentReference(CommentReference node) => null; 5101 Object visitCommentReference(CommentReference node) => null;
4985 Object visitCompilationUnit(CompilationUnit node) { 5102 Object visitCompilationUnit(CompilationUnit node) {
4986 ScriptTag scriptTag7 = node.scriptTag; 5103 ScriptTag scriptTag7 = node.scriptTag;
4987 NodeList<Directive> directives4 = node.directives; 5104 NodeList<Directive> directives5 = node.directives;
4988 visit(scriptTag7); 5105 visit(scriptTag7);
4989 String prefix = scriptTag7 == null ? "" : " "; 5106 String prefix = scriptTag7 == null ? "" : " ";
4990 visitList7(prefix, directives4, "\n"); 5107 visitList7(prefix, directives5, "\n");
4991 prefix = scriptTag7 == null && directives4.isEmpty ? "" : "\n\n"; 5108 prefix = scriptTag7 == null && directives5.isEmpty ? "" : "\n\n";
4992 visitList7(prefix, node.declarations, "\n"); 5109 visitList7(prefix, node.declarations, "\n");
4993 return null; 5110 return null;
4994 } 5111 }
4995 Object visitConditionalExpression(ConditionalExpression node) { 5112 Object visitConditionalExpression(ConditionalExpression node) {
4996 visit(node.condition); 5113 visit(node.condition);
4997 _writer.print(" ? "); 5114 _writer.print(" ? ");
4998 visit(node.thenExpression); 5115 visit(node.thenExpression);
4999 _writer.print(" : "); 5116 _writer.print(" : ");
5000 visit(node.elseExpression); 5117 visit(node.elseExpression);
5001 return null; 5118 return null;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
5113 visit(node.loopVariable); 5230 visit(node.loopVariable);
5114 _writer.print(" in "); 5231 _writer.print(" in ");
5115 visit(node.iterator); 5232 visit(node.iterator);
5116 _writer.print(") "); 5233 _writer.print(") ");
5117 visit(node.body); 5234 visit(node.body);
5118 return null; 5235 return null;
5119 } 5236 }
5120 Object visitFormalParameterList(FormalParameterList node) { 5237 Object visitFormalParameterList(FormalParameterList node) {
5121 String groupEnd = null; 5238 String groupEnd = null;
5122 _writer.print('('); 5239 _writer.print('(');
5123 NodeList<FormalParameter> parameters14 = node.parameters; 5240 NodeList<FormalParameter> parameters16 = node.parameters;
5124 int size7 = parameters14.length; 5241 int size8 = parameters16.length;
5125 for (int i = 0; i < size7; i++) { 5242 for (int i = 0; i < size8; i++) {
5126 FormalParameter parameter = parameters14[i]; 5243 FormalParameter parameter = parameters16[i];
5127 if (i > 0) { 5244 if (i > 0) {
5128 _writer.print(", "); 5245 _writer.print(", ");
5129 } 5246 }
5130 if (groupEnd == null && parameter is DefaultFormalParameter) { 5247 if (groupEnd == null && parameter is DefaultFormalParameter) {
5131 if (identical(parameter.kind, ParameterKind.NAMED)) { 5248 if (identical(parameter.kind, ParameterKind.NAMED)) {
5132 groupEnd = "}"; 5249 groupEnd = "}";
5133 _writer.print('{'); 5250 _writer.print('{');
5134 } else { 5251 } else {
5135 groupEnd = "]"; 5252 groupEnd = "]";
5136 _writer.print('['); 5253 _writer.print('[');
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
5344 } 5461 }
5345 visit(node.methodName); 5462 visit(node.methodName);
5346 visit(node.argumentList); 5463 visit(node.argumentList);
5347 return null; 5464 return null;
5348 } 5465 }
5349 Object visitNamedExpression(NamedExpression node) { 5466 Object visitNamedExpression(NamedExpression node) {
5350 visit(node.name); 5467 visit(node.name);
5351 visit7(" ", node.expression); 5468 visit7(" ", node.expression);
5352 return null; 5469 return null;
5353 } 5470 }
5471 Object visitNativeFunctionBody(NativeFunctionBody node) {
5472 _writer.print("native ");
5473 visit(node.stringLiteral);
5474 _writer.print(';');
5475 return null;
5476 }
5354 Object visitNullLiteral(NullLiteral node) { 5477 Object visitNullLiteral(NullLiteral node) {
5355 _writer.print("null"); 5478 _writer.print("null");
5356 return null; 5479 return null;
5357 } 5480 }
5358 Object visitParenthesizedExpression(ParenthesizedExpression node) { 5481 Object visitParenthesizedExpression(ParenthesizedExpression node) {
5359 _writer.print('('); 5482 _writer.print('(');
5360 visit(node.expression); 5483 visit(node.expression);
5361 _writer.print(')'); 5484 _writer.print(')');
5362 return null; 5485 return null;
5363 } 5486 }
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
5630 void visitList(NodeList<ASTNode> nodes) { 5753 void visitList(NodeList<ASTNode> nodes) {
5631 visitList5(nodes, ""); 5754 visitList5(nodes, "");
5632 } 5755 }
5633 /** 5756 /**
5634 * Print a list of nodes, separated by the given separator. 5757 * Print a list of nodes, separated by the given separator.
5635 * @param nodes the nodes to be printed 5758 * @param nodes the nodes to be printed
5636 * @param separator the separator to be printed between adjacent nodes 5759 * @param separator the separator to be printed between adjacent nodes
5637 */ 5760 */
5638 void visitList5(NodeList<ASTNode> nodes, String separator) { 5761 void visitList5(NodeList<ASTNode> nodes, String separator) {
5639 if (nodes != null) { 5762 if (nodes != null) {
5640 int size8 = nodes.length; 5763 int size9 = nodes.length;
5641 for (int i = 0; i < size8; i++) { 5764 for (int i = 0; i < size9; i++) {
5642 if ("\n" == separator) { 5765 if ("\n" == separator) {
5643 _writer.print("\n"); 5766 _writer.print("\n");
5644 indent(); 5767 indent();
5645 } else if (i > 0) { 5768 } else if (i > 0) {
5646 _writer.print(separator); 5769 _writer.print(separator);
5647 } 5770 }
5648 nodes[i].accept(this); 5771 nodes[i].accept(this);
5649 } 5772 }
5650 } 5773 }
5651 } 5774 }
5652 /** 5775 /**
5653 * Print a list of nodes, separated by the given separator. 5776 * Print a list of nodes, separated by the given separator.
5654 * @param nodes the nodes to be printed 5777 * @param nodes the nodes to be printed
5655 * @param separator the separator to be printed between adjacent nodes 5778 * @param separator the separator to be printed between adjacent nodes
5656 * @param suffix the suffix to be printed if the list is not empty 5779 * @param suffix the suffix to be printed if the list is not empty
5657 */ 5780 */
5658 void visitList6(NodeList<ASTNode> nodes, String separator, String suffix) { 5781 void visitList6(NodeList<ASTNode> nodes, String separator, String suffix) {
5659 if (nodes != null) { 5782 if (nodes != null) {
5660 int size9 = nodes.length; 5783 int size10 = nodes.length;
5661 if (size9 > 0) { 5784 if (size10 > 0) {
5662 for (int i = 0; i < size9; i++) { 5785 for (int i = 0; i < size10; i++) {
5663 if (i > 0) { 5786 if (i > 0) {
5664 _writer.print(separator); 5787 _writer.print(separator);
5665 } 5788 }
5666 nodes[i].accept(this); 5789 nodes[i].accept(this);
5667 } 5790 }
5668 _writer.print(suffix); 5791 _writer.print(suffix);
5669 } 5792 }
5670 } 5793 }
5671 } 5794 }
5672 /** 5795 /**
5673 * Print a list of nodes, separated by the given separator. 5796 * Print a list of nodes, separated by the given separator.
5674 * @param prefix the prefix to be printed if the list is not empty 5797 * @param prefix the prefix to be printed if the list is not empty
5675 * @param nodes the nodes to be printed 5798 * @param nodes the nodes to be printed
5676 * @param separator the separator to be printed between adjacent nodes 5799 * @param separator the separator to be printed between adjacent nodes
5677 */ 5800 */
5678 void visitList7(String prefix, NodeList<ASTNode> nodes, String separator) { 5801 void visitList7(String prefix, NodeList<ASTNode> nodes, String separator) {
5679 if (nodes != null) { 5802 if (nodes != null) {
5680 int size10 = nodes.length; 5803 int size11 = nodes.length;
5681 if (size10 > 0) { 5804 if (size11 > 0) {
5682 _writer.print(prefix); 5805 _writer.print(prefix);
5683 for (int i = 0; i < size10; i++) { 5806 for (int i = 0; i < size11; i++) {
5684 if (i > 0) { 5807 if (i > 0) {
5685 _writer.print(separator); 5808 _writer.print(separator);
5686 } 5809 }
5687 nodes[i].accept(this); 5810 nodes[i].accept(this);
5688 } 5811 }
5689 } 5812 }
5690 } 5813 }
5691 } 5814 }
5692 } 5815 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/java_junit.dart ('k') | pkg/analyzer_experimental/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698