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

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

Issue 18612009: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 library engine.parser; 3 library engine.parser;
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'java_core.dart'; 5 import 'java_core.dart';
6 import 'java_engine.dart'; 6 import 'java_engine.dart';
7 import 'instrumentation.dart'; 7 import 'instrumentation.dart';
8 import 'error.dart'; 8 import 'error.dart';
9 import 'source.dart'; 9 import 'source.dart';
10 import 'scanner.dart'; 10 import 'scanner.dart';
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 * </pre> 772 * </pre>
773 * 773 *
774 * @return `true` if the current token is the first token in an initialized va riable 774 * @return `true` if the current token is the first token in an initialized va riable
775 * declaration 775 * declaration
776 */ 776 */
777 bool isInitializedVariableDeclaration() { 777 bool isInitializedVariableDeclaration() {
778 if (matches(Keyword.FINAL) || matches(Keyword.VAR)) { 778 if (matches(Keyword.FINAL) || matches(Keyword.VAR)) {
779 return true; 779 return true;
780 } 780 }
781 if (matches(Keyword.CONST)) { 781 if (matches(Keyword.CONST)) {
782 return !matchesAny(peek(), [TokenType.LT, TokenType.OPEN_CURLY_BRACKET, To kenType.OPEN_SQUARE_BRACKET, TokenType.INDEX]); 782 return !matchesAny(peek(), [
783 TokenType.LT,
784 TokenType.OPEN_CURLY_BRACKET,
785 TokenType.OPEN_SQUARE_BRACKET,
786 TokenType.INDEX]);
783 } 787 }
784 Token token = skipTypeName(_currentToken); 788 Token token = skipTypeName(_currentToken);
785 if (token == null) { 789 if (token == null) {
786 return false; 790 return false;
787 } 791 }
788 token = skipSimpleIdentifier(token); 792 token = skipSimpleIdentifier(token);
789 if (token == null) { 793 if (token == null) {
790 return false; 794 return false;
791 } 795 }
792 TokenType type = token.type; 796 TokenType type = token.type;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 token = token.next.next; 857 token = token.next.next;
854 } 858 }
855 if (identical(token.type, TokenType.KEYWORD)) { 859 if (identical(token.type, TokenType.KEYWORD)) {
856 Keyword keyword = ((token as KeywordToken)).keyword; 860 Keyword keyword = ((token as KeywordToken)).keyword;
857 return identical(keyword, Keyword.CASE) || identical(keyword, Keyword.DEFA ULT); 861 return identical(keyword, Keyword.CASE) || identical(keyword, Keyword.DEFA ULT);
858 } 862 }
859 return false; 863 return false;
860 } 864 }
861 865
862 /** 866 /**
867 * Return `true` if the given token appears to be the first token of a type na me that is
868 * followed by a variable or field formal parameter.
869 *
870 * @param startToken the first token of the sequence being checked
871 * @return `true` if there is a type name and variable starting at the given t oken
872 */
873 bool isTypedIdentifier(Token startToken) {
874 Token token = skipReturnType(startToken);
875 if (token == null) {
876 return false;
877 } else if (matchesIdentifier2(token)) {
878 return true;
879 } else if (matches3(token, Keyword.THIS) && matches4(token.next, TokenType.P ERIOD) && matchesIdentifier2(token.next.next)) {
880 return true;
881 }
882 return false;
883 }
884
885 /**
863 * Compare the given tokens to find the token that appears first in the source being parsed. That 886 * Compare the given tokens to find the token that appears first in the source being parsed. That
864 * is, return the left-most of all of the tokens. The arguments are allowed to be `null`. 887 * is, return the left-most of all of the tokens. The arguments are allowed to be `null`.
865 * Return the token with the smallest offset, or `null` if there are no argume nts or if all 888 * Return the token with the smallest offset, or `null` if there are no argume nts or if all
866 * of the arguments are `null`. 889 * of the arguments are `null`.
867 * 890 *
868 * @param tokens the tokens being compared 891 * @param tokens the tokens being compared
869 * @return the token with the smallest offset 892 * @return the token with the smallest offset
870 */ 893 */
871 Token lexicallyFirst(List<Token> tokens) { 894 Token lexicallyFirst(List<Token> tokens) {
872 Token first = null; 895 Token first = null;
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 reportError8(ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES, implementsCl ause.keyword, []); 1520 reportError8(ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES, implementsCl ause.keyword, []);
1498 parseImplementsClause(); 1521 parseImplementsClause();
1499 } 1522 }
1500 } else { 1523 } else {
1501 foundClause = false; 1524 foundClause = false;
1502 } 1525 }
1503 } 1526 }
1504 if (withClause != null && extendsClause == null) { 1527 if (withClause != null && extendsClause == null) {
1505 reportError8(ParserErrorCode.WITH_WITHOUT_EXTENDS, withClause.withKeyword, []); 1528 reportError8(ParserErrorCode.WITH_WITHOUT_EXTENDS, withClause.withKeyword, []);
1506 } 1529 }
1530 NativeClause nativeClause = null;
1507 if (matches2(_NATIVE) && matches4(peek(), TokenType.STRING)) { 1531 if (matches2(_NATIVE) && matches4(peek(), TokenType.STRING)) {
1508 advance(); 1532 nativeClause = parseNativeClause();
1509 advance();
1510 } 1533 }
1511 Token leftBracket = null; 1534 Token leftBracket = null;
1512 List<ClassMember> members = null; 1535 List<ClassMember> members = null;
1513 Token rightBracket = null; 1536 Token rightBracket = null;
1514 if (matches5(TokenType.OPEN_CURLY_BRACKET)) { 1537 if (matches5(TokenType.OPEN_CURLY_BRACKET)) {
1515 leftBracket = expect2(TokenType.OPEN_CURLY_BRACKET); 1538 leftBracket = expect2(TokenType.OPEN_CURLY_BRACKET);
1516 members = parseClassMembers(className, getEndToken(leftBracket)); 1539 members = parseClassMembers(className, getEndToken(leftBracket));
1517 rightBracket = expect2(TokenType.CLOSE_CURLY_BRACKET); 1540 rightBracket = expect2(TokenType.CLOSE_CURLY_BRACKET);
1518 } else { 1541 } else {
1519 leftBracket = createSyntheticToken2(TokenType.OPEN_CURLY_BRACKET); 1542 leftBracket = createSyntheticToken2(TokenType.OPEN_CURLY_BRACKET);
1520 rightBracket = createSyntheticToken2(TokenType.CLOSE_CURLY_BRACKET); 1543 rightBracket = createSyntheticToken2(TokenType.CLOSE_CURLY_BRACKET);
1521 reportError7(ParserErrorCode.MISSING_CLASS_BODY, []); 1544 reportError7(ParserErrorCode.MISSING_CLASS_BODY, []);
1522 } 1545 }
1523 return new ClassDeclaration.full(commentAndMetadata.comment, commentAndMetad ata.metadata, abstractKeyword, keyword, name, typeParameters, extendsClause, wit hClause, implementsClause, leftBracket, members, rightBracket); 1546 ClassDeclaration classDeclaration = new ClassDeclaration.full(commentAndMeta data.comment, commentAndMetadata.metadata, abstractKeyword, keyword, name, typeP arameters, extendsClause, withClause, implementsClause, leftBracket, members, ri ghtBracket);
1547 classDeclaration.nativeClause = nativeClause;
1548 return classDeclaration;
1524 } 1549 }
1525 1550
1526 /** 1551 /**
1527 * Parse a class member. 1552 * Parse a class member.
1528 * 1553 *
1529 * <pre> 1554 * <pre>
1530 * classMemberDefinition ::= 1555 * classMemberDefinition ::=
1531 * declaration ';' 1556 * declaration ';'
1532 * | methodSignature functionBody 1557 * | methodSignature functionBody
1533 * </pre> 1558 * </pre>
1534 * 1559 *
1535 * @param className the name of the class containing the member being parsed 1560 * @param className the name of the class containing the member being parsed
1536 * @return the class member that was parsed, or `null` if what was found was n ot a valid 1561 * @return the class member that was parsed, or `null` if what was found was n ot a valid
1537 * class member 1562 * class member
1538 */ 1563 */
1539 ClassMember parseClassMember(String className) { 1564 ClassMember parseClassMember(String className) {
1540 CommentAndMetadata commentAndMetadata = parseCommentAndMetadata(); 1565 CommentAndMetadata commentAndMetadata = parseCommentAndMetadata();
1541 Modifiers modifiers = parseModifiers(); 1566 Modifiers modifiers = parseModifiers();
1542 if (matches(Keyword.VOID)) { 1567 if (matches(Keyword.VOID)) {
1543 TypeName returnType = parseReturnType(); 1568 TypeName returnType = parseReturnType();
1544 if (matches(Keyword.GET) && matchesIdentifier2(peek())) { 1569 if (matches(Keyword.GET) && matchesIdentifier2(peek())) {
1545 validateModifiersForGetterOrSetterOrMethod(modifiers); 1570 validateModifiersForGetterOrSetterOrMethod(modifiers);
1546 return parseGetter(commentAndMetadata, modifiers.externalKeyword, modifi ers.staticKeyword, returnType); 1571 return parseGetter(commentAndMetadata, modifiers.externalKeyword, modifi ers.staticKeyword, returnType);
1547 } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) { 1572 } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) {
1548 validateModifiersForGetterOrSetterOrMethod(modifiers); 1573 validateModifiersForGetterOrSetterOrMethod(modifiers);
1549 return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifi ers.staticKeyword, returnType); 1574 return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifi ers.staticKeyword, returnType);
1550 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) { 1575 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
1551 validateModifiersForOperator(modifiers); 1576 validateModifiersForOperator(modifiers);
1552 return parseOperator(commentAndMetadata, modifiers.externalKeyword, retu rnType); 1577 return parseOperator(commentAndMetadata, modifiers.externalKeyword, retu rnType);
1553 } else if (matchesIdentifier() && matchesAny(peek(), [TokenType.OPEN_PAREN , TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) { 1578 } else if (matchesIdentifier() && matchesAny(peek(), [
1579 TokenType.OPEN_PAREN,
1580 TokenType.OPEN_CURLY_BRACKET,
1581 TokenType.FUNCTION])) {
1554 validateModifiersForGetterOrSetterOrMethod(modifiers); 1582 validateModifiersForGetterOrSetterOrMethod(modifiers);
1555 return parseMethodDeclaration(commentAndMetadata, modifiers.externalKeyw ord, modifiers.staticKeyword, returnType); 1583 return parseMethodDeclaration(commentAndMetadata, modifiers.externalKeyw ord, modifiers.staticKeyword, returnType);
1556 } else { 1584 } else {
1557 if (matchesIdentifier()) { 1585 if (matchesIdentifier()) {
1558 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMIC OLON])) { 1586 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMIC OLON])) {
1559 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []); 1587 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []);
1560 return parseInitializedIdentifierList(commentAndMetadata, modifiers. staticKeyword, validateModifiersForField(modifiers), returnType); 1588 return parseInitializedIdentifierList(commentAndMetadata, modifiers. staticKeyword, validateModifiersForField(modifiers), returnType);
1561 } 1589 }
1562 } 1590 }
1563 if (isOperator(peek())) { 1591 if (isOperator(peek())) {
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
2001 return parseTypeAlias(commentAndMetadata); 2029 return parseTypeAlias(commentAndMetadata);
2002 } 2030 }
2003 if (matches(Keyword.VOID)) { 2031 if (matches(Keyword.VOID)) {
2004 TypeName returnType = parseReturnType(); 2032 TypeName returnType = parseReturnType();
2005 if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifier2(p eek())) { 2033 if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifier2(p eek())) {
2006 validateModifiersForTopLevelFunction(modifiers); 2034 validateModifiersForTopLevelFunction(modifiers);
2007 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKe yword, null); 2035 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKe yword, null);
2008 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) { 2036 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
2009 reportError8(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []); 2037 reportError8(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []);
2010 return convertToFunctionDeclaration(parseOperator(commentAndMetadata, mo difiers.externalKeyword, returnType)); 2038 return convertToFunctionDeclaration(parseOperator(commentAndMetadata, mo difiers.externalKeyword, returnType));
2011 } else if (matchesIdentifier() && matchesAny(peek(), [TokenType.OPEN_PAREN , TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) { 2039 } else if (matchesIdentifier() && matchesAny(peek(), [
2040 TokenType.OPEN_PAREN,
2041 TokenType.OPEN_CURLY_BRACKET,
2042 TokenType.FUNCTION])) {
2012 validateModifiersForTopLevelFunction(modifiers); 2043 validateModifiersForTopLevelFunction(modifiers);
2013 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKe yword, returnType); 2044 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKe yword, returnType);
2014 } else { 2045 } else {
2015 if (matchesIdentifier()) { 2046 if (matchesIdentifier()) {
2016 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMIC OLON])) { 2047 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMIC OLON])) {
2017 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []); 2048 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []);
2018 return new TopLevelVariableDeclaration.full(commentAndMetadata.comme nt, commentAndMetadata.metadata, parseVariableDeclarationList2(null, validateMod ifiersForTopLevelVariable(modifiers), null), expect2(TokenType.SEMICOLON)); 2049 return new TopLevelVariableDeclaration.full(commentAndMetadata.comme nt, commentAndMetadata.metadata, parseVariableDeclarationList2(null, validateMod ifiersForTopLevelVariable(modifiers), null), expect2(TokenType.SEMICOLON));
2019 } 2050 }
2020 } 2051 }
2021 reportError8(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []); 2052 reportError8(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
(...skipping 11 matching lines...) Expand all
2033 } else if (matches4(peek(), TokenType.OPEN_PAREN)) { 2064 } else if (matches4(peek(), TokenType.OPEN_PAREN)) {
2034 validateModifiersForTopLevelFunction(modifiers); 2065 validateModifiersForTopLevelFunction(modifiers);
2035 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, null); 2066 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, null);
2036 } else if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMI COLON])) { 2067 } else if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMI COLON])) {
2037 if (modifiers.constKeyword == null && modifiers.finalKeyword == null && mo difiers.varKeyword == null) { 2068 if (modifiers.constKeyword == null && modifiers.finalKeyword == null && mo difiers.varKeyword == null) {
2038 reportError7(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, []); 2069 reportError7(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, []);
2039 } 2070 }
2040 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co mmentAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiers ForTopLevelVariable(modifiers), null), expect2(TokenType.SEMICOLON)); 2071 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co mmentAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiers ForTopLevelVariable(modifiers), null), expect2(TokenType.SEMICOLON));
2041 } 2072 }
2042 TypeName returnType = parseReturnType(); 2073 TypeName returnType = parseReturnType();
2043 if (matches(Keyword.GET) || matches(Keyword.SET)) { 2074 if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifier2(pee k())) {
2044 validateModifiersForTopLevelFunction(modifiers); 2075 validateModifiersForTopLevelFunction(modifiers);
2045 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, returnType); 2076 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, returnType);
2046 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) { 2077 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) {
2047 reportError8(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []); 2078 reportError8(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []);
2048 return convertToFunctionDeclaration(parseOperator(commentAndMetadata, modi fiers.externalKeyword, returnType)); 2079 return convertToFunctionDeclaration(parseOperator(commentAndMetadata, modi fiers.externalKeyword, returnType));
2049 } else if (matches5(TokenType.AT)) { 2080 } else if (matches5(TokenType.AT)) {
2050 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co mmentAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiers ForTopLevelVariable(modifiers), returnType), expect2(TokenType.SEMICOLON)); 2081 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co mmentAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiers ForTopLevelVariable(modifiers), returnType), expect2(TokenType.SEMICOLON));
2051 } else if (!matchesIdentifier()) { 2082 } else if (!matchesIdentifier()) {
2052 reportError8(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []); 2083 reportError8(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []);
2053 Token semicolon; 2084 Token semicolon;
2054 if (matches5(TokenType.SEMICOLON)) { 2085 if (matches5(TokenType.SEMICOLON)) {
2055 semicolon = andAdvance; 2086 semicolon = andAdvance;
2056 } else { 2087 } else {
2057 semicolon = createSyntheticToken2(TokenType.SEMICOLON); 2088 semicolon = createSyntheticToken2(TokenType.SEMICOLON);
2058 } 2089 }
2059 List<VariableDeclaration> variables = new List<VariableDeclaration>(); 2090 List<VariableDeclaration> variables = new List<VariableDeclaration>();
2060 variables.add(new VariableDeclaration.full(null, null, createSyntheticIden tifier(), null, null)); 2091 variables.add(new VariableDeclaration.full(null, null, createSyntheticIden tifier(), null, null));
2061 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co mmentAndMetadata.metadata, new VariableDeclarationList.full(null, null, null, re turnType, variables), semicolon); 2092 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co mmentAndMetadata.metadata, new VariableDeclarationList.full(null, null, null, re turnType, variables), semicolon);
2062 } 2093 }
2063 if (matchesAny(peek(), [TokenType.OPEN_PAREN, TokenType.FUNCTION, TokenType. OPEN_CURLY_BRACKET])) { 2094 if (matchesAny(peek(), [
2095 TokenType.OPEN_PAREN,
2096 TokenType.FUNCTION,
2097 TokenType.OPEN_CURLY_BRACKET])) {
2064 validateModifiersForTopLevelFunction(modifiers); 2098 validateModifiersForTopLevelFunction(modifiers);
2065 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, returnType); 2099 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw ord, returnType);
2066 } 2100 }
2067 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, comm entAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiersFo rTopLevelVariable(modifiers), returnType), expect2(TokenType.SEMICOLON)); 2101 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, comm entAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiersFo rTopLevelVariable(modifiers), returnType), expect2(TokenType.SEMICOLON));
2068 } 2102 }
2069 2103
2070 /** 2104 /**
2071 * Parse a conditional expression. 2105 * Parse a conditional expression.
2072 * 2106 *
2073 * <pre> 2107 * <pre>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
2136 initializers.add(parseConstructorFieldInitializer()); 2170 initializers.add(parseConstructorFieldInitializer());
2137 } 2171 }
2138 } while (optional(TokenType.COMMA)); 2172 } while (optional(TokenType.COMMA));
2139 } 2173 }
2140 ConstructorName redirectedConstructor = null; 2174 ConstructorName redirectedConstructor = null;
2141 FunctionBody body; 2175 FunctionBody body;
2142 if (matches5(TokenType.EQ)) { 2176 if (matches5(TokenType.EQ)) {
2143 separator = andAdvance; 2177 separator = andAdvance;
2144 redirectedConstructor = parseConstructorName(); 2178 redirectedConstructor = parseConstructorName();
2145 body = new EmptyFunctionBody.full(expect2(TokenType.SEMICOLON)); 2179 body = new EmptyFunctionBody.full(expect2(TokenType.SEMICOLON));
2180 if (factoryKeyword == null) {
2181 reportError(ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR, redi rectedConstructor, []);
2182 }
2146 } else { 2183 } else {
2147 body = parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION_BODY, fals e); 2184 body = parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION_BODY, fals e);
2148 if (constKeyword != null && factoryKeyword != null) { 2185 if (constKeyword != null && factoryKeyword != null) {
2149 reportError8(ParserErrorCode.CONST_FACTORY, factoryKeyword, []); 2186 reportError8(ParserErrorCode.CONST_FACTORY, factoryKeyword, []);
2150 } else if (body is EmptyFunctionBody) { 2187 } else if (body is EmptyFunctionBody) {
2151 if (factoryKeyword != null && externalKeyword == null) { 2188 if (factoryKeyword != null && externalKeyword == null) {
2152 reportError8(ParserErrorCode.FACTORY_WITHOUT_BODY, factoryKeyword, []) ; 2189 reportError8(ParserErrorCode.FACTORY_WITHOUT_BODY, factoryKeyword, []) ;
2153 } 2190 }
2154 } else { 2191 } else {
2155 if (constKeyword != null) { 2192 if (constKeyword != null) {
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
2510 * </pre> 2547 * </pre>
2511 * 2548 *
2512 * @param optional `true` if the keyword and type are optional 2549 * @param optional `true` if the keyword and type are optional
2513 * @return the 'final', 'const', 'var' or type that was parsed 2550 * @return the 'final', 'const', 'var' or type that was parsed
2514 */ 2551 */
2515 FinalConstVarOrType parseFinalConstVarOrType(bool optional) { 2552 FinalConstVarOrType parseFinalConstVarOrType(bool optional) {
2516 Token keyword = null; 2553 Token keyword = null;
2517 TypeName type = null; 2554 TypeName type = null;
2518 if (matches(Keyword.FINAL) || matches(Keyword.CONST)) { 2555 if (matches(Keyword.FINAL) || matches(Keyword.CONST)) {
2519 keyword = andAdvance; 2556 keyword = andAdvance;
2520 if (matchesIdentifier2(peek()) || matches4(peek(), TokenType.LT) || matche s3(peek(), Keyword.THIS) || (matches4(peek(), TokenType.PERIOD) && matchesIdenti fier2(peek2(2)) && (matchesIdentifier2(peek2(3)) || matches4(peek2(3), TokenType .LT) || matches3(peek2(3), Keyword.THIS)))) { 2557 if (isTypedIdentifier(_currentToken)) {
2521 type = parseTypeName(); 2558 type = parseTypeName();
2522 } 2559 }
2523 } else if (matches(Keyword.VAR)) { 2560 } else if (matches(Keyword.VAR)) {
2524 keyword = andAdvance; 2561 keyword = andAdvance;
2525 } else { 2562 } else {
2526 if (matchesIdentifier2(peek()) || matches4(peek(), TokenType.LT) || matche s3(peek(), Keyword.THIS) || (matches4(peek(), TokenType.PERIOD) && matchesIdenti fier2(peek2(2)) && (matchesIdentifier2(peek2(3)) || matches4(peek2(3), TokenType .LT) || matches3(peek2(3), Keyword.THIS)))) { 2563 if (isTypedIdentifier(_currentToken)) {
2527 type = parseReturnType(); 2564 type = parseReturnType();
2528 } else if (!optional) { 2565 } else if (!optional) {
2529 reportError7(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, []); 2566 reportError7(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, []);
2530 } 2567 }
2531 } 2568 }
2532 return new FinalConstVarOrType(keyword, type); 2569 return new FinalConstVarOrType(keyword, type);
2533 } 2570 }
2534 2571
2535 /** 2572 /**
2536 * Parse a formal parameter. At most one of `isOptional` and `isNamed` can be 2573 * Parse a formal parameter. At most one of `isOptional` and `isNamed` can be
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
3521 expression = parseUnaryExpression(); 3558 expression = parseUnaryExpression();
3522 } 3559 }
3523 while (_currentToken.type.isMultiplicativeOperator) { 3560 while (_currentToken.type.isMultiplicativeOperator) {
3524 Token operator = andAdvance; 3561 Token operator = andAdvance;
3525 expression = new BinaryExpression.full(expression, operator, parseUnaryExp ression()); 3562 expression = new BinaryExpression.full(expression, operator, parseUnaryExp ression());
3526 } 3563 }
3527 return expression; 3564 return expression;
3528 } 3565 }
3529 3566
3530 /** 3567 /**
3568 * Parse a class native clause.
3569 *
3570 * <pre>
3571 * classNativeClause ::=
3572 * 'native' name
3573 * </pre>
3574 *
3575 * @return the class native clause that was parsed
3576 */
3577 NativeClause parseNativeClause() {
3578 Token keyword = andAdvance;
3579 StringLiteral name = parseStringLiteral();
3580 return new NativeClause.full(keyword, name);
3581 }
3582
3583 /**
3531 * Parse a new expression. 3584 * Parse a new expression.
3532 * 3585 *
3533 * <pre> 3586 * <pre>
3534 * newExpression ::= 3587 * newExpression ::=
3535 * instanceCreationExpression 3588 * instanceCreationExpression
3536 * </pre> 3589 * </pre>
3537 * 3590 *
3538 * @return the new expression that was parsed 3591 * @return the new expression that was parsed
3539 */ 3592 */
3540 InstanceCreationExpression parseNewExpression() => parseInstanceCreationExpres sion(expect(Keyword.NEW)); 3593 InstanceCreationExpression parseNewExpression() => parseInstanceCreationExpres sion(expect(Keyword.NEW));
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
3595 } else if (identical(keyword, Keyword.THROW)) { 3648 } else if (identical(keyword, Keyword.THROW)) {
3596 return new ExpressionStatement.full(parseThrowExpression(), expect2(Toke nType.SEMICOLON)); 3649 return new ExpressionStatement.full(parseThrowExpression(), expect2(Toke nType.SEMICOLON));
3597 } else if (identical(keyword, Keyword.TRY)) { 3650 } else if (identical(keyword, Keyword.TRY)) {
3598 return parseTryStatement(); 3651 return parseTryStatement();
3599 } else if (identical(keyword, Keyword.WHILE)) { 3652 } else if (identical(keyword, Keyword.WHILE)) {
3600 return parseWhileStatement(); 3653 return parseWhileStatement();
3601 } else if (identical(keyword, Keyword.VAR) || identical(keyword, Keyword.F INAL)) { 3654 } else if (identical(keyword, Keyword.VAR) || identical(keyword, Keyword.F INAL)) {
3602 return parseVariableDeclarationStatement(commentAndMetadata); 3655 return parseVariableDeclarationStatement(commentAndMetadata);
3603 } else if (identical(keyword, Keyword.VOID)) { 3656 } else if (identical(keyword, Keyword.VOID)) {
3604 TypeName returnType = parseReturnType(); 3657 TypeName returnType = parseReturnType();
3605 if (matchesIdentifier() && matchesAny(peek(), [TokenType.OPEN_PAREN, Tok enType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) { 3658 if (matchesIdentifier() && matchesAny(peek(), [
3659 TokenType.OPEN_PAREN,
3660 TokenType.OPEN_CURLY_BRACKET,
3661 TokenType.FUNCTION])) {
3606 return parseFunctionDeclarationStatement2(commentAndMetadata, returnTy pe); 3662 return parseFunctionDeclarationStatement2(commentAndMetadata, returnTy pe);
3607 } else { 3663 } else {
3608 if (matchesIdentifier()) { 3664 if (matchesIdentifier()) {
3609 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEM ICOLON])) { 3665 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEM ICOLON])) {
3610 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []); 3666 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []);
3611 return parseVariableDeclarationStatement(commentAndMetadata); 3667 return parseVariableDeclarationStatement(commentAndMetadata);
3612 } 3668 }
3613 } else if (matches5(TokenType.CLOSE_CURLY_BRACKET)) { 3669 } else if (matches5(TokenType.CLOSE_CURLY_BRACKET)) {
3614 return parseVariableDeclarationStatement2(commentAndMetadata, null, returnType); 3670 return parseVariableDeclarationStatement2(commentAndMetadata, null, returnType);
3615 } 3671 }
3616 reportError7(ParserErrorCode.MISSING_STATEMENT, []); 3672 reportError7(ParserErrorCode.MISSING_STATEMENT, []);
3617 return new EmptyStatement.full(createSyntheticToken2(TokenType.SEMICOL ON)); 3673 return new EmptyStatement.full(createSyntheticToken2(TokenType.SEMICOL ON));
3618 } 3674 }
3619 } else if (identical(keyword, Keyword.CONST)) { 3675 } else if (identical(keyword, Keyword.CONST)) {
3620 if (matchesAny(peek(), [TokenType.LT, TokenType.OPEN_CURLY_BRACKET, Toke nType.OPEN_SQUARE_BRACKET, TokenType.INDEX])) { 3676 if (matchesAny(peek(), [
3677 TokenType.LT,
3678 TokenType.OPEN_CURLY_BRACKET,
3679 TokenType.OPEN_SQUARE_BRACKET,
3680 TokenType.INDEX])) {
3621 return new ExpressionStatement.full(parseExpression2(), expect2(TokenT ype.SEMICOLON)); 3681 return new ExpressionStatement.full(parseExpression2(), expect2(TokenT ype.SEMICOLON));
3622 } else if (matches4(peek(), TokenType.IDENTIFIER)) { 3682 } else if (matches4(peek(), TokenType.IDENTIFIER)) {
3623 Token afterType = skipTypeName(peek()); 3683 Token afterType = skipTypeName(peek());
3624 if (afterType != null) { 3684 if (afterType != null) {
3625 if (matches4(afterType, TokenType.OPEN_PAREN) || (matches4(afterType , TokenType.PERIOD) && matches4(afterType.next, TokenType.IDENTIFIER) && matches 4(afterType.next.next, TokenType.OPEN_PAREN))) { 3685 if (matches4(afterType, TokenType.OPEN_PAREN) || (matches4(afterType , TokenType.PERIOD) && matches4(afterType.next, TokenType.IDENTIFIER) && matches 4(afterType.next.next, TokenType.OPEN_PAREN))) {
3626 return new ExpressionStatement.full(parseExpression2(), expect2(To kenType.SEMICOLON)); 3686 return new ExpressionStatement.full(parseExpression2(), expect2(To kenType.SEMICOLON));
3627 } 3687 }
3628 } 3688 }
3629 } 3689 }
3630 return parseVariableDeclarationStatement(commentAndMetadata); 3690 return parseVariableDeclarationStatement(commentAndMetadata);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
3685 if (thisKeyword == null) { 3745 if (thisKeyword == null) {
3686 if (holder.keyword != null) { 3746 if (holder.keyword != null) {
3687 reportError8(ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, holder.keyw ord, []); 3747 reportError8(ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, holder.keyw ord, []);
3688 } 3748 }
3689 return new FunctionTypedFormalParameter.full(commentAndMetadata.comment, commentAndMetadata.metadata, holder.type, identifier, parameters); 3749 return new FunctionTypedFormalParameter.full(commentAndMetadata.comment, commentAndMetadata.metadata, holder.type, identifier, parameters);
3690 } else { 3750 } else {
3691 return new FieldFormalParameter.full(commentAndMetadata.comment, comment AndMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifi er, parameters); 3751 return new FieldFormalParameter.full(commentAndMetadata.comment, comment AndMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifi er, parameters);
3692 } 3752 }
3693 } 3753 }
3694 TypeName type = holder.type; 3754 TypeName type = holder.type;
3695 if (type != null && matches3(type.name.beginToken, Keyword.VOID)) { 3755 if (type != null) {
3696 reportError8(ParserErrorCode.VOID_PARAMETER, type.name.beginToken, []); 3756 if (matches3(type.name.beginToken, Keyword.VOID)) {
3757 reportError8(ParserErrorCode.VOID_PARAMETER, type.name.beginToken, []);
3758 } else if (holder.keyword != null && matches3(holder.keyword, Keyword.VAR) ) {
3759 reportError8(ParserErrorCode.VAR_AND_TYPE, holder.keyword, []);
3760 }
3697 } 3761 }
3698 if (thisKeyword != null) { 3762 if (thisKeyword != null) {
3699 return new FieldFormalParameter.full(commentAndMetadata.comment, commentAn dMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifier , null); 3763 return new FieldFormalParameter.full(commentAndMetadata.comment, commentAn dMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifier , null);
3700 } 3764 }
3701 return new SimpleFormalParameter.full(commentAndMetadata.comment, commentAnd Metadata.metadata, holder.keyword, holder.type, identifier); 3765 return new SimpleFormalParameter.full(commentAndMetadata.comment, commentAnd Metadata.metadata, holder.keyword, holder.type, identifier);
3702 } 3766 }
3703 3767
3704 /** 3768 /**
3705 * Parse an operator declaration. 3769 * Parse an operator declaration.
3706 * 3770 *
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
4707 * </pre> 4771 * </pre>
4708 * 4772 *
4709 * @param commentAndMetadata the metadata to be associated with the variable d eclaration list, or 4773 * @param commentAndMetadata the metadata to be associated with the variable d eclaration list, or
4710 * `null` if there is no attempt at parsing the comment and metadata 4774 * `null` if there is no attempt at parsing the comment and metadata
4711 * @param keyword the token representing the 'final', 'const' or 'var' keyword , or `null` if 4775 * @param keyword the token representing the 'final', 'const' or 'var' keyword , or `null` if
4712 * there is no keyword 4776 * there is no keyword
4713 * @param type the type of the variables in the list 4777 * @param type the type of the variables in the list
4714 * @return the variable declaration list that was parsed 4778 * @return the variable declaration list that was parsed
4715 */ 4779 */
4716 VariableDeclarationList parseVariableDeclarationList2(CommentAndMetadata comme ntAndMetadata, Token keyword, TypeName type) { 4780 VariableDeclarationList parseVariableDeclarationList2(CommentAndMetadata comme ntAndMetadata, Token keyword, TypeName type) {
4781 if (type != null && keyword != null && matches3(keyword, Keyword.VAR)) {
4782 reportError8(ParserErrorCode.VAR_AND_TYPE, keyword, []);
4783 }
4717 List<VariableDeclaration> variables = new List<VariableDeclaration>(); 4784 List<VariableDeclaration> variables = new List<VariableDeclaration>();
4718 variables.add(parseVariableDeclaration()); 4785 variables.add(parseVariableDeclaration());
4719 while (matches5(TokenType.COMMA)) { 4786 while (matches5(TokenType.COMMA)) {
4720 advance(); 4787 advance();
4721 variables.add(parseVariableDeclaration()); 4788 variables.add(parseVariableDeclaration());
4722 } 4789 }
4723 return new VariableDeclarationList.full(commentAndMetadata != null ? comment AndMetadata.comment : null, commentAndMetadata != null ? commentAndMetadata.meta data : null, keyword, type, variables); 4790 return new VariableDeclarationList.full(commentAndMetadata != null ? comment AndMetadata.comment : null, commentAndMetadata != null ? commentAndMetadata.meta data : null, keyword, type, variables);
4724 } 4791 }
4725 4792
4726 /** 4793 /**
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
4934 * @return the token following the formal parameter list that was parsed 5001 * @return the token following the formal parameter list that was parsed
4935 */ 5002 */
4936 Token skipFormalParameterList(Token startToken) { 5003 Token skipFormalParameterList(Token startToken) {
4937 if (!matches4(startToken, TokenType.OPEN_PAREN)) { 5004 if (!matches4(startToken, TokenType.OPEN_PAREN)) {
4938 return null; 5005 return null;
4939 } 5006 }
4940 Token next = startToken.next; 5007 Token next = startToken.next;
4941 if (matches4(next, TokenType.CLOSE_PAREN)) { 5008 if (matches4(next, TokenType.CLOSE_PAREN)) {
4942 return next.next; 5009 return next.next;
4943 } 5010 }
4944 if (matchesAny(next, [TokenType.AT, TokenType.OPEN_SQUARE_BRACKET, TokenType .OPEN_CURLY_BRACKET]) || matches3(next, Keyword.VOID) || (matchesIdentifier2(nex t) && (matchesAny(next.next, [TokenType.COMMA, TokenType.CLOSE_PAREN])))) { 5011 if (matchesAny(next, [
5012 TokenType.AT,
5013 TokenType.OPEN_SQUARE_BRACKET,
5014 TokenType.OPEN_CURLY_BRACKET]) || matches3(next, Keyword.VOID) || (match esIdentifier2(next) && (matchesAny(next.next, [TokenType.COMMA, TokenType.CLOSE_ PAREN])))) {
4945 return skipPastMatchingToken(startToken); 5015 return skipPastMatchingToken(startToken);
4946 } 5016 }
4947 if (matchesIdentifier2(next) && matches4(next.next, TokenType.OPEN_PAREN)) { 5017 if (matchesIdentifier2(next) && matches4(next.next, TokenType.OPEN_PAREN)) {
4948 Token afterParameters = skipFormalParameterList(next.next); 5018 Token afterParameters = skipFormalParameterList(next.next);
4949 if (afterParameters != null && (matchesAny(afterParameters, [TokenType.COM MA, TokenType.CLOSE_PAREN]))) { 5019 if (afterParameters != null && (matchesAny(afterParameters, [TokenType.COM MA, TokenType.CLOSE_PAREN]))) {
4950 return skipPastMatchingToken(startToken); 5020 return skipPastMatchingToken(startToken);
4951 } 5021 }
4952 } 5022 }
4953 Token afterType = skipFinalConstVarOrType(next); 5023 Token afterType = skipFinalConstVarOrType(next);
4954 if (afterType == null) { 5024 if (afterType == null) {
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
5747 static final ParserErrorCode NAMED_FUNCTION_EXPRESSION = new ParserErrorCode.c on2('NAMED_FUNCTION_EXPRESSION', 89, "Function expressions cannot be named"); 5817 static final ParserErrorCode NAMED_FUNCTION_EXPRESSION = new ParserErrorCode.c on2('NAMED_FUNCTION_EXPRESSION', 89, "Function expressions cannot be named");
5748 static final ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = new ParserErrorCo de.con2('NAMED_PARAMETER_OUTSIDE_GROUP', 90, "Named parameters must be enclosed in curly braces ('{' and '}')"); 5818 static final ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = new ParserErrorCo de.con2('NAMED_PARAMETER_OUTSIDE_GROUP', 90, "Named parameters must be enclosed in curly braces ('{' and '}')");
5749 static final ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = new Parser ErrorCode.con2('NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', 91, "Native functions can only be declared in the SDK and code that is loaded through native extensions") ; 5819 static final ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = new Parser ErrorCode.con2('NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', 91, "Native functions can only be declared in the SDK and code that is loaded through native extensions") ;
5750 static final ParserErrorCode NON_CONSTRUCTOR_FACTORY = new ParserErrorCode.con 2('NON_CONSTRUCTOR_FACTORY', 92, "Only constructors can be declared to be a 'fac tory'"); 5820 static final ParserErrorCode NON_CONSTRUCTOR_FACTORY = new ParserErrorCode.con 2('NON_CONSTRUCTOR_FACTORY', 92, "Only constructors can be declared to be a 'fac tory'");
5751 static final ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = new ParserErrorCode .con2('NON_IDENTIFIER_LIBRARY_NAME', 93, "The name of a library must be an ident ifier"); 5821 static final ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = new ParserErrorCode .con2('NON_IDENTIFIER_LIBRARY_NAME', 93, "The name of a library must be an ident ifier");
5752 static final ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = new ParserErrorCo de.con2('NON_PART_OF_DIRECTIVE_IN_PART', 94, "The part-of directive must be the only directive in a part"); 5822 static final ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = new ParserErrorCo de.con2('NON_PART_OF_DIRECTIVE_IN_PART', 94, "The part-of directive must be the only directive in a part");
5753 static final ParserErrorCode NON_USER_DEFINABLE_OPERATOR = new ParserErrorCode .con2('NON_USER_DEFINABLE_OPERATOR', 95, "The operator '%s' is not user definabl e"); 5823 static final ParserErrorCode NON_USER_DEFINABLE_OPERATOR = new ParserErrorCode .con2('NON_USER_DEFINABLE_OPERATOR', 95, "The operator '%s' is not user definabl e");
5754 static final ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS = new ParserErr orCode.con2('NORMAL_BEFORE_OPTIONAL_PARAMETERS', 96, "Normal parameters must occ ur before optional parameters"); 5824 static final ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS = new ParserErr orCode.con2('NORMAL_BEFORE_OPTIONAL_PARAMETERS', 96, "Normal parameters must occ ur before optional parameters");
5755 static final ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = new ParserError Code.con2('POSITIONAL_AFTER_NAMED_ARGUMENT', 97, "Positional arguments must occu r before named arguments"); 5825 static final ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = new ParserError Code.con2('POSITIONAL_AFTER_NAMED_ARGUMENT', 97, "Positional arguments must occu r before named arguments");
5756 static final ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = new ParserEr rorCode.con2('POSITIONAL_PARAMETER_OUTSIDE_GROUP', 98, "Positional parameters mu st be enclosed in square brackets ('[' and ']')"); 5826 static final ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = new ParserEr rorCode.con2('POSITIONAL_PARAMETER_OUTSIDE_GROUP', 98, "Positional parameters mu st be enclosed in square brackets ('[' and ']')");
5757 static final ParserErrorCode STATIC_AFTER_CONST = new ParserErrorCode.con2('ST ATIC_AFTER_CONST', 99, "The modifier 'static' should be before the modifier 'con st'"); 5827 static final ParserErrorCode REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR = new Pars erErrorCode.con2('REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR', 99, "Only factory con structor can specify '=' redirection.");
5758 static final ParserErrorCode STATIC_AFTER_FINAL = new ParserErrorCode.con2('ST ATIC_AFTER_FINAL', 100, "The modifier 'static' should be before the modifier 'fi nal'"); 5828 static final ParserErrorCode STATIC_AFTER_CONST = new ParserErrorCode.con2('ST ATIC_AFTER_CONST', 100, "The modifier 'static' should be before the modifier 'co nst'");
5759 static final ParserErrorCode STATIC_AFTER_VAR = new ParserErrorCode.con2('STAT IC_AFTER_VAR', 101, "The modifier 'static' should be before the modifier 'var'") ; 5829 static final ParserErrorCode STATIC_AFTER_FINAL = new ParserErrorCode.con2('ST ATIC_AFTER_FINAL', 101, "The modifier 'static' should be before the modifier 'fi nal'");
5760 static final ParserErrorCode STATIC_CONSTRUCTOR = new ParserErrorCode.con2('ST ATIC_CONSTRUCTOR', 102, "Constructors cannot be static"); 5830 static final ParserErrorCode STATIC_AFTER_VAR = new ParserErrorCode.con2('STAT IC_AFTER_VAR', 102, "The modifier 'static' should be before the modifier 'var'") ;
5761 static final ParserErrorCode STATIC_GETTER_WITHOUT_BODY = new ParserErrorCode. con2('STATIC_GETTER_WITHOUT_BODY', 103, "A 'static' getter must have a body"); 5831 static final ParserErrorCode STATIC_CONSTRUCTOR = new ParserErrorCode.con2('ST ATIC_CONSTRUCTOR', 103, "Constructors cannot be static");
5762 static final ParserErrorCode STATIC_OPERATOR = new ParserErrorCode.con2('STATI C_OPERATOR', 104, "Operators cannot be static"); 5832 static final ParserErrorCode STATIC_GETTER_WITHOUT_BODY = new ParserErrorCode. con2('STATIC_GETTER_WITHOUT_BODY', 104, "A 'static' getter must have a body");
5763 static final ParserErrorCode STATIC_SETTER_WITHOUT_BODY = new ParserErrorCode. con2('STATIC_SETTER_WITHOUT_BODY', 105, "A 'static' setter must have a body"); 5833 static final ParserErrorCode STATIC_OPERATOR = new ParserErrorCode.con2('STATI C_OPERATOR', 105, "Operators cannot be static");
5764 static final ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = new ParserErrorCod e.con2('STATIC_TOP_LEVEL_DECLARATION', 106, "Top-level declarations cannot be de clared to be 'static'"); 5834 static final ParserErrorCode STATIC_SETTER_WITHOUT_BODY = new ParserErrorCode. con2('STATIC_SETTER_WITHOUT_BODY', 106, "A 'static' setter must have a body");
5765 static final ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE = new ParserEr rorCode.con2('SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', 107, "The 'default' case shou ld be the last case in a switch statement"); 5835 static final ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = new ParserErrorCod e.con2('STATIC_TOP_LEVEL_DECLARATION', 107, "Top-level declarations cannot be de clared to be 'static'");
5766 static final ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES = new ParserErr orCode.con2('SWITCH_HAS_MULTIPLE_DEFAULT_CASES', 108, "The 'default' case can on ly be declared once"); 5836 static final ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE = new ParserEr rorCode.con2('SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', 108, "The 'default' case shou ld be the last case in a switch statement");
5767 static final ParserErrorCode TOP_LEVEL_OPERATOR = new ParserErrorCode.con2('TO P_LEVEL_OPERATOR', 109, "Operators must be declared within a class"); 5837 static final ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES = new ParserErr orCode.con2('SWITCH_HAS_MULTIPLE_DEFAULT_CASES', 109, "The 'default' case can on ly be declared once");
5768 static final ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = new P arserErrorCode.con2('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', 110, "There is no '%s' to open a parameter group"); 5838 static final ParserErrorCode TOP_LEVEL_OPERATOR = new ParserErrorCode.con2('TO P_LEVEL_OPERATOR', 110, "Operators must be declared within a class");
5769 static final ParserErrorCode UNEXPECTED_TOKEN = new ParserErrorCode.con2('UNEX PECTED_TOKEN', 111, "Unexpected token '%s'"); 5839 static final ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = new P arserErrorCode.con2('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', 111, "There is no '%s' to open a parameter group");
5770 static final ParserErrorCode WITH_BEFORE_EXTENDS = new ParserErrorCode.con2('W ITH_BEFORE_EXTENDS', 112, "The extends clause must be before the with clause"); 5840 static final ParserErrorCode UNEXPECTED_TOKEN = new ParserErrorCode.con2('UNEX PECTED_TOKEN', 112, "Unexpected token '%s'");
5771 static final ParserErrorCode WITH_WITHOUT_EXTENDS = new ParserErrorCode.con2(' WITH_WITHOUT_EXTENDS', 113, "The with clause cannot be used without an extends c lause"); 5841 static final ParserErrorCode WITH_BEFORE_EXTENDS = new ParserErrorCode.con2('W ITH_BEFORE_EXTENDS', 113, "The extends clause must be before the with clause");
5772 static final ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = new ParserE rrorCode.con2('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', 114, "The default value of a named parameter should be preceeded by ':'"); 5842 static final ParserErrorCode WITH_WITHOUT_EXTENDS = new ParserErrorCode.con2(' WITH_WITHOUT_EXTENDS', 114, "The with clause cannot be used without an extends c lause");
5773 static final ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = new Pa rserErrorCode.con2('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', 115, "The default value of a positional parameter should be preceeded by '='"); 5843 static final ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = new ParserE rrorCode.con2('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', 115, "The default value of a named parameter should be preceeded by ':'");
5774 static final ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = new Parser ErrorCode.con2('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', 116, "Expected '%s' to cl ose parameter group"); 5844 static final ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = new Pa rserErrorCode.con2('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', 116, "The default value of a positional parameter should be preceeded by '='");
5775 static final ParserErrorCode VAR_AS_TYPE_NAME = new ParserErrorCode.con2('VAR_ AS_TYPE_NAME', 117, "The keyword 'var' cannot be used as a type name"); 5845 static final ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = new Parser ErrorCode.con2('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', 117, "Expected '%s' to cl ose parameter group");
5776 static final ParserErrorCode VAR_CLASS = new ParserErrorCode.con2('VAR_CLASS', 118, "Classes cannot be declared to be 'var'"); 5846 static final ParserErrorCode VAR_AND_TYPE = new ParserErrorCode.con2('VAR_AND_ TYPE', 118, "Variables cannot be declared using both 'var' and a type name; remo ve the 'var'");
5777 static final ParserErrorCode VAR_RETURN_TYPE = new ParserErrorCode.con2('VAR_R ETURN_TYPE', 119, "The return type cannot be 'var'"); 5847 static final ParserErrorCode VAR_AS_TYPE_NAME = new ParserErrorCode.con2('VAR_ AS_TYPE_NAME', 119, "The keyword 'var' cannot be used as a type name");
5778 static final ParserErrorCode VAR_TYPEDEF = new ParserErrorCode.con2('VAR_TYPED EF', 120, "Type aliases cannot be declared to be 'var'"); 5848 static final ParserErrorCode VAR_CLASS = new ParserErrorCode.con2('VAR_CLASS', 120, "Classes cannot be declared to be 'var'");
5779 static final ParserErrorCode VOID_PARAMETER = new ParserErrorCode.con2('VOID_P ARAMETER', 121, "Parameters cannot have a type of 'void'"); 5849 static final ParserErrorCode VAR_RETURN_TYPE = new ParserErrorCode.con2('VAR_R ETURN_TYPE', 121, "The return type cannot be 'var'");
5780 static final ParserErrorCode VOID_VARIABLE = new ParserErrorCode.con2('VOID_VA RIABLE', 122, "Variables cannot have a type of 'void'"); 5850 static final ParserErrorCode VAR_TYPEDEF = new ParserErrorCode.con2('VAR_TYPED EF', 122, "Type aliases cannot be declared to be 'var'");
5781 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_CONSTRUCTOR_WITH_BODY, CONST_FACTORY, CONST_METHOD, CONST_TYPEDEF, CONSTRUCT OR_WITH_RETURN_TYPE, CONTINUE_OUTSIDE_OF_LOOP, CONTINUE_WITHOUT_LABEL_IN_CASE, D EPRECATED_ARGUMENT_DEFINITION_TEST, DIRECTIVE_AFTER_DECLARATION, DUPLICATE_LABEL _IN_SWITCH_STATEMENT, DUPLICATED_MODIFIER, EQUALITY_CANNOT_BE_EQUALITY_OPERAND, EXPECTED_CASE_OR_DEFAULT, EXPECTED_CLASS_MEMBER, EXPECTED_EXECUTABLE, EXPECTED_L IST_OR_MAP_LITERAL, EXPECTED_STRING_LITERAL, EXPECTED_TOKEN, EXPECTED_TWO_MAP_TY PE_ARGUMENTS, EXPECTED_TYPE_NAME, EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, EXTERNA L_AFTER_CONST, EXTERNAL_AFTER_FACTORY, EXTERNAL_AFTER_STATIC, EXTERNAL_CLASS, EX TERNAL_CONSTRUCTOR_WITH_BODY, EXTERNAL_FIELD, EXTERNAL_GETTER_WITH_BODY, EXTERNA L_METHOD_WITH_BODY, EXTERNAL_OPERATOR_WITH_BODY, EXTERNAL_SETTER_WITH_BODY, EXTE RNAL_TYPEDEF, FACTORY_TOP_LEVEL_DECLARATION, FACTORY_WITHOUT_BODY, FIELD_INITIAL IZER_OUTSIDE_CONSTRUCTOR, FINAL_AND_VAR, FINAL_CLASS, FINAL_CONSTRUCTOR, FINAL_M ETHOD, FINAL_TYPEDEF, FUNCTION_TYPED_PARAMETER_VAR, GETTER_WITH_PARAMETERS, ILLE GAL_ASSIGNMENT_TO_NON_ASSIGNABLE, IMPLEMENTS_BEFORE_EXTENDS, IMPLEMENTS_BEFORE_W ITH, IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, INITIALIZED_VARIABLE_IN_FOR_EACH, IN VALID_CODE_POINT, INVALID_COMMENT_REFERENCE, INVALID_HEX_ESCAPE, INVALID_OPERATO R, INVALID_OPERATOR_FOR_SUPER, INVALID_UNICODE_ESCAPE, LIBRARY_DIRECTIVE_NOT_FIR ST, LOCAL_FUNCTION_DECLARATION_MODIFIER, MISSING_ASSIGNABLE_SELECTOR, MISSING_CA TCH_OR_FINALLY, MISSING_CLASS_BODY, MISSING_CLOSING_PARENTHESIS, MISSING_CONST_F INAL_VAR_OR_TYPE, MISSING_EXPRESSION_IN_THROW, MISSING_FUNCTION_BODY, MISSING_FU NCTION_PARAMETERS, MISSING_IDENTIFIER, MISSING_KEYWORD_OPERATOR, MISSING_NAME_IN _LIBRARY_DIRECTIVE, MISSING_NAME_IN_PART_OF_DIRECTIVE, MISSING_STATEMENT, MISSIN G_TERMINATOR_FOR_PARAMETER_GROUP, MISSING_TYPEDEF_PARAMETERS, MISSING_VARIABLE_I N_FOR_EACH, MIXED_PARAMETER_GROUPS, MULTIPLE_EXTENDS_CLAUSES, MULTIPLE_IMPLEMENT S_CLAUSES, MULTIPLE_LIBRARY_DIRECTIVES, MULTIPLE_NAMED_PARAMETER_GROUPS, MULTIPL E_PART_OF_DIRECTIVES, MULTIPLE_POSITIONAL_PARAMETER_GROUPS, MULTIPLE_VARIABLES_I N_FOR_EACH, MULTIPLE_WITH_CLAUSES, NAMED_FUNCTION_EXPRESSION, NAMED_PARAMETER_OU TSIDE_GROUP, NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, NON_CONSTRUCTOR_FACTORY, NON_ IDENTIFIER_LIBRARY_NAME, NON_PART_OF_DIRECTIVE_IN_PART, NON_USER_DEFINABLE_OPERA TOR, NORMAL_BEFORE_OPTIONAL_PARAMETERS, POSITIONAL_AFTER_NAMED_ARGUMENT, POSITIO NAL_PARAMETER_OUTSIDE_GROUP, STATIC_AFTER_CONST, STATIC_AFTER_FINAL, STATIC_AFTE R_VAR, STATIC_CONSTRUCTOR, STATIC_GETTER_WITHOUT_BODY, STATIC_OPERATOR, STATIC_S ETTER_WITHOUT_BODY, STATIC_TOP_LEVEL_DECLARATION, SWITCH_HAS_CASE_AFTER_DEFAULT_ CASE, SWITCH_HAS_MULTIPLE_DEFAULT_CASES, TOP_LEVEL_OPERATOR, UNEXPECTED_TERMINAT OR_FOR_PARAMETER_GROUP, UNEXPECTED_TOKEN, WITH_BEFORE_EXTENDS, WITH_WITHOUT_EXTE NDS, WRONG_SEPARATOR_FOR_NAMED_PARAMETER, WRONG_SEPARATOR_FOR_POSITIONAL_PARAMET ER, WRONG_TERMINATOR_FOR_PARAMETER_GROUP, VAR_AS_TYPE_NAME, VAR_CLASS, VAR_RETUR N_TYPE, VAR_TYPEDEF, VOID_PARAMETER, VOID_VARIABLE]; 5851 static final ParserErrorCode VOID_PARAMETER = new ParserErrorCode.con2('VOID_P ARAMETER', 123, "Parameters cannot have a type of 'void'");
5852 static final ParserErrorCode VOID_VARIABLE = new ParserErrorCode.con2('VOID_VA RIABLE', 124, "Variables cannot have a type of 'void'");
5853 static final List<ParserErrorCode> values = [
5854 ABSTRACT_CLASS_MEMBER,
5855 ABSTRACT_STATIC_METHOD,
5856 ABSTRACT_TOP_LEVEL_FUNCTION,
5857 ABSTRACT_TOP_LEVEL_VARIABLE,
5858 ABSTRACT_TYPEDEF,
5859 BREAK_OUTSIDE_OF_LOOP,
5860 CONST_AND_FINAL,
5861 CONST_AND_VAR,
5862 CONST_CLASS,
5863 CONST_CONSTRUCTOR_WITH_BODY,
5864 CONST_FACTORY,
5865 CONST_METHOD,
5866 CONST_TYPEDEF,
5867 CONSTRUCTOR_WITH_RETURN_TYPE,
5868 CONTINUE_OUTSIDE_OF_LOOP,
5869 CONTINUE_WITHOUT_LABEL_IN_CASE,
5870 DEPRECATED_ARGUMENT_DEFINITION_TEST,
5871 DIRECTIVE_AFTER_DECLARATION,
5872 DUPLICATE_LABEL_IN_SWITCH_STATEMENT,
5873 DUPLICATED_MODIFIER,
5874 EQUALITY_CANNOT_BE_EQUALITY_OPERAND,
5875 EXPECTED_CASE_OR_DEFAULT,
5876 EXPECTED_CLASS_MEMBER,
5877 EXPECTED_EXECUTABLE,
5878 EXPECTED_LIST_OR_MAP_LITERAL,
5879 EXPECTED_STRING_LITERAL,
5880 EXPECTED_TOKEN,
5881 EXPECTED_TWO_MAP_TYPE_ARGUMENTS,
5882 EXPECTED_TYPE_NAME,
5883 EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
5884 EXTERNAL_AFTER_CONST,
5885 EXTERNAL_AFTER_FACTORY,
5886 EXTERNAL_AFTER_STATIC,
5887 EXTERNAL_CLASS,
5888 EXTERNAL_CONSTRUCTOR_WITH_BODY,
5889 EXTERNAL_FIELD,
5890 EXTERNAL_GETTER_WITH_BODY,
5891 EXTERNAL_METHOD_WITH_BODY,
5892 EXTERNAL_OPERATOR_WITH_BODY,
5893 EXTERNAL_SETTER_WITH_BODY,
5894 EXTERNAL_TYPEDEF,
5895 FACTORY_TOP_LEVEL_DECLARATION,
5896 FACTORY_WITHOUT_BODY,
5897 FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
5898 FINAL_AND_VAR,
5899 FINAL_CLASS,
5900 FINAL_CONSTRUCTOR,
5901 FINAL_METHOD,
5902 FINAL_TYPEDEF,
5903 FUNCTION_TYPED_PARAMETER_VAR,
5904 GETTER_WITH_PARAMETERS,
5905 ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE,
5906 IMPLEMENTS_BEFORE_EXTENDS,
5907 IMPLEMENTS_BEFORE_WITH,
5908 IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
5909 INITIALIZED_VARIABLE_IN_FOR_EACH,
5910 INVALID_CODE_POINT,
5911 INVALID_COMMENT_REFERENCE,
5912 INVALID_HEX_ESCAPE,
5913 INVALID_OPERATOR,
5914 INVALID_OPERATOR_FOR_SUPER,
5915 INVALID_UNICODE_ESCAPE,
5916 LIBRARY_DIRECTIVE_NOT_FIRST,
5917 LOCAL_FUNCTION_DECLARATION_MODIFIER,
5918 MISSING_ASSIGNABLE_SELECTOR,
5919 MISSING_CATCH_OR_FINALLY,
5920 MISSING_CLASS_BODY,
5921 MISSING_CLOSING_PARENTHESIS,
5922 MISSING_CONST_FINAL_VAR_OR_TYPE,
5923 MISSING_EXPRESSION_IN_THROW,
5924 MISSING_FUNCTION_BODY,
5925 MISSING_FUNCTION_PARAMETERS,
5926 MISSING_IDENTIFIER,
5927 MISSING_KEYWORD_OPERATOR,
5928 MISSING_NAME_IN_LIBRARY_DIRECTIVE,
5929 MISSING_NAME_IN_PART_OF_DIRECTIVE,
5930 MISSING_STATEMENT,
5931 MISSING_TERMINATOR_FOR_PARAMETER_GROUP,
5932 MISSING_TYPEDEF_PARAMETERS,
5933 MISSING_VARIABLE_IN_FOR_EACH,
5934 MIXED_PARAMETER_GROUPS,
5935 MULTIPLE_EXTENDS_CLAUSES,
5936 MULTIPLE_IMPLEMENTS_CLAUSES,
5937 MULTIPLE_LIBRARY_DIRECTIVES,
5938 MULTIPLE_NAMED_PARAMETER_GROUPS,
5939 MULTIPLE_PART_OF_DIRECTIVES,
5940 MULTIPLE_POSITIONAL_PARAMETER_GROUPS,
5941 MULTIPLE_VARIABLES_IN_FOR_EACH,
5942 MULTIPLE_WITH_CLAUSES,
5943 NAMED_FUNCTION_EXPRESSION,
5944 NAMED_PARAMETER_OUTSIDE_GROUP,
5945 NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE,
5946 NON_CONSTRUCTOR_FACTORY,
5947 NON_IDENTIFIER_LIBRARY_NAME,
5948 NON_PART_OF_DIRECTIVE_IN_PART,
5949 NON_USER_DEFINABLE_OPERATOR,
5950 NORMAL_BEFORE_OPTIONAL_PARAMETERS,
5951 POSITIONAL_AFTER_NAMED_ARGUMENT,
5952 POSITIONAL_PARAMETER_OUTSIDE_GROUP,
5953 REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR,
5954 STATIC_AFTER_CONST,
5955 STATIC_AFTER_FINAL,
5956 STATIC_AFTER_VAR,
5957 STATIC_CONSTRUCTOR,
5958 STATIC_GETTER_WITHOUT_BODY,
5959 STATIC_OPERATOR,
5960 STATIC_SETTER_WITHOUT_BODY,
5961 STATIC_TOP_LEVEL_DECLARATION,
5962 SWITCH_HAS_CASE_AFTER_DEFAULT_CASE,
5963 SWITCH_HAS_MULTIPLE_DEFAULT_CASES,
5964 TOP_LEVEL_OPERATOR,
5965 UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP,
5966 UNEXPECTED_TOKEN,
5967 WITH_BEFORE_EXTENDS,
5968 WITH_WITHOUT_EXTENDS,
5969 WRONG_SEPARATOR_FOR_NAMED_PARAMETER,
5970 WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER,
5971 WRONG_TERMINATOR_FOR_PARAMETER_GROUP,
5972 VAR_AND_TYPE,
5973 VAR_AS_TYPE_NAME,
5974 VAR_CLASS,
5975 VAR_RETURN_TYPE,
5976 VAR_TYPEDEF,
5977 VOID_PARAMETER,
5978 VOID_VARIABLE];
5782 5979
5783 /// The name of this enum constant, as declared in the enum declaration. 5980 /// The name of this enum constant, as declared in the enum declaration.
5784 final String name; 5981 final String name;
5785 5982
5786 /// The position in the enum declaration. 5983 /// The position in the enum declaration.
5787 final int ordinal; 5984 final int ordinal;
5788 5985
5789 /** 5986 /**
5790 * The severity of this error. 5987 * The severity of this error.
5791 */ 5988 */
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
6305 _writer.print(node.name); 6502 _writer.print(node.name);
6306 return null; 6503 return null;
6307 } 6504 }
6308 Object visitListLiteral(ListLiteral node) { 6505 Object visitListLiteral(ListLiteral node) {
6309 if (node.modifier != null) { 6506 if (node.modifier != null) {
6310 _writer.print(node.modifier.lexeme); 6507 _writer.print(node.modifier.lexeme);
6311 _writer.print(' '); 6508 _writer.print(' ');
6312 } 6509 }
6313 visit6(node.typeArguments, " "); 6510 visit6(node.typeArguments, " ");
6314 _writer.print("["); 6511 _writer.print("[");
6315 visitList5(node.elements, ", "); 6512 {
6513 NodeList<Expression> elements = node.elements;
6514 if (elements.length < 2 || elements.toString().length < 60) {
6515 visitList5(elements, ", ");
6516 } else {
6517 String elementIndent = "${_indentString} ";
6518 _writer.print("\n");
6519 _writer.print(elementIndent);
6520 visitList5(elements, ",\n${elementIndent}");
6521 }
6522 }
6316 _writer.print("]"); 6523 _writer.print("]");
6317 return null; 6524 return null;
6318 } 6525 }
6319 Object visitMapLiteral(MapLiteral node) { 6526 Object visitMapLiteral(MapLiteral node) {
6320 if (node.modifier != null) { 6527 if (node.modifier != null) {
6321 _writer.print(node.modifier.lexeme); 6528 _writer.print(node.modifier.lexeme);
6322 _writer.print(' '); 6529 _writer.print(' ');
6323 } 6530 }
6324 visit6(node.typeArguments, " "); 6531 visit6(node.typeArguments, " ");
6325 _writer.print("{"); 6532 _writer.print("{");
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
6358 } 6565 }
6359 visit(node.methodName); 6566 visit(node.methodName);
6360 visit(node.argumentList); 6567 visit(node.argumentList);
6361 return null; 6568 return null;
6362 } 6569 }
6363 Object visitNamedExpression(NamedExpression node) { 6570 Object visitNamedExpression(NamedExpression node) {
6364 visit(node.name); 6571 visit(node.name);
6365 visit7(" ", node.expression); 6572 visit7(" ", node.expression);
6366 return null; 6573 return null;
6367 } 6574 }
6575 Object visitNativeClause(NativeClause node) {
6576 _writer.print("native ");
6577 visit(node.name);
6578 return null;
6579 }
6368 Object visitNativeFunctionBody(NativeFunctionBody node) { 6580 Object visitNativeFunctionBody(NativeFunctionBody node) {
6369 _writer.print("native "); 6581 _writer.print("native ");
6370 visit(node.stringLiteral); 6582 visit(node.stringLiteral);
6371 _writer.print(';'); 6583 _writer.print(';');
6372 return null; 6584 return null;
6373 } 6585 }
6374 Object visitNullLiteral(NullLiteral node) { 6586 Object visitNullLiteral(NullLiteral node) {
6375 _writer.print("null"); 6587 _writer.print("null");
6376 return null; 6588 return null;
6377 } 6589 }
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
6724 for (int i = 0; i < size; i++) { 6936 for (int i = 0; i < size; i++) {
6725 if (i > 0) { 6937 if (i > 0) {
6726 _writer.print(separator); 6938 _writer.print(separator);
6727 } 6939 }
6728 nodes[i].accept(this); 6940 nodes[i].accept(this);
6729 } 6941 }
6730 } 6942 }
6731 } 6943 }
6732 } 6944 }
6733 } 6945 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/html.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