| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 |
| 3 library engine.parser; | 4 library engine.parser; |
| 5 |
| 4 import 'dart:collection'; | 6 import 'dart:collection'; |
| 5 import 'java_core.dart'; | 7 import 'java_core.dart'; |
| 6 import 'instrumentation.dart'; | 8 import 'instrumentation.dart'; |
| 7 import 'error.dart'; | 9 import 'error.dart'; |
| 8 import 'source.dart'; | 10 import 'source.dart'; |
| 9 import 'scanner.dart'; | 11 import 'scanner.dart'; |
| 10 import 'ast.dart'; | 12 import 'ast.dart'; |
| 11 import 'utilities_dart.dart'; | 13 import 'utilities_dart.dart'; |
| 12 import 'engine.dart' show AnalysisEngine; | 14 import 'engine.dart' show AnalysisEngine; |
| 13 import 'utilities_collection.dart' show TokenMap; | 15 import 'utilities_collection.dart' show TokenMap; |
| 16 |
| 14 /** | 17 /** |
| 15 * Instances of the class `CommentAndMetadata` implement a simple data-holder fo
r a method | 18 * Instances of the class `CommentAndMetadata` implement a simple data-holder fo
r a method |
| 16 * that needs to return multiple values. | 19 * that needs to return multiple values. |
| 17 * | 20 * |
| 18 * @coverage dart.engine.parser | 21 * @coverage dart.engine.parser |
| 19 */ | 22 */ |
| 20 class CommentAndMetadata { | 23 class CommentAndMetadata { |
| 21 | |
| 22 /** | 24 /** |
| 23 * The documentation comment that was parsed, or `null` if none was given. | 25 * The documentation comment that was parsed, or `null` if none was given. |
| 24 */ | 26 */ |
| 25 Comment comment; | 27 Comment comment; |
| 26 | 28 |
| 27 /** | 29 /** |
| 28 * The metadata that was parsed. | 30 * The metadata that was parsed. |
| 29 */ | 31 */ |
| 30 List<Annotation> metadata; | 32 List<Annotation> metadata; |
| 31 | 33 |
| 32 /** | 34 /** |
| 33 * Initialize a newly created holder with the given data. | 35 * Initialize a newly created holder with the given data. |
| 34 * | 36 * |
| 35 * @param comment the documentation comment that was parsed | 37 * @param comment the documentation comment that was parsed |
| 36 * @param metadata the metadata that was parsed | 38 * @param metadata the metadata that was parsed |
| 37 */ | 39 */ |
| 38 CommentAndMetadata(Comment comment, List<Annotation> metadata) { | 40 CommentAndMetadata(Comment comment, List<Annotation> metadata) { |
| 39 this.comment = comment; | 41 this.comment = comment; |
| 40 this.metadata = metadata; | 42 this.metadata = metadata; |
| 41 } | 43 } |
| 42 } | 44 } |
| 45 |
| 43 /** | 46 /** |
| 44 * Instances of the class `FinalConstVarOrType` implement a simple data-holder f
or a method | 47 * Instances of the class `FinalConstVarOrType` implement a simple data-holder f
or a method |
| 45 * that needs to return multiple values. | 48 * that needs to return multiple values. |
| 46 * | 49 * |
| 47 * @coverage dart.engine.parser | 50 * @coverage dart.engine.parser |
| 48 */ | 51 */ |
| 49 class FinalConstVarOrType { | 52 class FinalConstVarOrType { |
| 50 | |
| 51 /** | 53 /** |
| 52 * The 'final', 'const' or 'var' keyword, or `null` if none was given. | 54 * The 'final', 'const' or 'var' keyword, or `null` if none was given. |
| 53 */ | 55 */ |
| 54 Token keyword; | 56 Token keyword; |
| 55 | 57 |
| 56 /** | 58 /** |
| 57 * The type, of `null` if no type was specified. | 59 * The type, of `null` if no type was specified. |
| 58 */ | 60 */ |
| 59 TypeName type; | 61 TypeName type; |
| 60 | 62 |
| 61 /** | 63 /** |
| 62 * Initialize a newly created holder with the given data. | 64 * Initialize a newly created holder with the given data. |
| 63 * | 65 * |
| 64 * @param keyword the 'final', 'const' or 'var' keyword | 66 * @param keyword the 'final', 'const' or 'var' keyword |
| 65 * @param type the type | 67 * @param type the type |
| 66 */ | 68 */ |
| 67 FinalConstVarOrType(Token keyword, TypeName type) { | 69 FinalConstVarOrType(Token keyword, TypeName type) { |
| 68 this.keyword = keyword; | 70 this.keyword = keyword; |
| 69 this.type = type; | 71 this.type = type; |
| 70 } | 72 } |
| 71 } | 73 } |
| 74 |
| 72 /** | 75 /** |
| 73 * Instances of the class `Modifiers` implement a simple data-holder for a metho
d that needs | 76 * Instances of the class `Modifiers` implement a simple data-holder for a metho
d that needs |
| 74 * to return multiple values. | 77 * to return multiple values. |
| 75 * | 78 * |
| 76 * @coverage dart.engine.parser | 79 * @coverage dart.engine.parser |
| 77 */ | 80 */ |
| 78 class Modifiers { | 81 class Modifiers { |
| 79 | |
| 80 /** | 82 /** |
| 81 * The token representing the keyword 'abstract', or `null` if the keyword was
not found. | 83 * The token representing the keyword 'abstract', or `null` if the keyword was
not found. |
| 82 */ | 84 */ |
| 83 Token abstractKeyword; | 85 Token abstractKeyword; |
| 84 | 86 |
| 85 /** | 87 /** |
| 86 * The token representing the keyword 'const', or `null` if the keyword was no
t found. | 88 * The token representing the keyword 'const', or `null` if the keyword was no
t found. |
| 87 */ | 89 */ |
| 88 Token constKeyword; | 90 Token constKeyword; |
| 89 | 91 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 104 | 106 |
| 105 /** | 107 /** |
| 106 * The token representing the keyword 'static', or `null` if the keyword was n
ot found. | 108 * The token representing the keyword 'static', or `null` if the keyword was n
ot found. |
| 107 */ | 109 */ |
| 108 Token staticKeyword; | 110 Token staticKeyword; |
| 109 | 111 |
| 110 /** | 112 /** |
| 111 * The token representing the keyword 'var', or `null` if the keyword was not
found. | 113 * The token representing the keyword 'var', or `null` if the keyword was not
found. |
| 112 */ | 114 */ |
| 113 Token varKeyword; | 115 Token varKeyword; |
| 116 |
| 114 String toString() { | 117 String toString() { |
| 115 JavaStringBuilder builder = new JavaStringBuilder(); | 118 JavaStringBuilder builder = new JavaStringBuilder(); |
| 116 bool needsSpace = appendKeyword(builder, false, abstractKeyword); | 119 bool needsSpace = appendKeyword(builder, false, abstractKeyword); |
| 117 needsSpace = appendKeyword(builder, needsSpace, constKeyword); | 120 needsSpace = appendKeyword(builder, needsSpace, constKeyword); |
| 118 needsSpace = appendKeyword(builder, needsSpace, externalKeyword); | 121 needsSpace = appendKeyword(builder, needsSpace, externalKeyword); |
| 119 needsSpace = appendKeyword(builder, needsSpace, factoryKeyword); | 122 needsSpace = appendKeyword(builder, needsSpace, factoryKeyword); |
| 120 needsSpace = appendKeyword(builder, needsSpace, finalKeyword); | 123 needsSpace = appendKeyword(builder, needsSpace, finalKeyword); |
| 121 needsSpace = appendKeyword(builder, needsSpace, staticKeyword); | 124 needsSpace = appendKeyword(builder, needsSpace, staticKeyword); |
| 122 appendKeyword(builder, needsSpace, varKeyword); | 125 appendKeyword(builder, needsSpace, varKeyword); |
| 123 return builder.toString(); | 126 return builder.toString(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 136 if (keyword != null) { | 139 if (keyword != null) { |
| 137 if (needsSpace) { | 140 if (needsSpace) { |
| 138 builder.appendChar(0x20); | 141 builder.appendChar(0x20); |
| 139 } | 142 } |
| 140 builder.append(keyword.lexeme); | 143 builder.append(keyword.lexeme); |
| 141 return true; | 144 return true; |
| 142 } | 145 } |
| 143 return needsSpace; | 146 return needsSpace; |
| 144 } | 147 } |
| 145 } | 148 } |
| 149 |
| 146 /** | 150 /** |
| 147 * Instances of the class `IncrementalParseDispatcher` implement a dispatcher th
at will invoke | 151 * Instances of the class `IncrementalParseDispatcher` implement a dispatcher th
at will invoke |
| 148 * the right parse method when re-parsing a specified child of the visited node.
All of the methods | 152 * the right parse method when re-parsing a specified child of the visited node.
All of the methods |
| 149 * in this class assume that the parser is positioned to parse the replacement f
or the node. All of | 153 * in this class assume that the parser is positioned to parse the replacement f
or the node. All of |
| 150 * the methods will throw an [IncrementalParseException] if the node could not b
e parsed for | 154 * the methods will throw an [IncrementalParseException] if the node could not b
e parsed for |
| 151 * some reason. | 155 * some reason. |
| 152 */ | 156 */ |
| 153 class IncrementalParseDispatcher implements ASTVisitor<ASTNode> { | 157 class IncrementalParseDispatcher implements ASTVisitor<ASTNode> { |
| 154 | |
| 155 /** | 158 /** |
| 156 * The parser used to parse the replacement for the node. | 159 * The parser used to parse the replacement for the node. |
| 157 */ | 160 */ |
| 158 Parser _parser; | 161 Parser _parser; |
| 159 | 162 |
| 160 /** | 163 /** |
| 161 * The node that is to be replaced. | 164 * The node that is to be replaced. |
| 162 */ | 165 */ |
| 163 ASTNode _oldNode; | 166 ASTNode _oldNode; |
| 164 | 167 |
| 165 /** | 168 /** |
| 166 * Initialize a newly created dispatcher to parse a single node that will repl
ace the given node. | 169 * Initialize a newly created dispatcher to parse a single node that will repl
ace the given node. |
| 167 * | 170 * |
| 168 * @param parser the parser used to parse the replacement for the node | 171 * @param parser the parser used to parse the replacement for the node |
| 169 * @param oldNode the node that is to be replaced | 172 * @param oldNode the node that is to be replaced |
| 170 */ | 173 */ |
| 171 IncrementalParseDispatcher(Parser parser, ASTNode oldNode) { | 174 IncrementalParseDispatcher(Parser parser, ASTNode oldNode) { |
| 172 this._parser = parser; | 175 this._parser = parser; |
| 173 this._oldNode = oldNode; | 176 this._oldNode = oldNode; |
| 174 } | 177 } |
| 178 |
| 175 ASTNode visitAdjacentStrings(AdjacentStrings node) { | 179 ASTNode visitAdjacentStrings(AdjacentStrings node) { |
| 176 if (node.strings.contains(_oldNode)) { | 180 if (node.strings.contains(_oldNode)) { |
| 177 return _parser.parseStringLiteral(); | 181 return _parser.parseStringLiteral(); |
| 178 } | 182 } |
| 179 return notAChild(node); | 183 return notAChild(node); |
| 180 } | 184 } |
| 185 |
| 181 ASTNode visitAnnotation(Annotation node) { | 186 ASTNode visitAnnotation(Annotation node) { |
| 182 if (identical(_oldNode, node.name)) { | 187 if (identical(_oldNode, node.name)) { |
| 183 throw new InsufficientContextException(); | 188 throw new InsufficientContextException(); |
| 184 } else if (identical(_oldNode, node.constructorName)) { | 189 } else if (identical(_oldNode, node.constructorName)) { |
| 185 throw new InsufficientContextException(); | 190 throw new InsufficientContextException(); |
| 186 } else if (identical(_oldNode, node.arguments)) { | 191 } else if (identical(_oldNode, node.arguments)) { |
| 187 return _parser.parseArgumentList(); | 192 return _parser.parseArgumentList(); |
| 188 } | 193 } |
| 189 return notAChild(node); | 194 return notAChild(node); |
| 190 } | 195 } |
| 196 |
| 191 ASTNode visitArgumentDefinitionTest(ArgumentDefinitionTest node) { | 197 ASTNode visitArgumentDefinitionTest(ArgumentDefinitionTest node) { |
| 192 if (identical(_oldNode, node.identifier)) { | 198 if (identical(_oldNode, node.identifier)) { |
| 193 return _parser.parseSimpleIdentifier(); | 199 return _parser.parseSimpleIdentifier(); |
| 194 } | 200 } |
| 195 return notAChild(node); | 201 return notAChild(node); |
| 196 } | 202 } |
| 203 |
| 197 ASTNode visitArgumentList(ArgumentList node) { | 204 ASTNode visitArgumentList(ArgumentList node) { |
| 198 if (node.arguments.contains(_oldNode)) { | 205 if (node.arguments.contains(_oldNode)) { |
| 199 return _parser.parseArgument(); | 206 return _parser.parseArgument(); |
| 200 } | 207 } |
| 201 return notAChild(node); | 208 return notAChild(node); |
| 202 } | 209 } |
| 210 |
| 203 ASTNode visitAsExpression(AsExpression node) { | 211 ASTNode visitAsExpression(AsExpression node) { |
| 204 if (identical(_oldNode, node.expression)) { | 212 if (identical(_oldNode, node.expression)) { |
| 205 return _parser.parseBitwiseOrExpression(); | 213 return _parser.parseBitwiseOrExpression(); |
| 206 } else if (identical(_oldNode, node.type)) { | 214 } else if (identical(_oldNode, node.type)) { |
| 207 return _parser.parseTypeName(); | 215 return _parser.parseTypeName(); |
| 208 } | 216 } |
| 209 return notAChild(node); | 217 return notAChild(node); |
| 210 } | 218 } |
| 219 |
| 211 ASTNode visitAssertStatement(AssertStatement node) { | 220 ASTNode visitAssertStatement(AssertStatement node) { |
| 212 if (identical(_oldNode, node.condition)) { | 221 if (identical(_oldNode, node.condition)) { |
| 213 return _parser.parseExpression2(); | 222 return _parser.parseExpression2(); |
| 214 } | 223 } |
| 215 return notAChild(node); | 224 return notAChild(node); |
| 216 } | 225 } |
| 226 |
| 217 ASTNode visitAssignmentExpression(AssignmentExpression node) { | 227 ASTNode visitAssignmentExpression(AssignmentExpression node) { |
| 218 if (identical(_oldNode, node.leftHandSide)) { | 228 if (identical(_oldNode, node.leftHandSide)) { |
| 219 throw new InsufficientContextException(); | 229 throw new InsufficientContextException(); |
| 220 } else if (identical(_oldNode, node.rightHandSide)) { | 230 } else if (identical(_oldNode, node.rightHandSide)) { |
| 221 if (isCascadeAllowed(node)) { | 231 if (isCascadeAllowed(node)) { |
| 222 return _parser.parseExpression2(); | 232 return _parser.parseExpression2(); |
| 223 } | 233 } |
| 224 return _parser.parseExpressionWithoutCascade(); | 234 return _parser.parseExpressionWithoutCascade(); |
| 225 } | 235 } |
| 226 return notAChild(node); | 236 return notAChild(node); |
| 227 } | 237 } |
| 238 |
| 228 ASTNode visitBinaryExpression(BinaryExpression node) { | 239 ASTNode visitBinaryExpression(BinaryExpression node) { |
| 229 if (identical(_oldNode, node.leftOperand)) { | 240 if (identical(_oldNode, node.leftOperand)) { |
| 230 throw new InsufficientContextException(); | 241 throw new InsufficientContextException(); |
| 231 } else if (identical(_oldNode, node.rightOperand)) { | 242 } else if (identical(_oldNode, node.rightOperand)) { |
| 232 throw new InsufficientContextException(); | 243 throw new InsufficientContextException(); |
| 233 } | 244 } |
| 234 return notAChild(node); | 245 return notAChild(node); |
| 235 } | 246 } |
| 247 |
| 236 ASTNode visitBlock(Block node) { | 248 ASTNode visitBlock(Block node) { |
| 237 if (node.statements.contains(_oldNode)) { | 249 if (node.statements.contains(_oldNode)) { |
| 238 return _parser.parseStatement2(); | 250 return _parser.parseStatement2(); |
| 239 } | 251 } |
| 240 return notAChild(node); | 252 return notAChild(node); |
| 241 } | 253 } |
| 254 |
| 242 ASTNode visitBlockFunctionBody(BlockFunctionBody node) { | 255 ASTNode visitBlockFunctionBody(BlockFunctionBody node) { |
| 243 if (identical(_oldNode, node.block)) { | 256 if (identical(_oldNode, node.block)) { |
| 244 return _parser.parseBlock(); | 257 return _parser.parseBlock(); |
| 245 } | 258 } |
| 246 return notAChild(node); | 259 return notAChild(node); |
| 247 } | 260 } |
| 261 |
| 248 ASTNode visitBooleanLiteral(BooleanLiteral node) => notAChild(node); | 262 ASTNode visitBooleanLiteral(BooleanLiteral node) => notAChild(node); |
| 263 |
| 249 ASTNode visitBreakStatement(BreakStatement node) { | 264 ASTNode visitBreakStatement(BreakStatement node) { |
| 250 if (identical(_oldNode, node.label)) { | 265 if (identical(_oldNode, node.label)) { |
| 251 return _parser.parseSimpleIdentifier(); | 266 return _parser.parseSimpleIdentifier(); |
| 252 } | 267 } |
| 253 return notAChild(node); | 268 return notAChild(node); |
| 254 } | 269 } |
| 270 |
| 255 ASTNode visitCascadeExpression(CascadeExpression node) { | 271 ASTNode visitCascadeExpression(CascadeExpression node) { |
| 256 if (identical(_oldNode, node.target)) { | 272 if (identical(_oldNode, node.target)) { |
| 257 return _parser.parseConditionalExpression(); | 273 return _parser.parseConditionalExpression(); |
| 258 } else if (node.cascadeSections.contains(_oldNode)) { | 274 } else if (node.cascadeSections.contains(_oldNode)) { |
| 259 throw new InsufficientContextException(); | 275 throw new InsufficientContextException(); |
| 260 } | 276 } |
| 261 return notAChild(node); | 277 return notAChild(node); |
| 262 } | 278 } |
| 279 |
| 263 ASTNode visitCatchClause(CatchClause node) { | 280 ASTNode visitCatchClause(CatchClause node) { |
| 264 if (identical(_oldNode, node.exceptionType)) { | 281 if (identical(_oldNode, node.exceptionType)) { |
| 265 return _parser.parseTypeName(); | 282 return _parser.parseTypeName(); |
| 266 } else if (identical(_oldNode, node.exceptionParameter)) { | 283 } else if (identical(_oldNode, node.exceptionParameter)) { |
| 267 return _parser.parseSimpleIdentifier(); | 284 return _parser.parseSimpleIdentifier(); |
| 268 } else if (identical(_oldNode, node.stackTraceParameter)) { | 285 } else if (identical(_oldNode, node.stackTraceParameter)) { |
| 269 return _parser.parseSimpleIdentifier(); | 286 return _parser.parseSimpleIdentifier(); |
| 270 } else if (identical(_oldNode, node.body)) { | 287 } else if (identical(_oldNode, node.body)) { |
| 271 return _parser.parseBlock(); | 288 return _parser.parseBlock(); |
| 272 } | 289 } |
| 273 return notAChild(node); | 290 return notAChild(node); |
| 274 } | 291 } |
| 292 |
| 275 ASTNode visitClassDeclaration(ClassDeclaration node) { | 293 ASTNode visitClassDeclaration(ClassDeclaration node) { |
| 276 if (identical(_oldNode, node.documentationComment)) { | 294 if (identical(_oldNode, node.documentationComment)) { |
| 277 throw new InsufficientContextException(); | 295 throw new InsufficientContextException(); |
| 278 } else if (node.metadata.contains(_oldNode)) { | 296 } else if (node.metadata.contains(_oldNode)) { |
| 279 return _parser.parseAnnotation(); | 297 return _parser.parseAnnotation(); |
| 280 } else if (identical(_oldNode, node.name)) { | 298 } else if (identical(_oldNode, node.name)) { |
| 281 return _parser.parseSimpleIdentifier(); | 299 return _parser.parseSimpleIdentifier(); |
| 282 } else if (identical(_oldNode, node.typeParameters)) { | 300 } else if (identical(_oldNode, node.typeParameters)) { |
| 283 return _parser.parseTypeParameterList(); | 301 return _parser.parseTypeParameterList(); |
| 284 } else if (identical(_oldNode, node.extendsClause)) { | 302 } else if (identical(_oldNode, node.extendsClause)) { |
| 285 return _parser.parseExtendsClause(); | 303 return _parser.parseExtendsClause(); |
| 286 } else if (identical(_oldNode, node.withClause)) { | 304 } else if (identical(_oldNode, node.withClause)) { |
| 287 return _parser.parseWithClause(); | 305 return _parser.parseWithClause(); |
| 288 } else if (identical(_oldNode, node.implementsClause)) { | 306 } else if (identical(_oldNode, node.implementsClause)) { |
| 289 return _parser.parseImplementsClause(); | 307 return _parser.parseImplementsClause(); |
| 290 } else if (node.members.contains(_oldNode)) { | 308 } else if (node.members.contains(_oldNode)) { |
| 291 return _parser.parseClassMember(node.name.name); | 309 return _parser.parseClassMember(node.name.name); |
| 292 } | 310 } |
| 293 return notAChild(node); | 311 return notAChild(node); |
| 294 } | 312 } |
| 313 |
| 295 ASTNode visitClassTypeAlias(ClassTypeAlias node) { | 314 ASTNode visitClassTypeAlias(ClassTypeAlias node) { |
| 296 if (identical(_oldNode, node.documentationComment)) { | 315 if (identical(_oldNode, node.documentationComment)) { |
| 297 throw new InsufficientContextException(); | 316 throw new InsufficientContextException(); |
| 298 } else if (node.metadata.contains(_oldNode)) { | 317 } else if (node.metadata.contains(_oldNode)) { |
| 299 return _parser.parseAnnotation(); | 318 return _parser.parseAnnotation(); |
| 300 } else if (identical(_oldNode, node.name)) { | 319 } else if (identical(_oldNode, node.name)) { |
| 301 return _parser.parseSimpleIdentifier(); | 320 return _parser.parseSimpleIdentifier(); |
| 302 } else if (identical(_oldNode, node.typeParameters)) { | 321 } else if (identical(_oldNode, node.typeParameters)) { |
| 303 return _parser.parseTypeParameterList(); | 322 return _parser.parseTypeParameterList(); |
| 304 } else if (identical(_oldNode, node.superclass)) { | 323 } else if (identical(_oldNode, node.superclass)) { |
| 305 return _parser.parseTypeName(); | 324 return _parser.parseTypeName(); |
| 306 } else if (identical(_oldNode, node.withClause)) { | 325 } else if (identical(_oldNode, node.withClause)) { |
| 307 return _parser.parseWithClause(); | 326 return _parser.parseWithClause(); |
| 308 } else if (identical(_oldNode, node.implementsClause)) { | 327 } else if (identical(_oldNode, node.implementsClause)) { |
| 309 return _parser.parseImplementsClause(); | 328 return _parser.parseImplementsClause(); |
| 310 } | 329 } |
| 311 return notAChild(node); | 330 return notAChild(node); |
| 312 } | 331 } |
| 332 |
| 313 ASTNode visitComment(Comment node) { | 333 ASTNode visitComment(Comment node) { |
| 314 throw new InsufficientContextException(); | 334 throw new InsufficientContextException(); |
| 315 } | 335 } |
| 336 |
| 316 ASTNode visitCommentReference(CommentReference node) { | 337 ASTNode visitCommentReference(CommentReference node) { |
| 317 if (identical(_oldNode, node.identifier)) { | 338 if (identical(_oldNode, node.identifier)) { |
| 318 return _parser.parsePrefixedIdentifier(); | 339 return _parser.parsePrefixedIdentifier(); |
| 319 } | 340 } |
| 320 return notAChild(node); | 341 return notAChild(node); |
| 321 } | 342 } |
| 343 |
| 322 ASTNode visitCompilationUnit(CompilationUnit node) { | 344 ASTNode visitCompilationUnit(CompilationUnit node) { |
| 323 throw new InsufficientContextException(); | 345 throw new InsufficientContextException(); |
| 324 } | 346 } |
| 347 |
| 325 ASTNode visitConditionalExpression(ConditionalExpression node) { | 348 ASTNode visitConditionalExpression(ConditionalExpression node) { |
| 326 if (identical(_oldNode, node.condition)) { | 349 if (identical(_oldNode, node.condition)) { |
| 327 return _parser.parseLogicalOrExpression(); | 350 return _parser.parseLogicalOrExpression(); |
| 328 } else if (identical(_oldNode, node.thenExpression)) { | 351 } else if (identical(_oldNode, node.thenExpression)) { |
| 329 return _parser.parseExpressionWithoutCascade(); | 352 return _parser.parseExpressionWithoutCascade(); |
| 330 } else if (identical(_oldNode, node.elseExpression)) { | 353 } else if (identical(_oldNode, node.elseExpression)) { |
| 331 return _parser.parseExpressionWithoutCascade(); | 354 return _parser.parseExpressionWithoutCascade(); |
| 332 } | 355 } |
| 333 return notAChild(node); | 356 return notAChild(node); |
| 334 } | 357 } |
| 358 |
| 335 ASTNode visitConstructorDeclaration(ConstructorDeclaration node) { | 359 ASTNode visitConstructorDeclaration(ConstructorDeclaration node) { |
| 336 if (identical(_oldNode, node.documentationComment)) { | 360 if (identical(_oldNode, node.documentationComment)) { |
| 337 throw new InsufficientContextException(); | 361 throw new InsufficientContextException(); |
| 338 } else if (node.metadata.contains(_oldNode)) { | 362 } else if (node.metadata.contains(_oldNode)) { |
| 339 return _parser.parseAnnotation(); | 363 return _parser.parseAnnotation(); |
| 340 } else if (identical(_oldNode, node.returnType)) { | 364 } else if (identical(_oldNode, node.returnType)) { |
| 341 throw new InsufficientContextException(); | 365 throw new InsufficientContextException(); |
| 342 } else if (identical(_oldNode, node.name)) { | 366 } else if (identical(_oldNode, node.name)) { |
| 343 throw new InsufficientContextException(); | 367 throw new InsufficientContextException(); |
| 344 } else if (identical(_oldNode, node.parameters)) { | 368 } else if (identical(_oldNode, node.parameters)) { |
| 345 return _parser.parseFormalParameterList(); | 369 return _parser.parseFormalParameterList(); |
| 346 } else if (identical(_oldNode, node.redirectedConstructor)) { | 370 } else if (identical(_oldNode, node.redirectedConstructor)) { |
| 347 throw new InsufficientContextException(); | 371 throw new InsufficientContextException(); |
| 348 } else if (node.initializers.contains(_oldNode)) { | 372 } else if (node.initializers.contains(_oldNode)) { |
| 349 throw new InsufficientContextException(); | 373 throw new InsufficientContextException(); |
| 350 } else if (identical(_oldNode, node.body)) { | 374 } else if (identical(_oldNode, node.body)) { |
| 351 throw new InsufficientContextException(); | 375 throw new InsufficientContextException(); |
| 352 } | 376 } |
| 353 return notAChild(node); | 377 return notAChild(node); |
| 354 } | 378 } |
| 379 |
| 355 ASTNode visitConstructorFieldInitializer(ConstructorFieldInitializer node) { | 380 ASTNode visitConstructorFieldInitializer(ConstructorFieldInitializer node) { |
| 356 if (identical(_oldNode, node.fieldName)) { | 381 if (identical(_oldNode, node.fieldName)) { |
| 357 return _parser.parseSimpleIdentifier(); | 382 return _parser.parseSimpleIdentifier(); |
| 358 } else if (identical(_oldNode, node.expression)) { | 383 } else if (identical(_oldNode, node.expression)) { |
| 359 throw new InsufficientContextException(); | 384 throw new InsufficientContextException(); |
| 360 } | 385 } |
| 361 return notAChild(node); | 386 return notAChild(node); |
| 362 } | 387 } |
| 388 |
| 363 ASTNode visitConstructorName(ConstructorName node) { | 389 ASTNode visitConstructorName(ConstructorName node) { |
| 364 if (identical(_oldNode, node.type)) { | 390 if (identical(_oldNode, node.type)) { |
| 365 return _parser.parseTypeName(); | 391 return _parser.parseTypeName(); |
| 366 } else if (identical(_oldNode, node.name)) { | 392 } else if (identical(_oldNode, node.name)) { |
| 367 return _parser.parseSimpleIdentifier(); | 393 return _parser.parseSimpleIdentifier(); |
| 368 } | 394 } |
| 369 return notAChild(node); | 395 return notAChild(node); |
| 370 } | 396 } |
| 397 |
| 371 ASTNode visitContinueStatement(ContinueStatement node) { | 398 ASTNode visitContinueStatement(ContinueStatement node) { |
| 372 if (identical(_oldNode, node.label)) { | 399 if (identical(_oldNode, node.label)) { |
| 373 return _parser.parseSimpleIdentifier(); | 400 return _parser.parseSimpleIdentifier(); |
| 374 } | 401 } |
| 375 return notAChild(node); | 402 return notAChild(node); |
| 376 } | 403 } |
| 404 |
| 377 ASTNode visitDeclaredIdentifier(DeclaredIdentifier node) { | 405 ASTNode visitDeclaredIdentifier(DeclaredIdentifier node) { |
| 378 if (identical(_oldNode, node.documentationComment)) { | 406 if (identical(_oldNode, node.documentationComment)) { |
| 379 throw new InsufficientContextException(); | 407 throw new InsufficientContextException(); |
| 380 } else if (node.metadata.contains(_oldNode)) { | 408 } else if (node.metadata.contains(_oldNode)) { |
| 381 return _parser.parseAnnotation(); | 409 return _parser.parseAnnotation(); |
| 382 } else if (identical(_oldNode, node.type)) { | 410 } else if (identical(_oldNode, node.type)) { |
| 383 throw new InsufficientContextException(); | 411 throw new InsufficientContextException(); |
| 384 } else if (identical(_oldNode, node.identifier)) { | 412 } else if (identical(_oldNode, node.identifier)) { |
| 385 return _parser.parseSimpleIdentifier(); | 413 return _parser.parseSimpleIdentifier(); |
| 386 } | 414 } |
| 387 return notAChild(node); | 415 return notAChild(node); |
| 388 } | 416 } |
| 417 |
| 389 ASTNode visitDefaultFormalParameter(DefaultFormalParameter node) { | 418 ASTNode visitDefaultFormalParameter(DefaultFormalParameter node) { |
| 390 if (identical(_oldNode, node.parameter)) { | 419 if (identical(_oldNode, node.parameter)) { |
| 391 return _parser.parseNormalFormalParameter(); | 420 return _parser.parseNormalFormalParameter(); |
| 392 } else if (identical(_oldNode, node.defaultValue)) { | 421 } else if (identical(_oldNode, node.defaultValue)) { |
| 393 return _parser.parseExpression2(); | 422 return _parser.parseExpression2(); |
| 394 } | 423 } |
| 395 return notAChild(node); | 424 return notAChild(node); |
| 396 } | 425 } |
| 426 |
| 397 ASTNode visitDoStatement(DoStatement node) { | 427 ASTNode visitDoStatement(DoStatement node) { |
| 398 if (identical(_oldNode, node.body)) { | 428 if (identical(_oldNode, node.body)) { |
| 399 return _parser.parseStatement2(); | 429 return _parser.parseStatement2(); |
| 400 } else if (identical(_oldNode, node.condition)) { | 430 } else if (identical(_oldNode, node.condition)) { |
| 401 return _parser.parseExpression2(); | 431 return _parser.parseExpression2(); |
| 402 } | 432 } |
| 403 return notAChild(node); | 433 return notAChild(node); |
| 404 } | 434 } |
| 435 |
| 405 ASTNode visitDoubleLiteral(DoubleLiteral node) => notAChild(node); | 436 ASTNode visitDoubleLiteral(DoubleLiteral node) => notAChild(node); |
| 437 |
| 406 ASTNode visitEmptyFunctionBody(EmptyFunctionBody node) => notAChild(node); | 438 ASTNode visitEmptyFunctionBody(EmptyFunctionBody node) => notAChild(node); |
| 439 |
| 407 ASTNode visitEmptyStatement(EmptyStatement node) => notAChild(node); | 440 ASTNode visitEmptyStatement(EmptyStatement node) => notAChild(node); |
| 441 |
| 408 ASTNode visitExportDirective(ExportDirective node) { | 442 ASTNode visitExportDirective(ExportDirective node) { |
| 409 if (identical(_oldNode, node.documentationComment)) { | 443 if (identical(_oldNode, node.documentationComment)) { |
| 410 throw new InsufficientContextException(); | 444 throw new InsufficientContextException(); |
| 411 } else if (node.metadata.contains(_oldNode)) { | 445 } else if (node.metadata.contains(_oldNode)) { |
| 412 return _parser.parseAnnotation(); | 446 return _parser.parseAnnotation(); |
| 413 } else if (identical(_oldNode, node.uri)) { | 447 } else if (identical(_oldNode, node.uri)) { |
| 414 return _parser.parseStringLiteral(); | 448 return _parser.parseStringLiteral(); |
| 415 } else if (node.combinators.contains(_oldNode)) { | 449 } else if (node.combinators.contains(_oldNode)) { |
| 416 throw new IncrementalParseException(); | 450 throw new IncrementalParseException(); |
| 417 } | 451 } |
| 418 return notAChild(node); | 452 return notAChild(node); |
| 419 } | 453 } |
| 454 |
| 420 ASTNode visitExpressionFunctionBody(ExpressionFunctionBody node) { | 455 ASTNode visitExpressionFunctionBody(ExpressionFunctionBody node) { |
| 421 if (identical(_oldNode, node.expression)) { | 456 if (identical(_oldNode, node.expression)) { |
| 422 return _parser.parseExpression2(); | 457 return _parser.parseExpression2(); |
| 423 } | 458 } |
| 424 return notAChild(node); | 459 return notAChild(node); |
| 425 } | 460 } |
| 461 |
| 426 ASTNode visitExpressionStatement(ExpressionStatement node) { | 462 ASTNode visitExpressionStatement(ExpressionStatement node) { |
| 427 if (identical(_oldNode, node.expression)) { | 463 if (identical(_oldNode, node.expression)) { |
| 428 return _parser.parseExpression2(); | 464 return _parser.parseExpression2(); |
| 429 } | 465 } |
| 430 return notAChild(node); | 466 return notAChild(node); |
| 431 } | 467 } |
| 468 |
| 432 ASTNode visitExtendsClause(ExtendsClause node) { | 469 ASTNode visitExtendsClause(ExtendsClause node) { |
| 433 if (identical(_oldNode, node.superclass)) { | 470 if (identical(_oldNode, node.superclass)) { |
| 434 return _parser.parseTypeName(); | 471 return _parser.parseTypeName(); |
| 435 } | 472 } |
| 436 return notAChild(node); | 473 return notAChild(node); |
| 437 } | 474 } |
| 475 |
| 438 ASTNode visitFieldDeclaration(FieldDeclaration node) { | 476 ASTNode visitFieldDeclaration(FieldDeclaration node) { |
| 439 if (identical(_oldNode, node.documentationComment)) { | 477 if (identical(_oldNode, node.documentationComment)) { |
| 440 throw new InsufficientContextException(); | 478 throw new InsufficientContextException(); |
| 441 } else if (node.metadata.contains(_oldNode)) { | 479 } else if (node.metadata.contains(_oldNode)) { |
| 442 return _parser.parseAnnotation(); | 480 return _parser.parseAnnotation(); |
| 443 } else if (identical(_oldNode, node.fields)) { | 481 } else if (identical(_oldNode, node.fields)) { |
| 444 throw new InsufficientContextException(); | 482 throw new InsufficientContextException(); |
| 445 } | 483 } |
| 446 return notAChild(node); | 484 return notAChild(node); |
| 447 } | 485 } |
| 486 |
| 448 ASTNode visitFieldFormalParameter(FieldFormalParameter node) { | 487 ASTNode visitFieldFormalParameter(FieldFormalParameter node) { |
| 449 if (identical(_oldNode, node.documentationComment)) { | 488 if (identical(_oldNode, node.documentationComment)) { |
| 450 throw new InsufficientContextException(); | 489 throw new InsufficientContextException(); |
| 451 } else if (node.metadata.contains(_oldNode)) { | 490 } else if (node.metadata.contains(_oldNode)) { |
| 452 return _parser.parseAnnotation(); | 491 return _parser.parseAnnotation(); |
| 453 } else if (identical(_oldNode, node.type)) { | 492 } else if (identical(_oldNode, node.type)) { |
| 454 return _parser.parseTypeName(); | 493 return _parser.parseTypeName(); |
| 455 } else if (identical(_oldNode, node.identifier)) { | 494 } else if (identical(_oldNode, node.identifier)) { |
| 456 return _parser.parseSimpleIdentifier(); | 495 return _parser.parseSimpleIdentifier(); |
| 457 } else if (identical(_oldNode, node.parameters)) { | 496 } else if (identical(_oldNode, node.parameters)) { |
| 458 return _parser.parseFormalParameterList(); | 497 return _parser.parseFormalParameterList(); |
| 459 } | 498 } |
| 460 return notAChild(node); | 499 return notAChild(node); |
| 461 } | 500 } |
| 501 |
| 462 ASTNode visitForEachStatement(ForEachStatement node) { | 502 ASTNode visitForEachStatement(ForEachStatement node) { |
| 463 if (identical(_oldNode, node.loopVariable)) { | 503 if (identical(_oldNode, node.loopVariable)) { |
| 464 throw new InsufficientContextException(); | 504 throw new InsufficientContextException(); |
| 465 } else if (identical(_oldNode, node.identifier)) { | 505 } else if (identical(_oldNode, node.identifier)) { |
| 466 return _parser.parseSimpleIdentifier(); | 506 return _parser.parseSimpleIdentifier(); |
| 467 } else if (identical(_oldNode, node.body)) { | 507 } else if (identical(_oldNode, node.body)) { |
| 468 return _parser.parseStatement2(); | 508 return _parser.parseStatement2(); |
| 469 } | 509 } |
| 470 return notAChild(node); | 510 return notAChild(node); |
| 471 } | 511 } |
| 512 |
| 472 ASTNode visitFormalParameterList(FormalParameterList node) { | 513 ASTNode visitFormalParameterList(FormalParameterList node) { |
| 473 throw new InsufficientContextException(); | 514 throw new InsufficientContextException(); |
| 474 } | 515 } |
| 516 |
| 475 ASTNode visitForStatement(ForStatement node) { | 517 ASTNode visitForStatement(ForStatement node) { |
| 476 if (identical(_oldNode, node.variables)) { | 518 if (identical(_oldNode, node.variables)) { |
| 477 throw new InsufficientContextException(); | 519 throw new InsufficientContextException(); |
| 478 } else if (identical(_oldNode, node.initialization)) { | 520 } else if (identical(_oldNode, node.initialization)) { |
| 479 throw new InsufficientContextException(); | 521 throw new InsufficientContextException(); |
| 480 } else if (identical(_oldNode, node.condition)) { | 522 } else if (identical(_oldNode, node.condition)) { |
| 481 return _parser.parseExpression2(); | 523 return _parser.parseExpression2(); |
| 482 } else if (node.updaters.contains(_oldNode)) { | 524 } else if (node.updaters.contains(_oldNode)) { |
| 483 return _parser.parseExpression2(); | 525 return _parser.parseExpression2(); |
| 484 } else if (identical(_oldNode, node.body)) { | 526 } else if (identical(_oldNode, node.body)) { |
| 485 return _parser.parseStatement2(); | 527 return _parser.parseStatement2(); |
| 486 } | 528 } |
| 487 return notAChild(node); | 529 return notAChild(node); |
| 488 } | 530 } |
| 531 |
| 489 ASTNode visitFunctionDeclaration(FunctionDeclaration node) { | 532 ASTNode visitFunctionDeclaration(FunctionDeclaration node) { |
| 490 if (identical(_oldNode, node.documentationComment)) { | 533 if (identical(_oldNode, node.documentationComment)) { |
| 491 throw new InsufficientContextException(); | 534 throw new InsufficientContextException(); |
| 492 } else if (node.metadata.contains(_oldNode)) { | 535 } else if (node.metadata.contains(_oldNode)) { |
| 493 return _parser.parseAnnotation(); | 536 return _parser.parseAnnotation(); |
| 494 } else if (identical(_oldNode, node.returnType)) { | 537 } else if (identical(_oldNode, node.returnType)) { |
| 495 return _parser.parseReturnType(); | 538 return _parser.parseReturnType(); |
| 496 } else if (identical(_oldNode, node.name)) { | 539 } else if (identical(_oldNode, node.name)) { |
| 497 return _parser.parseSimpleIdentifier(); | 540 return _parser.parseSimpleIdentifier(); |
| 498 } else if (identical(_oldNode, node.functionExpression)) { | 541 } else if (identical(_oldNode, node.functionExpression)) { |
| 499 throw new InsufficientContextException(); | 542 throw new InsufficientContextException(); |
| 500 } | 543 } |
| 501 return notAChild(node); | 544 return notAChild(node); |
| 502 } | 545 } |
| 546 |
| 503 ASTNode visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { | 547 ASTNode visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { |
| 504 if (identical(_oldNode, node.functionDeclaration)) { | 548 if (identical(_oldNode, node.functionDeclaration)) { |
| 505 throw new InsufficientContextException(); | 549 throw new InsufficientContextException(); |
| 506 } | 550 } |
| 507 return notAChild(node); | 551 return notAChild(node); |
| 508 } | 552 } |
| 553 |
| 509 ASTNode visitFunctionExpression(FunctionExpression node) { | 554 ASTNode visitFunctionExpression(FunctionExpression node) { |
| 510 if (identical(_oldNode, node.parameters)) { | 555 if (identical(_oldNode, node.parameters)) { |
| 511 return _parser.parseFormalParameterList(); | 556 return _parser.parseFormalParameterList(); |
| 512 } else if (identical(_oldNode, node.body)) { | 557 } else if (identical(_oldNode, node.body)) { |
| 513 throw new InsufficientContextException(); | 558 throw new InsufficientContextException(); |
| 514 } | 559 } |
| 515 return notAChild(node); | 560 return notAChild(node); |
| 516 } | 561 } |
| 562 |
| 517 ASTNode visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { | 563 ASTNode visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { |
| 518 if (identical(_oldNode, node.function)) { | 564 if (identical(_oldNode, node.function)) { |
| 519 throw new InsufficientContextException(); | 565 throw new InsufficientContextException(); |
| 520 } else if (identical(_oldNode, node.argumentList)) { | 566 } else if (identical(_oldNode, node.argumentList)) { |
| 521 return _parser.parseArgumentList(); | 567 return _parser.parseArgumentList(); |
| 522 } | 568 } |
| 523 return notAChild(node); | 569 return notAChild(node); |
| 524 } | 570 } |
| 571 |
| 525 ASTNode visitFunctionTypeAlias(FunctionTypeAlias node) { | 572 ASTNode visitFunctionTypeAlias(FunctionTypeAlias node) { |
| 526 if (identical(_oldNode, node.documentationComment)) { | 573 if (identical(_oldNode, node.documentationComment)) { |
| 527 throw new InsufficientContextException(); | 574 throw new InsufficientContextException(); |
| 528 } else if (node.metadata.contains(_oldNode)) { | 575 } else if (node.metadata.contains(_oldNode)) { |
| 529 return _parser.parseAnnotation(); | 576 return _parser.parseAnnotation(); |
| 530 } else if (identical(_oldNode, node.returnType)) { | 577 } else if (identical(_oldNode, node.returnType)) { |
| 531 return _parser.parseReturnType(); | 578 return _parser.parseReturnType(); |
| 532 } else if (identical(_oldNode, node.name)) { | 579 } else if (identical(_oldNode, node.name)) { |
| 533 return _parser.parseSimpleIdentifier(); | 580 return _parser.parseSimpleIdentifier(); |
| 534 } else if (identical(_oldNode, node.typeParameters)) { | 581 } else if (identical(_oldNode, node.typeParameters)) { |
| 535 return _parser.parseTypeParameterList(); | 582 return _parser.parseTypeParameterList(); |
| 536 } else if (identical(_oldNode, node.parameters)) { | 583 } else if (identical(_oldNode, node.parameters)) { |
| 537 return _parser.parseFormalParameterList(); | 584 return _parser.parseFormalParameterList(); |
| 538 } | 585 } |
| 539 return notAChild(node); | 586 return notAChild(node); |
| 540 } | 587 } |
| 588 |
| 541 ASTNode visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { | 589 ASTNode visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { |
| 542 if (identical(_oldNode, node.documentationComment)) { | 590 if (identical(_oldNode, node.documentationComment)) { |
| 543 throw new InsufficientContextException(); | 591 throw new InsufficientContextException(); |
| 544 } else if (node.metadata.contains(_oldNode)) { | 592 } else if (node.metadata.contains(_oldNode)) { |
| 545 return _parser.parseAnnotation(); | 593 return _parser.parseAnnotation(); |
| 546 } else if (identical(_oldNode, node.returnType)) { | 594 } else if (identical(_oldNode, node.returnType)) { |
| 547 return _parser.parseReturnType(); | 595 return _parser.parseReturnType(); |
| 548 } else if (identical(_oldNode, node.identifier)) { | 596 } else if (identical(_oldNode, node.identifier)) { |
| 549 return _parser.parseSimpleIdentifier(); | 597 return _parser.parseSimpleIdentifier(); |
| 550 } else if (identical(_oldNode, node.parameters)) { | 598 } else if (identical(_oldNode, node.parameters)) { |
| 551 return _parser.parseFormalParameterList(); | 599 return _parser.parseFormalParameterList(); |
| 552 } | 600 } |
| 553 return notAChild(node); | 601 return notAChild(node); |
| 554 } | 602 } |
| 603 |
| 555 ASTNode visitHideCombinator(HideCombinator node) { | 604 ASTNode visitHideCombinator(HideCombinator node) { |
| 556 if (node.hiddenNames.contains(_oldNode)) { | 605 if (node.hiddenNames.contains(_oldNode)) { |
| 557 return _parser.parseSimpleIdentifier(); | 606 return _parser.parseSimpleIdentifier(); |
| 558 } | 607 } |
| 559 return notAChild(node); | 608 return notAChild(node); |
| 560 } | 609 } |
| 610 |
| 561 ASTNode visitIfStatement(IfStatement node) { | 611 ASTNode visitIfStatement(IfStatement node) { |
| 562 if (identical(_oldNode, node.condition)) { | 612 if (identical(_oldNode, node.condition)) { |
| 563 return _parser.parseExpression2(); | 613 return _parser.parseExpression2(); |
| 564 } else if (identical(_oldNode, node.thenStatement)) { | 614 } else if (identical(_oldNode, node.thenStatement)) { |
| 565 return _parser.parseStatement2(); | 615 return _parser.parseStatement2(); |
| 566 } else if (identical(_oldNode, node.elseStatement)) { | 616 } else if (identical(_oldNode, node.elseStatement)) { |
| 567 return _parser.parseStatement2(); | 617 return _parser.parseStatement2(); |
| 568 } | 618 } |
| 569 return notAChild(node); | 619 return notAChild(node); |
| 570 } | 620 } |
| 621 |
| 571 ASTNode visitImplementsClause(ImplementsClause node) { | 622 ASTNode visitImplementsClause(ImplementsClause node) { |
| 572 if (node.interfaces.contains(node)) { | 623 if (node.interfaces.contains(node)) { |
| 573 return _parser.parseTypeName(); | 624 return _parser.parseTypeName(); |
| 574 } | 625 } |
| 575 return notAChild(node); | 626 return notAChild(node); |
| 576 } | 627 } |
| 628 |
| 577 ASTNode visitImportDirective(ImportDirective node) { | 629 ASTNode visitImportDirective(ImportDirective node) { |
| 578 if (identical(_oldNode, node.documentationComment)) { | 630 if (identical(_oldNode, node.documentationComment)) { |
| 579 throw new InsufficientContextException(); | 631 throw new InsufficientContextException(); |
| 580 } else if (node.metadata.contains(_oldNode)) { | 632 } else if (node.metadata.contains(_oldNode)) { |
| 581 return _parser.parseAnnotation(); | 633 return _parser.parseAnnotation(); |
| 582 } else if (identical(_oldNode, node.uri)) { | 634 } else if (identical(_oldNode, node.uri)) { |
| 583 return _parser.parseStringLiteral(); | 635 return _parser.parseStringLiteral(); |
| 584 } else if (identical(_oldNode, node.prefix)) { | 636 } else if (identical(_oldNode, node.prefix)) { |
| 585 return _parser.parseSimpleIdentifier(); | 637 return _parser.parseSimpleIdentifier(); |
| 586 } else if (node.combinators.contains(_oldNode)) { | 638 } else if (node.combinators.contains(_oldNode)) { |
| 587 throw new IncrementalParseException(); | 639 throw new IncrementalParseException(); |
| 588 } | 640 } |
| 589 return notAChild(node); | 641 return notAChild(node); |
| 590 } | 642 } |
| 643 |
| 591 ASTNode visitIndexExpression(IndexExpression node) { | 644 ASTNode visitIndexExpression(IndexExpression node) { |
| 592 if (identical(_oldNode, node.target)) { | 645 if (identical(_oldNode, node.target)) { |
| 593 throw new InsufficientContextException(); | 646 throw new InsufficientContextException(); |
| 594 } else if (identical(_oldNode, node.index)) { | 647 } else if (identical(_oldNode, node.index)) { |
| 595 return _parser.parseExpression2(); | 648 return _parser.parseExpression2(); |
| 596 } | 649 } |
| 597 return notAChild(node); | 650 return notAChild(node); |
| 598 } | 651 } |
| 652 |
| 599 ASTNode visitInstanceCreationExpression(InstanceCreationExpression node) { | 653 ASTNode visitInstanceCreationExpression(InstanceCreationExpression node) { |
| 600 if (identical(_oldNode, node.constructorName)) { | 654 if (identical(_oldNode, node.constructorName)) { |
| 601 return _parser.parseConstructorName(); | 655 return _parser.parseConstructorName(); |
| 602 } else if (identical(_oldNode, node.argumentList)) { | 656 } else if (identical(_oldNode, node.argumentList)) { |
| 603 return _parser.parseArgumentList(); | 657 return _parser.parseArgumentList(); |
| 604 } | 658 } |
| 605 return notAChild(node); | 659 return notAChild(node); |
| 606 } | 660 } |
| 661 |
| 607 ASTNode visitIntegerLiteral(IntegerLiteral node) => notAChild(node); | 662 ASTNode visitIntegerLiteral(IntegerLiteral node) => notAChild(node); |
| 663 |
| 608 ASTNode visitInterpolationExpression(InterpolationExpression node) { | 664 ASTNode visitInterpolationExpression(InterpolationExpression node) { |
| 609 if (identical(_oldNode, node.expression)) { | 665 if (identical(_oldNode, node.expression)) { |
| 610 if (node.leftBracket == null) { | 666 if (node.leftBracket == null) { |
| 611 throw new InsufficientContextException(); | 667 throw new InsufficientContextException(); |
| 612 } | 668 } |
| 613 return _parser.parseExpression2(); | 669 return _parser.parseExpression2(); |
| 614 } | 670 } |
| 615 return notAChild(node); | 671 return notAChild(node); |
| 616 } | 672 } |
| 673 |
| 617 ASTNode visitInterpolationString(InterpolationString node) { | 674 ASTNode visitInterpolationString(InterpolationString node) { |
| 618 throw new InsufficientContextException(); | 675 throw new InsufficientContextException(); |
| 619 } | 676 } |
| 677 |
| 620 ASTNode visitIsExpression(IsExpression node) { | 678 ASTNode visitIsExpression(IsExpression node) { |
| 621 if (identical(_oldNode, node.expression)) { | 679 if (identical(_oldNode, node.expression)) { |
| 622 return _parser.parseBitwiseOrExpression(); | 680 return _parser.parseBitwiseOrExpression(); |
| 623 } else if (identical(_oldNode, node.type)) { | 681 } else if (identical(_oldNode, node.type)) { |
| 624 return _parser.parseTypeName(); | 682 return _parser.parseTypeName(); |
| 625 } | 683 } |
| 626 return notAChild(node); | 684 return notAChild(node); |
| 627 } | 685 } |
| 686 |
| 628 ASTNode visitLabel(Label node) { | 687 ASTNode visitLabel(Label node) { |
| 629 if (identical(_oldNode, node.label)) { | 688 if (identical(_oldNode, node.label)) { |
| 630 return _parser.parseSimpleIdentifier(); | 689 return _parser.parseSimpleIdentifier(); |
| 631 } | 690 } |
| 632 return notAChild(node); | 691 return notAChild(node); |
| 633 } | 692 } |
| 693 |
| 634 ASTNode visitLabeledStatement(LabeledStatement node) { | 694 ASTNode visitLabeledStatement(LabeledStatement node) { |
| 635 if (node.labels.contains(_oldNode)) { | 695 if (node.labels.contains(_oldNode)) { |
| 636 return _parser.parseLabel(); | 696 return _parser.parseLabel(); |
| 637 } else if (identical(_oldNode, node.statement)) { | 697 } else if (identical(_oldNode, node.statement)) { |
| 638 return _parser.parseStatement2(); | 698 return _parser.parseStatement2(); |
| 639 } | 699 } |
| 640 return notAChild(node); | 700 return notAChild(node); |
| 641 } | 701 } |
| 702 |
| 642 ASTNode visitLibraryDirective(LibraryDirective node) { | 703 ASTNode visitLibraryDirective(LibraryDirective node) { |
| 643 if (identical(_oldNode, node.documentationComment)) { | 704 if (identical(_oldNode, node.documentationComment)) { |
| 644 throw new InsufficientContextException(); | 705 throw new InsufficientContextException(); |
| 645 } else if (node.metadata.contains(_oldNode)) { | 706 } else if (node.metadata.contains(_oldNode)) { |
| 646 return _parser.parseAnnotation(); | 707 return _parser.parseAnnotation(); |
| 647 } else if (identical(_oldNode, node.name)) { | 708 } else if (identical(_oldNode, node.name)) { |
| 648 return _parser.parseLibraryIdentifier(); | 709 return _parser.parseLibraryIdentifier(); |
| 649 } | 710 } |
| 650 return notAChild(node); | 711 return notAChild(node); |
| 651 } | 712 } |
| 713 |
| 652 ASTNode visitLibraryIdentifier(LibraryIdentifier node) { | 714 ASTNode visitLibraryIdentifier(LibraryIdentifier node) { |
| 653 if (node.components.contains(_oldNode)) { | 715 if (node.components.contains(_oldNode)) { |
| 654 return _parser.parseSimpleIdentifier(); | 716 return _parser.parseSimpleIdentifier(); |
| 655 } | 717 } |
| 656 return notAChild(node); | 718 return notAChild(node); |
| 657 } | 719 } |
| 720 |
| 658 ASTNode visitListLiteral(ListLiteral node) { | 721 ASTNode visitListLiteral(ListLiteral node) { |
| 659 if (identical(_oldNode, node.typeArguments)) { | 722 if (identical(_oldNode, node.typeArguments)) { |
| 660 return _parser.parseTypeArgumentList(); | 723 return _parser.parseTypeArgumentList(); |
| 661 } else if (node.elements.contains(_oldNode)) { | 724 } else if (node.elements.contains(_oldNode)) { |
| 662 return _parser.parseExpression2(); | 725 return _parser.parseExpression2(); |
| 663 } | 726 } |
| 664 return notAChild(node); | 727 return notAChild(node); |
| 665 } | 728 } |
| 729 |
| 666 ASTNode visitMapLiteral(MapLiteral node) { | 730 ASTNode visitMapLiteral(MapLiteral node) { |
| 667 if (identical(_oldNode, node.typeArguments)) { | 731 if (identical(_oldNode, node.typeArguments)) { |
| 668 return _parser.parseTypeArgumentList(); | 732 return _parser.parseTypeArgumentList(); |
| 669 } else if (node.entries.contains(_oldNode)) { | 733 } else if (node.entries.contains(_oldNode)) { |
| 670 return _parser.parseMapLiteralEntry(); | 734 return _parser.parseMapLiteralEntry(); |
| 671 } | 735 } |
| 672 return notAChild(node); | 736 return notAChild(node); |
| 673 } | 737 } |
| 738 |
| 674 ASTNode visitMapLiteralEntry(MapLiteralEntry node) { | 739 ASTNode visitMapLiteralEntry(MapLiteralEntry node) { |
| 675 if (identical(_oldNode, node.key)) { | 740 if (identical(_oldNode, node.key)) { |
| 676 return _parser.parseExpression2(); | 741 return _parser.parseExpression2(); |
| 677 } else if (identical(_oldNode, node.value)) { | 742 } else if (identical(_oldNode, node.value)) { |
| 678 return _parser.parseExpression2(); | 743 return _parser.parseExpression2(); |
| 679 } | 744 } |
| 680 return notAChild(node); | 745 return notAChild(node); |
| 681 } | 746 } |
| 747 |
| 682 ASTNode visitMethodDeclaration(MethodDeclaration node) { | 748 ASTNode visitMethodDeclaration(MethodDeclaration node) { |
| 683 if (identical(_oldNode, node.documentationComment)) { | 749 if (identical(_oldNode, node.documentationComment)) { |
| 684 throw new InsufficientContextException(); | 750 throw new InsufficientContextException(); |
| 685 } else if (node.metadata.contains(_oldNode)) { | 751 } else if (node.metadata.contains(_oldNode)) { |
| 686 return _parser.parseAnnotation(); | 752 return _parser.parseAnnotation(); |
| 687 } else if (identical(_oldNode, node.returnType)) { | 753 } else if (identical(_oldNode, node.returnType)) { |
| 688 throw new InsufficientContextException(); | 754 throw new InsufficientContextException(); |
| 689 } else if (identical(_oldNode, node.name)) { | 755 } else if (identical(_oldNode, node.name)) { |
| 690 if (node.operatorKeyword != null) { | 756 if (node.operatorKeyword != null) { |
| 691 throw new InsufficientContextException(); | 757 throw new InsufficientContextException(); |
| 692 } | 758 } |
| 693 return _parser.parseSimpleIdentifier(); | 759 return _parser.parseSimpleIdentifier(); |
| 694 } else if (identical(_oldNode, node.body)) { | 760 } else if (identical(_oldNode, node.body)) { |
| 695 throw new InsufficientContextException(); | 761 throw new InsufficientContextException(); |
| 696 } | 762 } |
| 697 return notAChild(node); | 763 return notAChild(node); |
| 698 } | 764 } |
| 765 |
| 699 ASTNode visitMethodInvocation(MethodInvocation node) { | 766 ASTNode visitMethodInvocation(MethodInvocation node) { |
| 700 if (identical(_oldNode, node.target)) { | 767 if (identical(_oldNode, node.target)) { |
| 701 throw new IncrementalParseException(); | 768 throw new IncrementalParseException(); |
| 702 } else if (identical(_oldNode, node.methodName)) { | 769 } else if (identical(_oldNode, node.methodName)) { |
| 703 return _parser.parseSimpleIdentifier(); | 770 return _parser.parseSimpleIdentifier(); |
| 704 } else if (identical(_oldNode, node.argumentList)) { | 771 } else if (identical(_oldNode, node.argumentList)) { |
| 705 return _parser.parseArgumentList(); | 772 return _parser.parseArgumentList(); |
| 706 } | 773 } |
| 707 return notAChild(node); | 774 return notAChild(node); |
| 708 } | 775 } |
| 776 |
| 709 ASTNode visitNamedExpression(NamedExpression node) { | 777 ASTNode visitNamedExpression(NamedExpression node) { |
| 710 if (identical(_oldNode, node.name)) { | 778 if (identical(_oldNode, node.name)) { |
| 711 return _parser.parseLabel(); | 779 return _parser.parseLabel(); |
| 712 } else if (identical(_oldNode, node.expression)) { | 780 } else if (identical(_oldNode, node.expression)) { |
| 713 return _parser.parseExpression2(); | 781 return _parser.parseExpression2(); |
| 714 } | 782 } |
| 715 return notAChild(node); | 783 return notAChild(node); |
| 716 } | 784 } |
| 785 |
| 717 ASTNode visitNativeClause(NativeClause node) { | 786 ASTNode visitNativeClause(NativeClause node) { |
| 718 if (identical(_oldNode, node.name)) { | 787 if (identical(_oldNode, node.name)) { |
| 719 return _parser.parseStringLiteral(); | 788 return _parser.parseStringLiteral(); |
| 720 } | 789 } |
| 721 return notAChild(node); | 790 return notAChild(node); |
| 722 } | 791 } |
| 792 |
| 723 ASTNode visitNativeFunctionBody(NativeFunctionBody node) { | 793 ASTNode visitNativeFunctionBody(NativeFunctionBody node) { |
| 724 if (identical(_oldNode, node.stringLiteral)) { | 794 if (identical(_oldNode, node.stringLiteral)) { |
| 725 return _parser.parseStringLiteral(); | 795 return _parser.parseStringLiteral(); |
| 726 } | 796 } |
| 727 return notAChild(node); | 797 return notAChild(node); |
| 728 } | 798 } |
| 799 |
| 729 ASTNode visitNullLiteral(NullLiteral node) => notAChild(node); | 800 ASTNode visitNullLiteral(NullLiteral node) => notAChild(node); |
| 801 |
| 730 ASTNode visitParenthesizedExpression(ParenthesizedExpression node) { | 802 ASTNode visitParenthesizedExpression(ParenthesizedExpression node) { |
| 731 if (identical(_oldNode, node.expression)) { | 803 if (identical(_oldNode, node.expression)) { |
| 732 return _parser.parseExpression2(); | 804 return _parser.parseExpression2(); |
| 733 } | 805 } |
| 734 return notAChild(node); | 806 return notAChild(node); |
| 735 } | 807 } |
| 808 |
| 736 ASTNode visitPartDirective(PartDirective node) { | 809 ASTNode visitPartDirective(PartDirective node) { |
| 737 if (identical(_oldNode, node.documentationComment)) { | 810 if (identical(_oldNode, node.documentationComment)) { |
| 738 throw new InsufficientContextException(); | 811 throw new InsufficientContextException(); |
| 739 } else if (node.metadata.contains(_oldNode)) { | 812 } else if (node.metadata.contains(_oldNode)) { |
| 740 return _parser.parseAnnotation(); | 813 return _parser.parseAnnotation(); |
| 741 } else if (identical(_oldNode, node.uri)) { | 814 } else if (identical(_oldNode, node.uri)) { |
| 742 return _parser.parseStringLiteral(); | 815 return _parser.parseStringLiteral(); |
| 743 } | 816 } |
| 744 return notAChild(node); | 817 return notAChild(node); |
| 745 } | 818 } |
| 819 |
| 746 ASTNode visitPartOfDirective(PartOfDirective node) { | 820 ASTNode visitPartOfDirective(PartOfDirective node) { |
| 747 if (identical(_oldNode, node.documentationComment)) { | 821 if (identical(_oldNode, node.documentationComment)) { |
| 748 throw new InsufficientContextException(); | 822 throw new InsufficientContextException(); |
| 749 } else if (node.metadata.contains(_oldNode)) { | 823 } else if (node.metadata.contains(_oldNode)) { |
| 750 return _parser.parseAnnotation(); | 824 return _parser.parseAnnotation(); |
| 751 } else if (identical(_oldNode, node.libraryName)) { | 825 } else if (identical(_oldNode, node.libraryName)) { |
| 752 return _parser.parseLibraryIdentifier(); | 826 return _parser.parseLibraryIdentifier(); |
| 753 } | 827 } |
| 754 return notAChild(node); | 828 return notAChild(node); |
| 755 } | 829 } |
| 830 |
| 756 ASTNode visitPostfixExpression(PostfixExpression node) { | 831 ASTNode visitPostfixExpression(PostfixExpression node) { |
| 757 if (identical(_oldNode, node.operand)) { | 832 if (identical(_oldNode, node.operand)) { |
| 758 throw new InsufficientContextException(); | 833 throw new InsufficientContextException(); |
| 759 } | 834 } |
| 760 return notAChild(node); | 835 return notAChild(node); |
| 761 } | 836 } |
| 837 |
| 762 ASTNode visitPrefixedIdentifier(PrefixedIdentifier node) { | 838 ASTNode visitPrefixedIdentifier(PrefixedIdentifier node) { |
| 763 if (identical(_oldNode, node.prefix)) { | 839 if (identical(_oldNode, node.prefix)) { |
| 764 return _parser.parseSimpleIdentifier(); | 840 return _parser.parseSimpleIdentifier(); |
| 765 } else if (identical(_oldNode, node.identifier)) { | 841 } else if (identical(_oldNode, node.identifier)) { |
| 766 return _parser.parseSimpleIdentifier(); | 842 return _parser.parseSimpleIdentifier(); |
| 767 } | 843 } |
| 768 return notAChild(node); | 844 return notAChild(node); |
| 769 } | 845 } |
| 846 |
| 770 ASTNode visitPrefixExpression(PrefixExpression node) { | 847 ASTNode visitPrefixExpression(PrefixExpression node) { |
| 771 if (identical(_oldNode, node.operand)) { | 848 if (identical(_oldNode, node.operand)) { |
| 772 throw new InsufficientContextException(); | 849 throw new InsufficientContextException(); |
| 773 } | 850 } |
| 774 return notAChild(node); | 851 return notAChild(node); |
| 775 } | 852 } |
| 853 |
| 776 ASTNode visitPropertyAccess(PropertyAccess node) { | 854 ASTNode visitPropertyAccess(PropertyAccess node) { |
| 777 if (identical(_oldNode, node.target)) { | 855 if (identical(_oldNode, node.target)) { |
| 778 throw new InsufficientContextException(); | 856 throw new InsufficientContextException(); |
| 779 } else if (identical(_oldNode, node.propertyName)) { | 857 } else if (identical(_oldNode, node.propertyName)) { |
| 780 return _parser.parseSimpleIdentifier(); | 858 return _parser.parseSimpleIdentifier(); |
| 781 } | 859 } |
| 782 return notAChild(node); | 860 return notAChild(node); |
| 783 } | 861 } |
| 862 |
| 784 ASTNode visitRedirectingConstructorInvocation(RedirectingConstructorInvocation
node) { | 863 ASTNode visitRedirectingConstructorInvocation(RedirectingConstructorInvocation
node) { |
| 785 if (identical(_oldNode, node.constructorName)) { | 864 if (identical(_oldNode, node.constructorName)) { |
| 786 return _parser.parseSimpleIdentifier(); | 865 return _parser.parseSimpleIdentifier(); |
| 787 } else if (identical(_oldNode, node.argumentList)) { | 866 } else if (identical(_oldNode, node.argumentList)) { |
| 788 return _parser.parseArgumentList(); | 867 return _parser.parseArgumentList(); |
| 789 } | 868 } |
| 790 return notAChild(node); | 869 return notAChild(node); |
| 791 } | 870 } |
| 871 |
| 792 ASTNode visitRethrowExpression(RethrowExpression node) => notAChild(node); | 872 ASTNode visitRethrowExpression(RethrowExpression node) => notAChild(node); |
| 873 |
| 793 ASTNode visitReturnStatement(ReturnStatement node) { | 874 ASTNode visitReturnStatement(ReturnStatement node) { |
| 794 if (identical(_oldNode, node.expression)) { | 875 if (identical(_oldNode, node.expression)) { |
| 795 return _parser.parseExpression2(); | 876 return _parser.parseExpression2(); |
| 796 } | 877 } |
| 797 return notAChild(node); | 878 return notAChild(node); |
| 798 } | 879 } |
| 880 |
| 799 ASTNode visitScriptTag(ScriptTag node) => notAChild(node); | 881 ASTNode visitScriptTag(ScriptTag node) => notAChild(node); |
| 882 |
| 800 ASTNode visitShowCombinator(ShowCombinator node) { | 883 ASTNode visitShowCombinator(ShowCombinator node) { |
| 801 if (node.shownNames.contains(_oldNode)) { | 884 if (node.shownNames.contains(_oldNode)) { |
| 802 return _parser.parseSimpleIdentifier(); | 885 return _parser.parseSimpleIdentifier(); |
| 803 } | 886 } |
| 804 return notAChild(node); | 887 return notAChild(node); |
| 805 } | 888 } |
| 889 |
| 806 ASTNode visitSimpleFormalParameter(SimpleFormalParameter node) { | 890 ASTNode visitSimpleFormalParameter(SimpleFormalParameter node) { |
| 807 if (identical(_oldNode, node.documentationComment)) { | 891 if (identical(_oldNode, node.documentationComment)) { |
| 808 throw new InsufficientContextException(); | 892 throw new InsufficientContextException(); |
| 809 } else if (node.metadata.contains(_oldNode)) { | 893 } else if (node.metadata.contains(_oldNode)) { |
| 810 return _parser.parseAnnotation(); | 894 return _parser.parseAnnotation(); |
| 811 } else if (identical(_oldNode, node.type)) { | 895 } else if (identical(_oldNode, node.type)) { |
| 812 throw new InsufficientContextException(); | 896 throw new InsufficientContextException(); |
| 813 } else if (identical(_oldNode, node.identifier)) { | 897 } else if (identical(_oldNode, node.identifier)) { |
| 814 throw new InsufficientContextException(); | 898 throw new InsufficientContextException(); |
| 815 } | 899 } |
| 816 return notAChild(node); | 900 return notAChild(node); |
| 817 } | 901 } |
| 902 |
| 818 ASTNode visitSimpleIdentifier(SimpleIdentifier node) => notAChild(node); | 903 ASTNode visitSimpleIdentifier(SimpleIdentifier node) => notAChild(node); |
| 904 |
| 819 ASTNode visitSimpleStringLiteral(SimpleStringLiteral node) => notAChild(node); | 905 ASTNode visitSimpleStringLiteral(SimpleStringLiteral node) => notAChild(node); |
| 906 |
| 820 ASTNode visitStringInterpolation(StringInterpolation node) { | 907 ASTNode visitStringInterpolation(StringInterpolation node) { |
| 821 if (node.elements.contains(_oldNode)) { | 908 if (node.elements.contains(_oldNode)) { |
| 822 throw new InsufficientContextException(); | 909 throw new InsufficientContextException(); |
| 823 } | 910 } |
| 824 return notAChild(node); | 911 return notAChild(node); |
| 825 } | 912 } |
| 913 |
| 826 ASTNode visitSuperConstructorInvocation(SuperConstructorInvocation node) { | 914 ASTNode visitSuperConstructorInvocation(SuperConstructorInvocation node) { |
| 827 if (identical(_oldNode, node.constructorName)) { | 915 if (identical(_oldNode, node.constructorName)) { |
| 828 return _parser.parseSimpleIdentifier(); | 916 return _parser.parseSimpleIdentifier(); |
| 829 } else if (identical(_oldNode, node.argumentList)) { | 917 } else if (identical(_oldNode, node.argumentList)) { |
| 830 return _parser.parseArgumentList(); | 918 return _parser.parseArgumentList(); |
| 831 } | 919 } |
| 832 return notAChild(node); | 920 return notAChild(node); |
| 833 } | 921 } |
| 922 |
| 834 ASTNode visitSuperExpression(SuperExpression node) => notAChild(node); | 923 ASTNode visitSuperExpression(SuperExpression node) => notAChild(node); |
| 924 |
| 835 ASTNode visitSwitchCase(SwitchCase node) { | 925 ASTNode visitSwitchCase(SwitchCase node) { |
| 836 if (node.labels.contains(_oldNode)) { | 926 if (node.labels.contains(_oldNode)) { |
| 837 return _parser.parseLabel(); | 927 return _parser.parseLabel(); |
| 838 } else if (identical(_oldNode, node.expression)) { | 928 } else if (identical(_oldNode, node.expression)) { |
| 839 return _parser.parseExpression2(); | 929 return _parser.parseExpression2(); |
| 840 } else if (node.statements.contains(_oldNode)) { | 930 } else if (node.statements.contains(_oldNode)) { |
| 841 return _parser.parseStatement2(); | 931 return _parser.parseStatement2(); |
| 842 } | 932 } |
| 843 return notAChild(node); | 933 return notAChild(node); |
| 844 } | 934 } |
| 935 |
| 845 ASTNode visitSwitchDefault(SwitchDefault node) { | 936 ASTNode visitSwitchDefault(SwitchDefault node) { |
| 846 if (node.labels.contains(_oldNode)) { | 937 if (node.labels.contains(_oldNode)) { |
| 847 return _parser.parseLabel(); | 938 return _parser.parseLabel(); |
| 848 } else if (node.statements.contains(_oldNode)) { | 939 } else if (node.statements.contains(_oldNode)) { |
| 849 return _parser.parseStatement2(); | 940 return _parser.parseStatement2(); |
| 850 } | 941 } |
| 851 return notAChild(node); | 942 return notAChild(node); |
| 852 } | 943 } |
| 944 |
| 853 ASTNode visitSwitchStatement(SwitchStatement node) { | 945 ASTNode visitSwitchStatement(SwitchStatement node) { |
| 854 if (identical(_oldNode, node.expression)) { | 946 if (identical(_oldNode, node.expression)) { |
| 855 return _parser.parseExpression2(); | 947 return _parser.parseExpression2(); |
| 856 } else if (node.members.contains(_oldNode)) { | 948 } else if (node.members.contains(_oldNode)) { |
| 857 throw new InsufficientContextException(); | 949 throw new InsufficientContextException(); |
| 858 } | 950 } |
| 859 return notAChild(node); | 951 return notAChild(node); |
| 860 } | 952 } |
| 953 |
| 861 ASTNode visitSymbolLiteral(SymbolLiteral node) => notAChild(node); | 954 ASTNode visitSymbolLiteral(SymbolLiteral node) => notAChild(node); |
| 955 |
| 862 ASTNode visitThisExpression(ThisExpression node) => notAChild(node); | 956 ASTNode visitThisExpression(ThisExpression node) => notAChild(node); |
| 957 |
| 863 ASTNode visitThrowExpression(ThrowExpression node) { | 958 ASTNode visitThrowExpression(ThrowExpression node) { |
| 864 if (identical(_oldNode, node.expression)) { | 959 if (identical(_oldNode, node.expression)) { |
| 865 if (isCascadeAllowed2(node)) { | 960 if (isCascadeAllowed2(node)) { |
| 866 return _parser.parseExpression2(); | 961 return _parser.parseExpression2(); |
| 867 } | 962 } |
| 868 return _parser.parseExpressionWithoutCascade(); | 963 return _parser.parseExpressionWithoutCascade(); |
| 869 } | 964 } |
| 870 return notAChild(node); | 965 return notAChild(node); |
| 871 } | 966 } |
| 967 |
| 872 ASTNode visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { | 968 ASTNode visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { |
| 873 if (identical(_oldNode, node.documentationComment)) { | 969 if (identical(_oldNode, node.documentationComment)) { |
| 874 throw new InsufficientContextException(); | 970 throw new InsufficientContextException(); |
| 875 } else if (node.metadata.contains(_oldNode)) { | 971 } else if (node.metadata.contains(_oldNode)) { |
| 876 return _parser.parseAnnotation(); | 972 return _parser.parseAnnotation(); |
| 877 } else if (identical(_oldNode, node.variables)) { | 973 } else if (identical(_oldNode, node.variables)) { |
| 878 throw new InsufficientContextException(); | 974 throw new InsufficientContextException(); |
| 879 } | 975 } |
| 880 return notAChild(node); | 976 return notAChild(node); |
| 881 } | 977 } |
| 978 |
| 882 ASTNode visitTryStatement(TryStatement node) { | 979 ASTNode visitTryStatement(TryStatement node) { |
| 883 if (identical(_oldNode, node.body)) { | 980 if (identical(_oldNode, node.body)) { |
| 884 return _parser.parseBlock(); | 981 return _parser.parseBlock(); |
| 885 } else if (node.catchClauses.contains(_oldNode)) { | 982 } else if (node.catchClauses.contains(_oldNode)) { |
| 886 throw new InsufficientContextException(); | 983 throw new InsufficientContextException(); |
| 887 } else if (identical(_oldNode, node.finallyBlock)) { | 984 } else if (identical(_oldNode, node.finallyBlock)) { |
| 888 throw new InsufficientContextException(); | 985 throw new InsufficientContextException(); |
| 889 } | 986 } |
| 890 return notAChild(node); | 987 return notAChild(node); |
| 891 } | 988 } |
| 989 |
| 892 ASTNode visitTypeArgumentList(TypeArgumentList node) { | 990 ASTNode visitTypeArgumentList(TypeArgumentList node) { |
| 893 if (node.arguments.contains(_oldNode)) { | 991 if (node.arguments.contains(_oldNode)) { |
| 894 return _parser.parseTypeName(); | 992 return _parser.parseTypeName(); |
| 895 } | 993 } |
| 896 return notAChild(node); | 994 return notAChild(node); |
| 897 } | 995 } |
| 996 |
| 898 ASTNode visitTypeName(TypeName node) { | 997 ASTNode visitTypeName(TypeName node) { |
| 899 if (identical(_oldNode, node.name)) { | 998 if (identical(_oldNode, node.name)) { |
| 900 return _parser.parsePrefixedIdentifier(); | 999 return _parser.parsePrefixedIdentifier(); |
| 901 } else if (identical(_oldNode, node.typeArguments)) { | 1000 } else if (identical(_oldNode, node.typeArguments)) { |
| 902 return _parser.parseTypeArgumentList(); | 1001 return _parser.parseTypeArgumentList(); |
| 903 } | 1002 } |
| 904 return notAChild(node); | 1003 return notAChild(node); |
| 905 } | 1004 } |
| 1005 |
| 906 ASTNode visitTypeParameter(TypeParameter node) { | 1006 ASTNode visitTypeParameter(TypeParameter node) { |
| 907 if (identical(_oldNode, node.documentationComment)) { | 1007 if (identical(_oldNode, node.documentationComment)) { |
| 908 throw new InsufficientContextException(); | 1008 throw new InsufficientContextException(); |
| 909 } else if (node.metadata.contains(_oldNode)) { | 1009 } else if (node.metadata.contains(_oldNode)) { |
| 910 return _parser.parseAnnotation(); | 1010 return _parser.parseAnnotation(); |
| 911 } else if (identical(_oldNode, node.name)) { | 1011 } else if (identical(_oldNode, node.name)) { |
| 912 return _parser.parseSimpleIdentifier(); | 1012 return _parser.parseSimpleIdentifier(); |
| 913 } else if (identical(_oldNode, node.bound)) { | 1013 } else if (identical(_oldNode, node.bound)) { |
| 914 return _parser.parseTypeName(); | 1014 return _parser.parseTypeName(); |
| 915 } | 1015 } |
| 916 return notAChild(node); | 1016 return notAChild(node); |
| 917 } | 1017 } |
| 1018 |
| 918 ASTNode visitTypeParameterList(TypeParameterList node) { | 1019 ASTNode visitTypeParameterList(TypeParameterList node) { |
| 919 if (node.typeParameters.contains(node)) { | 1020 if (node.typeParameters.contains(node)) { |
| 920 return _parser.parseTypeParameter(); | 1021 return _parser.parseTypeParameter(); |
| 921 } | 1022 } |
| 922 return notAChild(node); | 1023 return notAChild(node); |
| 923 } | 1024 } |
| 1025 |
| 924 ASTNode visitVariableDeclaration(VariableDeclaration node) { | 1026 ASTNode visitVariableDeclaration(VariableDeclaration node) { |
| 925 if (identical(_oldNode, node.documentationComment)) { | 1027 if (identical(_oldNode, node.documentationComment)) { |
| 926 throw new InsufficientContextException(); | 1028 throw new InsufficientContextException(); |
| 927 } else if (node.metadata.contains(_oldNode)) { | 1029 } else if (node.metadata.contains(_oldNode)) { |
| 928 return _parser.parseAnnotation(); | 1030 return _parser.parseAnnotation(); |
| 929 } else if (identical(_oldNode, node.name)) { | 1031 } else if (identical(_oldNode, node.name)) { |
| 930 throw new InsufficientContextException(); | 1032 throw new InsufficientContextException(); |
| 931 } else if (identical(_oldNode, node.initializer)) { | 1033 } else if (identical(_oldNode, node.initializer)) { |
| 932 throw new InsufficientContextException(); | 1034 throw new InsufficientContextException(); |
| 933 } | 1035 } |
| 934 return notAChild(node); | 1036 return notAChild(node); |
| 935 } | 1037 } |
| 1038 |
| 936 ASTNode visitVariableDeclarationList(VariableDeclarationList node) { | 1039 ASTNode visitVariableDeclarationList(VariableDeclarationList node) { |
| 937 if (identical(_oldNode, node.documentationComment)) { | 1040 if (identical(_oldNode, node.documentationComment)) { |
| 938 throw new InsufficientContextException(); | 1041 throw new InsufficientContextException(); |
| 939 } else if (node.metadata.contains(_oldNode)) { | 1042 } else if (node.metadata.contains(_oldNode)) { |
| 940 return _parser.parseAnnotation(); | 1043 return _parser.parseAnnotation(); |
| 941 } else if (node.variables.contains(_oldNode)) { | 1044 } else if (node.variables.contains(_oldNode)) { |
| 942 throw new InsufficientContextException(); | 1045 throw new InsufficientContextException(); |
| 943 } | 1046 } |
| 944 return notAChild(node); | 1047 return notAChild(node); |
| 945 } | 1048 } |
| 1049 |
| 946 ASTNode visitVariableDeclarationStatement(VariableDeclarationStatement node) { | 1050 ASTNode visitVariableDeclarationStatement(VariableDeclarationStatement node) { |
| 947 if (identical(_oldNode, node.variables)) { | 1051 if (identical(_oldNode, node.variables)) { |
| 948 throw new InsufficientContextException(); | 1052 throw new InsufficientContextException(); |
| 949 } | 1053 } |
| 950 return notAChild(node); | 1054 return notAChild(node); |
| 951 } | 1055 } |
| 1056 |
| 952 ASTNode visitWhileStatement(WhileStatement node) { | 1057 ASTNode visitWhileStatement(WhileStatement node) { |
| 953 if (identical(_oldNode, node.condition)) { | 1058 if (identical(_oldNode, node.condition)) { |
| 954 return _parser.parseExpression2(); | 1059 return _parser.parseExpression2(); |
| 955 } else if (identical(_oldNode, node.body)) { | 1060 } else if (identical(_oldNode, node.body)) { |
| 956 return _parser.parseStatement2(); | 1061 return _parser.parseStatement2(); |
| 957 } | 1062 } |
| 958 return notAChild(node); | 1063 return notAChild(node); |
| 959 } | 1064 } |
| 1065 |
| 960 ASTNode visitWithClause(WithClause node) { | 1066 ASTNode visitWithClause(WithClause node) { |
| 961 if (node.mixinTypes.contains(node)) { | 1067 if (node.mixinTypes.contains(node)) { |
| 962 return _parser.parseTypeName(); | 1068 return _parser.parseTypeName(); |
| 963 } | 1069 } |
| 964 return notAChild(node); | 1070 return notAChild(node); |
| 965 } | 1071 } |
| 966 | 1072 |
| 967 /** | 1073 /** |
| 968 * Return `true` if the given assignment expression can have a cascade express
ion on the | 1074 * Return `true` if the given assignment expression can have a cascade express
ion on the |
| 969 * right-hand side. | 1075 * right-hand side. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 988 /** | 1094 /** |
| 989 * Throw an exception indicating that the visited node was not the parent of t
he node to be | 1095 * Throw an exception indicating that the visited node was not the parent of t
he node to be |
| 990 * replaced. | 1096 * replaced. |
| 991 * | 1097 * |
| 992 * @param visitedNode the visited node that should have been the parent of the
node to be replaced | 1098 * @param visitedNode the visited node that should have been the parent of the
node to be replaced |
| 993 */ | 1099 */ |
| 994 ASTNode notAChild(ASTNode visitedNode) { | 1100 ASTNode notAChild(ASTNode visitedNode) { |
| 995 throw new IncrementalParseException.con1("Internal error: the visited node (
a ${visitedNode.runtimeType.toString()}) was not the parent of the node to be re
placed (a ${_oldNode.runtimeType.toString()})"); | 1101 throw new IncrementalParseException.con1("Internal error: the visited node (
a ${visitedNode.runtimeType.toString()}) was not the parent of the node to be re
placed (a ${_oldNode.runtimeType.toString()})"); |
| 996 } | 1102 } |
| 997 } | 1103 } |
| 1104 |
| 998 /** | 1105 /** |
| 999 * Instances of the class `IncrementalParseException` represent an exception tha
t occurred | 1106 * Instances of the class `IncrementalParseException` represent an exception tha
t occurred |
| 1000 * while attempting to parse a replacement for a specified node in an existing A
ST structure. | 1107 * while attempting to parse a replacement for a specified node in an existing A
ST structure. |
| 1001 */ | 1108 */ |
| 1002 class IncrementalParseException extends RuntimeException { | 1109 class IncrementalParseException extends RuntimeException { |
| 1003 | |
| 1004 /** | 1110 /** |
| 1005 * Initialize a newly created exception to have no message and to be its own c
ause. | 1111 * Initialize a newly created exception to have no message and to be its own c
ause. |
| 1006 */ | 1112 */ |
| 1007 IncrementalParseException() : super(); | 1113 IncrementalParseException() : super(); |
| 1008 | 1114 |
| 1009 /** | 1115 /** |
| 1010 * Initialize a newly created exception to have the given message and to be it
s own cause. | 1116 * Initialize a newly created exception to have the given message and to be it
s own cause. |
| 1011 * | 1117 * |
| 1012 * @param message the message describing the reason for the exception | 1118 * @param message the message describing the reason for the exception |
| 1013 */ | 1119 */ |
| 1014 IncrementalParseException.con1(String message) : super(message: message); | 1120 IncrementalParseException.con1(String message) : super(message: message); |
| 1015 | 1121 |
| 1016 /** | 1122 /** |
| 1017 * Initialize a newly created exception to have no message and to have the giv
en cause. | 1123 * Initialize a newly created exception to have no message and to have the giv
en cause. |
| 1018 * | 1124 * |
| 1019 * @param cause the exception that caused this exception | 1125 * @param cause the exception that caused this exception |
| 1020 */ | 1126 */ |
| 1021 IncrementalParseException.con2(Exception cause) : super(cause: cause); | 1127 IncrementalParseException.con2(Exception cause) : super(cause: cause); |
| 1022 } | 1128 } |
| 1129 |
| 1023 /** | 1130 /** |
| 1024 * Instances of the class `IncrementalParser` re-parse a single AST structure wi
thin a larger | 1131 * Instances of the class `IncrementalParser` re-parse a single AST structure wi
thin a larger |
| 1025 * AST structure. | 1132 * AST structure. |
| 1026 */ | 1133 */ |
| 1027 class IncrementalParser { | 1134 class IncrementalParser { |
| 1028 | |
| 1029 /** | 1135 /** |
| 1030 * The source being parsed. | 1136 * The source being parsed. |
| 1031 */ | 1137 */ |
| 1032 Source _source; | 1138 Source _source; |
| 1033 | 1139 |
| 1034 /** | 1140 /** |
| 1035 * A map from old tokens to new tokens used during the cloning process. | 1141 * A map from old tokens to new tokens used during the cloning process. |
| 1036 */ | 1142 */ |
| 1037 TokenMap _tokenMap; | 1143 TokenMap _tokenMap; |
| 1038 | 1144 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 Token findTokenAt(Token firstToken, int offset) { | 1245 Token findTokenAt(Token firstToken, int offset) { |
| 1140 while (firstToken.offset > offset && firstToken.type != TokenType.EOF) { | 1246 while (firstToken.offset > offset && firstToken.type != TokenType.EOF) { |
| 1141 firstToken = firstToken.previous; | 1247 firstToken = firstToken.previous; |
| 1142 } | 1248 } |
| 1143 if (firstToken.offset == offset) { | 1249 if (firstToken.offset == offset) { |
| 1144 return firstToken; | 1250 return firstToken; |
| 1145 } | 1251 } |
| 1146 return null; | 1252 return null; |
| 1147 } | 1253 } |
| 1148 } | 1254 } |
| 1255 |
| 1149 /** | 1256 /** |
| 1150 * Instances of the class `InsufficientContextException` represent a situation i
n which an AST | 1257 * Instances of the class `InsufficientContextException` represent a situation i
n which an AST |
| 1151 * node cannot be re-parsed because there is not enough context to know how to r
e-parse the node. | 1258 * node cannot be re-parsed because there is not enough context to know how to r
e-parse the node. |
| 1152 * Clients can attempt to re-parse the parent of the node. | 1259 * Clients can attempt to re-parse the parent of the node. |
| 1153 */ | 1260 */ |
| 1154 class InsufficientContextException extends IncrementalParseException { | 1261 class InsufficientContextException extends IncrementalParseException { |
| 1155 | |
| 1156 /** | 1262 /** |
| 1157 * Initialize a newly created exception to have no message and to be its own c
ause. | 1263 * Initialize a newly created exception to have no message and to be its own c
ause. |
| 1158 */ | 1264 */ |
| 1159 InsufficientContextException() : super(); | 1265 InsufficientContextException() : super(); |
| 1160 | 1266 |
| 1161 /** | 1267 /** |
| 1162 * Initialize a newly created exception to have the given message and to be it
s own cause. | 1268 * Initialize a newly created exception to have the given message and to be it
s own cause. |
| 1163 * | 1269 * |
| 1164 * @param message the message describing the reason for the exception | 1270 * @param message the message describing the reason for the exception |
| 1165 */ | 1271 */ |
| 1166 InsufficientContextException.con1(String message) : super.con1(message); | 1272 InsufficientContextException.con1(String message) : super.con1(message); |
| 1167 | 1273 |
| 1168 /** | 1274 /** |
| 1169 * Initialize a newly created exception to have no message and to have the giv
en cause. | 1275 * Initialize a newly created exception to have no message and to have the giv
en cause. |
| 1170 * | 1276 * |
| 1171 * @param cause the exception that caused this exception | 1277 * @param cause the exception that caused this exception |
| 1172 */ | 1278 */ |
| 1173 InsufficientContextException.con2(Exception cause) : super.con2(cause); | 1279 InsufficientContextException.con2(Exception cause) : super.con2(cause); |
| 1174 } | 1280 } |
| 1281 |
| 1175 /** | 1282 /** |
| 1176 * Instances of the class `Parser` are used to parse tokens into an AST structur
e. | 1283 * Instances of the class `Parser` are used to parse tokens into an AST structur
e. |
| 1177 * | 1284 * |
| 1178 * @coverage dart.engine.parser | 1285 * @coverage dart.engine.parser |
| 1179 */ | 1286 */ |
| 1180 class Parser { | 1287 class Parser { |
| 1181 | |
| 1182 /** | 1288 /** |
| 1183 * The source being parsed. | 1289 * The source being parsed. |
| 1184 */ | 1290 */ |
| 1185 Source _source; | 1291 Source _source; |
| 1186 | 1292 |
| 1187 /** | 1293 /** |
| 1188 * The error listener that will be informed of any errors that are found durin
g the parse. | 1294 * The error listener that will be informed of any errors that are found durin
g the parse. |
| 1189 */ | 1295 */ |
| 1190 AnalysisErrorListener _errorListener; | 1296 AnalysisErrorListener _errorListener; |
| 1191 | 1297 |
| 1192 /** | 1298 /** |
| 1193 * The next token to be parsed. | 1299 * The next token to be parsed. |
| 1194 */ | 1300 */ |
| 1195 Token _currentToken; | 1301 Token _currentToken; |
| 1196 | 1302 |
| 1197 /** | 1303 /** |
| 1198 * A flag indicating whether the parser is currently in the body of a loop. | 1304 * A flag indicating whether the parser is currently in the body of a loop. |
| 1199 */ | 1305 */ |
| 1200 bool _inLoop = false; | 1306 bool _inLoop = false; |
| 1201 | 1307 |
| 1202 /** | 1308 /** |
| 1203 * A flag indicating whether the parser is currently in a switch statement. | 1309 * A flag indicating whether the parser is currently in a switch statement. |
| 1204 */ | 1310 */ |
| 1205 bool _inSwitch = false; | 1311 bool _inSwitch = false; |
| 1312 |
| 1206 static String _HIDE = "hide"; | 1313 static String _HIDE = "hide"; |
| 1314 |
| 1207 static String _OF = "of"; | 1315 static String _OF = "of"; |
| 1316 |
| 1208 static String _ON = "on"; | 1317 static String _ON = "on"; |
| 1318 |
| 1209 static String _NATIVE = "native"; | 1319 static String _NATIVE = "native"; |
| 1320 |
| 1210 static String _SHOW = "show"; | 1321 static String _SHOW = "show"; |
| 1211 | 1322 |
| 1212 /** | 1323 /** |
| 1213 * Initialize a newly created parser. | 1324 * Initialize a newly created parser. |
| 1214 * | 1325 * |
| 1215 * @param source the source being parsed | 1326 * @param source the source being parsed |
| 1216 * @param errorListener the error listener that will be informed of any errors
that are found | 1327 * @param errorListener the error listener that will be informed of any errors
that are found |
| 1217 * during the parse | 1328 * during the parse |
| 1218 */ | 1329 */ |
| 1219 Parser(Source source, AnalysisErrorListener errorListener) { | 1330 Parser(Source source, AnalysisErrorListener errorListener) { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 } | 1471 } |
| 1361 Expression argument = parseArgument(); | 1472 Expression argument = parseArgument(); |
| 1362 arguments.add(argument); | 1473 arguments.add(argument); |
| 1363 bool foundNamedArgument = argument is NamedExpression; | 1474 bool foundNamedArgument = argument is NamedExpression; |
| 1364 bool generatedError = false; | 1475 bool generatedError = false; |
| 1365 while (optional(TokenType.COMMA)) { | 1476 while (optional(TokenType.COMMA)) { |
| 1366 argument = parseArgument(); | 1477 argument = parseArgument(); |
| 1367 arguments.add(argument); | 1478 arguments.add(argument); |
| 1368 if (foundNamedArgument) { | 1479 if (foundNamedArgument) { |
| 1369 if (!generatedError && argument is! NamedExpression) { | 1480 if (!generatedError && argument is! NamedExpression) { |
| 1370 reportError8(ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT, []); | 1481 reportError9(ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT, []); |
| 1371 generatedError = true; | 1482 generatedError = true; |
| 1372 } | 1483 } |
| 1373 } else if (argument is NamedExpression) { | 1484 } else if (argument is NamedExpression) { |
| 1374 foundNamedArgument = true; | 1485 foundNamedArgument = true; |
| 1375 } | 1486 } |
| 1376 } | 1487 } |
| 1377 Token rightParenthesis = expect2(TokenType.CLOSE_PAREN); | 1488 Token rightParenthesis = expect2(TokenType.CLOSE_PAREN); |
| 1378 return new ArgumentList.full(leftParenthesis, arguments, rightParenthesis); | 1489 return new ArgumentList.full(leftParenthesis, arguments, rightParenthesis); |
| 1379 } | 1490 } |
| 1380 | 1491 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 Block parseBlock() { | 1527 Block parseBlock() { |
| 1417 Token leftBracket = expect2(TokenType.OPEN_CURLY_BRACKET); | 1528 Token leftBracket = expect2(TokenType.OPEN_CURLY_BRACKET); |
| 1418 List<Statement> statements = new List<Statement>(); | 1529 List<Statement> statements = new List<Statement>(); |
| 1419 Token statementStart = _currentToken; | 1530 Token statementStart = _currentToken; |
| 1420 while (!matches5(TokenType.EOF) && !matches5(TokenType.CLOSE_CURLY_BRACKET))
{ | 1531 while (!matches5(TokenType.EOF) && !matches5(TokenType.CLOSE_CURLY_BRACKET))
{ |
| 1421 Statement statement = parseStatement2(); | 1532 Statement statement = parseStatement2(); |
| 1422 if (statement != null) { | 1533 if (statement != null) { |
| 1423 statements.add(statement); | 1534 statements.add(statement); |
| 1424 } | 1535 } |
| 1425 if (identical(_currentToken, statementStart)) { | 1536 if (identical(_currentToken, statementStart)) { |
| 1426 reportError9(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_currentT
oken.lexeme]); | 1537 reportError10(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_current
Token.lexeme]); |
| 1427 advance(); | 1538 advance(); |
| 1428 } | 1539 } |
| 1429 statementStart = _currentToken; | 1540 statementStart = _currentToken; |
| 1430 } | 1541 } |
| 1431 Token rightBracket = expect2(TokenType.CLOSE_CURLY_BRACKET); | 1542 Token rightBracket = expect2(TokenType.CLOSE_CURLY_BRACKET); |
| 1432 return new Block.full(leftBracket, statements, rightBracket); | 1543 return new Block.full(leftBracket, statements, rightBracket); |
| 1433 } | 1544 } |
| 1434 | 1545 |
| 1435 /** | 1546 /** |
| 1436 * Parse a class member. | 1547 * Parse a class member. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1469 if (matchesIdentifier()) { | 1580 if (matchesIdentifier()) { |
| 1470 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMIC
OLON])) { | 1581 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMIC
OLON])) { |
| 1471 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []); | 1582 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []); |
| 1472 return parseInitializedIdentifierList(commentAndMetadata, modifiers.
staticKeyword, validateModifiersForField(modifiers), returnType); | 1583 return parseInitializedIdentifierList(commentAndMetadata, modifiers.
staticKeyword, validateModifiersForField(modifiers), returnType); |
| 1473 } | 1584 } |
| 1474 } | 1585 } |
| 1475 if (isOperator(_currentToken)) { | 1586 if (isOperator(_currentToken)) { |
| 1476 validateModifiersForOperator(modifiers); | 1587 validateModifiersForOperator(modifiers); |
| 1477 return parseOperator(commentAndMetadata, modifiers.externalKeyword, re
turnType); | 1588 return parseOperator(commentAndMetadata, modifiers.externalKeyword, re
turnType); |
| 1478 } | 1589 } |
| 1479 reportError9(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []); | 1590 reportError10(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []); |
| 1480 return null; | 1591 return null; |
| 1481 } | 1592 } |
| 1482 } else if (matches(Keyword.GET) && matchesIdentifier2(peek())) { | 1593 } else if (matches(Keyword.GET) && matchesIdentifier2(peek())) { |
| 1483 validateModifiersForGetterOrSetterOrMethod(modifiers); | 1594 validateModifiersForGetterOrSetterOrMethod(modifiers); |
| 1484 return parseGetter(commentAndMetadata, modifiers.externalKeyword, modifier
s.staticKeyword, null); | 1595 return parseGetter(commentAndMetadata, modifiers.externalKeyword, modifier
s.staticKeyword, null); |
| 1485 } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) { | 1596 } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) { |
| 1486 validateModifiersForGetterOrSetterOrMethod(modifiers); | 1597 validateModifiersForGetterOrSetterOrMethod(modifiers); |
| 1487 return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifier
s.staticKeyword, null); | 1598 return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifier
s.staticKeyword, null); |
| 1488 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) { | 1599 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) { |
| 1489 validateModifiersForOperator(modifiers); | 1600 validateModifiersForOperator(modifiers); |
| 1490 return parseOperator(commentAndMetadata, modifiers.externalKeyword, null); | 1601 return parseOperator(commentAndMetadata, modifiers.externalKeyword, null); |
| 1491 } else if (!matchesIdentifier()) { | 1602 } else if (!matchesIdentifier()) { |
| 1492 if (isOperator(_currentToken)) { | 1603 if (isOperator(_currentToken)) { |
| 1493 validateModifiersForOperator(modifiers); | 1604 validateModifiersForOperator(modifiers); |
| 1494 return parseOperator(commentAndMetadata, modifiers.externalKeyword, null
); | 1605 return parseOperator(commentAndMetadata, modifiers.externalKeyword, null
); |
| 1495 } | 1606 } |
| 1496 reportError9(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken, []); | 1607 reportError10(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken, []); |
| 1497 return null; | 1608 return null; |
| 1498 } else if (matches4(peek(), TokenType.PERIOD) && matchesIdentifier2(peek2(2)
) && matches4(peek2(3), TokenType.OPEN_PAREN)) { | 1609 } else if (matches4(peek(), TokenType.PERIOD) && matchesIdentifier2(peek2(2)
) && matches4(peek2(3), TokenType.OPEN_PAREN)) { |
| 1499 return parseConstructor(commentAndMetadata, modifiers.externalKeyword, val
idateModifiersForConstructor(modifiers), modifiers.factoryKeyword, parseSimpleId
entifier(), andAdvance, parseSimpleIdentifier(), parseFormalParameterList()); | 1610 return parseConstructor(commentAndMetadata, modifiers.externalKeyword, val
idateModifiersForConstructor(modifiers), modifiers.factoryKeyword, parseSimpleId
entifier(), andAdvance, parseSimpleIdentifier(), parseFormalParameterList()); |
| 1500 } else if (matches4(peek(), TokenType.OPEN_PAREN)) { | 1611 } else if (matches4(peek(), TokenType.OPEN_PAREN)) { |
| 1501 SimpleIdentifier methodName = parseSimpleIdentifier(); | 1612 SimpleIdentifier methodName = parseSimpleIdentifier(); |
| 1502 FormalParameterList parameters = parseFormalParameterList(); | 1613 FormalParameterList parameters = parseFormalParameterList(); |
| 1503 if (matches5(TokenType.COLON) || modifiers.factoryKeyword != null || metho
dName.name == className) { | 1614 if (matches5(TokenType.COLON) || modifiers.factoryKeyword != null || metho
dName.name == className) { |
| 1504 return parseConstructor(commentAndMetadata, modifiers.externalKeyword, v
alidateModifiersForConstructor(modifiers), modifiers.factoryKeyword, methodName,
null, null, parameters); | 1615 return parseConstructor(commentAndMetadata, modifiers.externalKeyword, v
alidateModifiersForConstructor(modifiers), modifiers.factoryKeyword, methodName,
null, null, parameters); |
| 1505 } | 1616 } |
| 1506 validateModifiersForGetterOrSetterOrMethod(modifiers); | 1617 validateModifiersForGetterOrSetterOrMethod(modifiers); |
| 1507 validateFormalParameterList(parameters); | 1618 validateFormalParameterList(parameters); |
| 1508 return parseMethodDeclaration2(commentAndMetadata, modifiers.externalKeywo
rd, modifiers.staticKeyword, null, methodName, parameters); | 1619 return parseMethodDeclaration2(commentAndMetadata, modifiers.externalKeywo
rd, modifiers.staticKeyword, null, methodName, parameters); |
| 1509 } else if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMI
COLON])) { | 1620 } else if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMI
COLON])) { |
| 1510 if (modifiers.constKeyword == null && modifiers.finalKeyword == null && mo
difiers.varKeyword == null) { | 1621 if (modifiers.constKeyword == null && modifiers.finalKeyword == null && mo
difiers.varKeyword == null) { |
| 1511 reportError8(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, []); | 1622 reportError9(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, []); |
| 1512 } | 1623 } |
| 1513 return parseInitializedIdentifierList(commentAndMetadata, modifiers.static
Keyword, validateModifiersForField(modifiers), null); | 1624 return parseInitializedIdentifierList(commentAndMetadata, modifiers.static
Keyword, validateModifiersForField(modifiers), null); |
| 1514 } | 1625 } |
| 1515 TypeName type = parseTypeName(); | 1626 TypeName type = parseTypeName(); |
| 1516 if (matches(Keyword.GET) && matchesIdentifier2(peek())) { | 1627 if (matches(Keyword.GET) && matchesIdentifier2(peek())) { |
| 1517 validateModifiersForGetterOrSetterOrMethod(modifiers); | 1628 validateModifiersForGetterOrSetterOrMethod(modifiers); |
| 1518 return parseGetter(commentAndMetadata, modifiers.externalKeyword, modifier
s.staticKeyword, type); | 1629 return parseGetter(commentAndMetadata, modifiers.externalKeyword, modifier
s.staticKeyword, type); |
| 1519 } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) { | 1630 } else if (matches(Keyword.SET) && matchesIdentifier2(peek())) { |
| 1520 validateModifiersForGetterOrSetterOrMethod(modifiers); | 1631 validateModifiersForGetterOrSetterOrMethod(modifiers); |
| 1521 return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifier
s.staticKeyword, type); | 1632 return parseSetter(commentAndMetadata, modifiers.externalKeyword, modifier
s.staticKeyword, type); |
| 1522 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) { | 1633 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) { |
| 1523 validateModifiersForOperator(modifiers); | 1634 validateModifiersForOperator(modifiers); |
| 1524 return parseOperator(commentAndMetadata, modifiers.externalKeyword, type); | 1635 return parseOperator(commentAndMetadata, modifiers.externalKeyword, type); |
| 1525 } else if (!matchesIdentifier()) { | 1636 } else if (!matchesIdentifier()) { |
| 1526 if (matches5(TokenType.CLOSE_CURLY_BRACKET)) { | 1637 if (matches5(TokenType.CLOSE_CURLY_BRACKET)) { |
| 1527 return parseInitializedIdentifierList(commentAndMetadata, modifiers.stat
icKeyword, validateModifiersForField(modifiers), type); | 1638 return parseInitializedIdentifierList(commentAndMetadata, modifiers.stat
icKeyword, validateModifiersForField(modifiers), type); |
| 1528 } | 1639 } |
| 1529 if (isOperator(_currentToken)) { | 1640 if (isOperator(_currentToken)) { |
| 1530 validateModifiersForOperator(modifiers); | 1641 validateModifiersForOperator(modifiers); |
| 1531 return parseOperator(commentAndMetadata, modifiers.externalKeyword, type
); | 1642 return parseOperator(commentAndMetadata, modifiers.externalKeyword, type
); |
| 1532 } | 1643 } |
| 1533 reportError9(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken, []); | 1644 reportError10(ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken, []); |
| 1534 return null; | 1645 return null; |
| 1535 } else if (matches4(peek(), TokenType.OPEN_PAREN)) { | 1646 } else if (matches4(peek(), TokenType.OPEN_PAREN)) { |
| 1536 SimpleIdentifier methodName = parseSimpleIdentifier(); | 1647 SimpleIdentifier methodName = parseSimpleIdentifier(); |
| 1537 FormalParameterList parameters = parseFormalParameterList(); | 1648 FormalParameterList parameters = parseFormalParameterList(); |
| 1538 if (methodName.name == className) { | 1649 if (methodName.name == className) { |
| 1539 reportError(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, type, []); | 1650 reportError(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, type, []); |
| 1540 return parseConstructor(commentAndMetadata, modifiers.externalKeyword, v
alidateModifiersForConstructor(modifiers), modifiers.factoryKeyword, methodName,
null, null, parameters); | 1651 return parseConstructor(commentAndMetadata, modifiers.externalKeyword, v
alidateModifiersForConstructor(modifiers), modifiers.factoryKeyword, methodName,
null, null, parameters); |
| 1541 } | 1652 } |
| 1542 validateModifiersForGetterOrSetterOrMethod(modifiers); | 1653 validateModifiersForGetterOrSetterOrMethod(modifiers); |
| 1543 validateFormalParameterList(parameters); | 1654 validateFormalParameterList(parameters); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1576 } | 1687 } |
| 1577 bool libraryDirectiveFound = false; | 1688 bool libraryDirectiveFound = false; |
| 1578 bool partOfDirectiveFound = false; | 1689 bool partOfDirectiveFound = false; |
| 1579 bool partDirectiveFound = false; | 1690 bool partDirectiveFound = false; |
| 1580 bool directiveFoundAfterDeclaration = false; | 1691 bool directiveFoundAfterDeclaration = false; |
| 1581 List<Directive> directives = new List<Directive>(); | 1692 List<Directive> directives = new List<Directive>(); |
| 1582 List<CompilationUnitMember> declarations = new List<CompilationUnitMember>()
; | 1693 List<CompilationUnitMember> declarations = new List<CompilationUnitMember>()
; |
| 1583 Token memberStart = _currentToken; | 1694 Token memberStart = _currentToken; |
| 1584 while (!matches5(TokenType.EOF)) { | 1695 while (!matches5(TokenType.EOF)) { |
| 1585 CommentAndMetadata commentAndMetadata = parseCommentAndMetadata(); | 1696 CommentAndMetadata commentAndMetadata = parseCommentAndMetadata(); |
| 1586 if ((matches(Keyword.IMPORT) || matches(Keyword.EXPORT) || matches(Keyword
.LIBRARY) || matches(Keyword.PART)) && !matches4(peek(), TokenType.PERIOD) && !m
atches4(peek(), TokenType.LT)) { | 1697 if ((matches(Keyword.IMPORT) || matches(Keyword.EXPORT) || matches(Keyword
.LIBRARY) || matches(Keyword.PART)) && !matches4(peek(), TokenType.PERIOD) && !m
atches4(peek(), TokenType.LT) && !matches4(peek(), TokenType.OPEN_PAREN)) { |
| 1587 Directive directive = parseDirective(commentAndMetadata); | 1698 Directive directive = parseDirective(commentAndMetadata); |
| 1588 if (declarations.length > 0 && !directiveFoundAfterDeclaration) { | 1699 if (declarations.length > 0 && !directiveFoundAfterDeclaration) { |
| 1589 reportError8(ParserErrorCode.DIRECTIVE_AFTER_DECLARATION, []); | 1700 reportError9(ParserErrorCode.DIRECTIVE_AFTER_DECLARATION, []); |
| 1590 directiveFoundAfterDeclaration = true; | 1701 directiveFoundAfterDeclaration = true; |
| 1591 } | 1702 } |
| 1592 if (directive is LibraryDirective) { | 1703 if (directive is LibraryDirective) { |
| 1593 if (libraryDirectiveFound) { | 1704 if (libraryDirectiveFound) { |
| 1594 reportError8(ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES, []); | 1705 reportError9(ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES, []); |
| 1595 } else { | 1706 } else { |
| 1596 if (directives.length > 0) { | 1707 if (directives.length > 0) { |
| 1597 reportError8(ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, []); | 1708 reportError9(ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, []); |
| 1598 } | 1709 } |
| 1599 libraryDirectiveFound = true; | 1710 libraryDirectiveFound = true; |
| 1600 } | 1711 } |
| 1601 } else if (directive is PartDirective) { | 1712 } else if (directive is PartDirective) { |
| 1602 partDirectiveFound = true; | 1713 partDirectiveFound = true; |
| 1603 } else if (partDirectiveFound) { | 1714 } else if (partDirectiveFound) { |
| 1604 if (directive is ExportDirective) { | 1715 if (directive is ExportDirective) { |
| 1605 reportError9(ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
((directive as NamespaceDirective)).keyword, []); | 1716 reportError10(ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
(directive as NamespaceDirective).keyword, []); |
| 1606 } else if (directive is ImportDirective) { | 1717 } else if (directive is ImportDirective) { |
| 1607 reportError9(ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
((directive as NamespaceDirective)).keyword, []); | 1718 reportError10(ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
(directive as NamespaceDirective).keyword, []); |
| 1608 } | 1719 } |
| 1609 } | 1720 } |
| 1610 if (directive is PartOfDirective) { | 1721 if (directive is PartOfDirective) { |
| 1611 if (partOfDirectiveFound) { | 1722 if (partOfDirectiveFound) { |
| 1612 reportError8(ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES, []); | 1723 reportError9(ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES, []); |
| 1613 } else { | 1724 } else { |
| 1614 for (Directive precedingDirective in directives) { | 1725 for (Directive precedingDirective in directives) { |
| 1615 reportError9(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, preced
ingDirective.keyword, []); | 1726 reportError10(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, prece
dingDirective.keyword, []); |
| 1616 } | 1727 } |
| 1617 partOfDirectiveFound = true; | 1728 partOfDirectiveFound = true; |
| 1618 } | 1729 } |
| 1619 } else { | 1730 } else { |
| 1620 if (partOfDirectiveFound) { | 1731 if (partOfDirectiveFound) { |
| 1621 reportError9(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, directiv
e.keyword, []); | 1732 reportError10(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, directi
ve.keyword, []); |
| 1622 } | 1733 } |
| 1623 } | 1734 } |
| 1624 directives.add(directive); | 1735 directives.add(directive); |
| 1625 } else if (matches5(TokenType.SEMICOLON)) { | 1736 } else if (matches5(TokenType.SEMICOLON)) { |
| 1626 reportError9(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_currentT
oken.lexeme]); | 1737 reportError10(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_current
Token.lexeme]); |
| 1627 advance(); | 1738 advance(); |
| 1628 } else { | 1739 } else { |
| 1629 CompilationUnitMember member = parseCompilationUnitMember(commentAndMeta
data); | 1740 CompilationUnitMember member = parseCompilationUnitMember(commentAndMeta
data); |
| 1630 if (member != null) { | 1741 if (member != null) { |
| 1631 declarations.add(member); | 1742 declarations.add(member); |
| 1632 } | 1743 } |
| 1633 } | 1744 } |
| 1634 if (identical(_currentToken, memberStart)) { | 1745 if (identical(_currentToken, memberStart)) { |
| 1635 reportError9(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_currentT
oken.lexeme]); | 1746 reportError10(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_current
Token.lexeme]); |
| 1636 advance(); | 1747 advance(); |
| 1637 while (!matches5(TokenType.EOF) && !couldBeStartOfCompilationUnitMember(
)) { | 1748 while (!matches5(TokenType.EOF) && !couldBeStartOfCompilationUnitMember(
)) { |
| 1638 advance(); | 1749 advance(); |
| 1639 } | 1750 } |
| 1640 } | 1751 } |
| 1641 memberStart = _currentToken; | 1752 memberStart = _currentToken; |
| 1642 } | 1753 } |
| 1643 return new CompilationUnit.full(firstToken, scriptTag, directives, declarati
ons, _currentToken); | 1754 return new CompilationUnit.full(firstToken, scriptTag, directives, declarati
ons, _currentToken); |
| 1644 } | 1755 } |
| 1645 | 1756 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1811 bool reportedMuliplePositionalGroups = false; | 1922 bool reportedMuliplePositionalGroups = false; |
| 1812 bool reportedMulipleNamedGroups = false; | 1923 bool reportedMulipleNamedGroups = false; |
| 1813 bool reportedMixedGroups = false; | 1924 bool reportedMixedGroups = false; |
| 1814 bool wasOptionalParameter = false; | 1925 bool wasOptionalParameter = false; |
| 1815 Token initialToken = null; | 1926 Token initialToken = null; |
| 1816 do { | 1927 do { |
| 1817 if (firstParameter) { | 1928 if (firstParameter) { |
| 1818 firstParameter = false; | 1929 firstParameter = false; |
| 1819 } else if (!optional(TokenType.COMMA)) { | 1930 } else if (!optional(TokenType.COMMA)) { |
| 1820 if (getEndToken(leftParenthesis) != null) { | 1931 if (getEndToken(leftParenthesis) != null) { |
| 1821 reportError8(ParserErrorCode.EXPECTED_TOKEN, [TokenType.COMMA.lexeme])
; | 1932 reportError9(ParserErrorCode.EXPECTED_TOKEN, [TokenType.COMMA.lexeme])
; |
| 1822 } else { | 1933 } else { |
| 1823 reportError9(ParserErrorCode.MISSING_CLOSING_PARENTHESIS, _currentToke
n.previous, []); | 1934 reportError10(ParserErrorCode.MISSING_CLOSING_PARENTHESIS, _currentTok
en.previous, []); |
| 1824 break; | 1935 break; |
| 1825 } | 1936 } |
| 1826 } | 1937 } |
| 1827 initialToken = _currentToken; | 1938 initialToken = _currentToken; |
| 1828 if (matches5(TokenType.OPEN_SQUARE_BRACKET)) { | 1939 if (matches5(TokenType.OPEN_SQUARE_BRACKET)) { |
| 1829 wasOptionalParameter = true; | 1940 wasOptionalParameter = true; |
| 1830 if (leftSquareBracket != null && !reportedMuliplePositionalGroups) { | 1941 if (leftSquareBracket != null && !reportedMuliplePositionalGroups) { |
| 1831 reportError8(ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS, [])
; | 1942 reportError9(ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS, [])
; |
| 1832 reportedMuliplePositionalGroups = true; | 1943 reportedMuliplePositionalGroups = true; |
| 1833 } | 1944 } |
| 1834 if (leftCurlyBracket != null && !reportedMixedGroups) { | 1945 if (leftCurlyBracket != null && !reportedMixedGroups) { |
| 1835 reportError8(ParserErrorCode.MIXED_PARAMETER_GROUPS, []); | 1946 reportError9(ParserErrorCode.MIXED_PARAMETER_GROUPS, []); |
| 1836 reportedMixedGroups = true; | 1947 reportedMixedGroups = true; |
| 1837 } | 1948 } |
| 1838 leftSquareBracket = andAdvance; | 1949 leftSquareBracket = andAdvance; |
| 1839 currentParameters = positionalParameters; | 1950 currentParameters = positionalParameters; |
| 1840 kind = ParameterKind.POSITIONAL; | 1951 kind = ParameterKind.POSITIONAL; |
| 1841 } else if (matches5(TokenType.OPEN_CURLY_BRACKET)) { | 1952 } else if (matches5(TokenType.OPEN_CURLY_BRACKET)) { |
| 1842 wasOptionalParameter = true; | 1953 wasOptionalParameter = true; |
| 1843 if (leftCurlyBracket != null && !reportedMulipleNamedGroups) { | 1954 if (leftCurlyBracket != null && !reportedMulipleNamedGroups) { |
| 1844 reportError8(ParserErrorCode.MULTIPLE_NAMED_PARAMETER_GROUPS, []); | 1955 reportError9(ParserErrorCode.MULTIPLE_NAMED_PARAMETER_GROUPS, []); |
| 1845 reportedMulipleNamedGroups = true; | 1956 reportedMulipleNamedGroups = true; |
| 1846 } | 1957 } |
| 1847 if (leftSquareBracket != null && !reportedMixedGroups) { | 1958 if (leftSquareBracket != null && !reportedMixedGroups) { |
| 1848 reportError8(ParserErrorCode.MIXED_PARAMETER_GROUPS, []); | 1959 reportError9(ParserErrorCode.MIXED_PARAMETER_GROUPS, []); |
| 1849 reportedMixedGroups = true; | 1960 reportedMixedGroups = true; |
| 1850 } | 1961 } |
| 1851 leftCurlyBracket = andAdvance; | 1962 leftCurlyBracket = andAdvance; |
| 1852 currentParameters = namedParameters; | 1963 currentParameters = namedParameters; |
| 1853 kind = ParameterKind.NAMED; | 1964 kind = ParameterKind.NAMED; |
| 1854 } | 1965 } |
| 1855 FormalParameter parameter = parseFormalParameter(kind); | 1966 FormalParameter parameter = parseFormalParameter(kind); |
| 1856 parameters.add(parameter); | 1967 parameters.add(parameter); |
| 1857 currentParameters.add(parameter); | 1968 currentParameters.add(parameter); |
| 1858 if (identical(kind, ParameterKind.REQUIRED) && wasOptionalParameter) { | 1969 if (identical(kind, ParameterKind.REQUIRED) && wasOptionalParameter) { |
| 1859 reportError(ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS, parameter
, []); | 1970 reportError(ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS, parameter
, []); |
| 1860 } | 1971 } |
| 1861 if (matches5(TokenType.CLOSE_SQUARE_BRACKET)) { | 1972 if (matches5(TokenType.CLOSE_SQUARE_BRACKET)) { |
| 1862 rightSquareBracket = andAdvance; | 1973 rightSquareBracket = andAdvance; |
| 1863 currentParameters = normalParameters; | 1974 currentParameters = normalParameters; |
| 1864 if (leftSquareBracket == null) { | 1975 if (leftSquareBracket == null) { |
| 1865 if (leftCurlyBracket != null) { | 1976 if (leftCurlyBracket != null) { |
| 1866 reportError8(ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP, [
"}"]); | 1977 reportError9(ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP, [
"}"]); |
| 1867 rightCurlyBracket = rightSquareBracket; | 1978 rightCurlyBracket = rightSquareBracket; |
| 1868 rightSquareBracket = null; | 1979 rightSquareBracket = null; |
| 1869 } else { | 1980 } else { |
| 1870 reportError8(ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GRO
UP, ["["]); | 1981 reportError9(ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GRO
UP, ["["]); |
| 1871 } | 1982 } |
| 1872 } | 1983 } |
| 1873 kind = ParameterKind.REQUIRED; | 1984 kind = ParameterKind.REQUIRED; |
| 1874 } else if (matches5(TokenType.CLOSE_CURLY_BRACKET)) { | 1985 } else if (matches5(TokenType.CLOSE_CURLY_BRACKET)) { |
| 1875 rightCurlyBracket = andAdvance; | 1986 rightCurlyBracket = andAdvance; |
| 1876 currentParameters = normalParameters; | 1987 currentParameters = normalParameters; |
| 1877 if (leftCurlyBracket == null) { | 1988 if (leftCurlyBracket == null) { |
| 1878 if (leftSquareBracket != null) { | 1989 if (leftSquareBracket != null) { |
| 1879 reportError8(ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP, [
"]"]); | 1990 reportError9(ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP, [
"]"]); |
| 1880 rightSquareBracket = rightCurlyBracket; | 1991 rightSquareBracket = rightCurlyBracket; |
| 1881 rightCurlyBracket = null; | 1992 rightCurlyBracket = null; |
| 1882 } else { | 1993 } else { |
| 1883 reportError8(ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GRO
UP, ["{"]); | 1994 reportError9(ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GRO
UP, ["{"]); |
| 1884 } | 1995 } |
| 1885 } | 1996 } |
| 1886 kind = ParameterKind.REQUIRED; | 1997 kind = ParameterKind.REQUIRED; |
| 1887 } | 1998 } |
| 1888 } while (!matches5(TokenType.CLOSE_PAREN) && initialToken != _currentToken); | 1999 } while (!matches5(TokenType.CLOSE_PAREN) && initialToken != _currentToken); |
| 1889 Token rightParenthesis = expect2(TokenType.CLOSE_PAREN); | 2000 Token rightParenthesis = expect2(TokenType.CLOSE_PAREN); |
| 1890 if (leftSquareBracket != null && rightSquareBracket == null) { | 2001 if (leftSquareBracket != null && rightSquareBracket == null) { |
| 1891 reportError8(ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP, ["]"]
); | 2002 reportError9(ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP, ["]"]
); |
| 1892 } | 2003 } |
| 1893 if (leftCurlyBracket != null && rightCurlyBracket == null) { | 2004 if (leftCurlyBracket != null && rightCurlyBracket == null) { |
| 1894 reportError8(ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP, ["}"]
); | 2005 reportError9(ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP, ["}"]
); |
| 1895 } | 2006 } |
| 1896 if (leftSquareBracket == null) { | 2007 if (leftSquareBracket == null) { |
| 1897 leftSquareBracket = leftCurlyBracket; | 2008 leftSquareBracket = leftCurlyBracket; |
| 1898 } | 2009 } |
| 1899 if (rightSquareBracket == null) { | 2010 if (rightSquareBracket == null) { |
| 1900 rightSquareBracket = rightCurlyBracket; | 2011 rightSquareBracket = rightCurlyBracket; |
| 1901 } | 2012 } |
| 1902 return new FormalParameterList.full(leftParenthesis, parameters, leftSquareB
racket, rightSquareBracket, rightParenthesis); | 2013 return new FormalParameterList.full(leftParenthesis, parameters, leftSquareB
racket, rightSquareBracket, rightParenthesis); |
| 1903 } | 2014 } |
| 1904 | 2015 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2040 Token period = null; | 2151 Token period = null; |
| 2041 if (matches(Keyword.THIS)) { | 2152 if (matches(Keyword.THIS)) { |
| 2042 thisKeyword = andAdvance; | 2153 thisKeyword = andAdvance; |
| 2043 period = expect2(TokenType.PERIOD); | 2154 period = expect2(TokenType.PERIOD); |
| 2044 } | 2155 } |
| 2045 SimpleIdentifier identifier = parseSimpleIdentifier(); | 2156 SimpleIdentifier identifier = parseSimpleIdentifier(); |
| 2046 if (matches5(TokenType.OPEN_PAREN)) { | 2157 if (matches5(TokenType.OPEN_PAREN)) { |
| 2047 FormalParameterList parameters = parseFormalParameterList(); | 2158 FormalParameterList parameters = parseFormalParameterList(); |
| 2048 if (thisKeyword == null) { | 2159 if (thisKeyword == null) { |
| 2049 if (holder.keyword != null) { | 2160 if (holder.keyword != null) { |
| 2050 reportError9(ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, holder.keyw
ord, []); | 2161 reportError10(ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, holder.key
word, []); |
| 2051 } | 2162 } |
| 2052 return new FunctionTypedFormalParameter.full(commentAndMetadata.comment,
commentAndMetadata.metadata, holder.type, identifier, parameters); | 2163 return new FunctionTypedFormalParameter.full(commentAndMetadata.comment,
commentAndMetadata.metadata, holder.type, identifier, parameters); |
| 2053 } else { | 2164 } else { |
| 2054 return new FieldFormalParameter.full(commentAndMetadata.comment, comment
AndMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifi
er, parameters); | 2165 return new FieldFormalParameter.full(commentAndMetadata.comment, comment
AndMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifi
er, parameters); |
| 2055 } | 2166 } |
| 2056 } | 2167 } |
| 2057 TypeName type = holder.type; | 2168 TypeName type = holder.type; |
| 2058 if (type != null) { | 2169 if (type != null) { |
| 2059 if (matches3(type.name.beginToken, Keyword.VOID)) { | 2170 if (matches3(type.name.beginToken, Keyword.VOID)) { |
| 2060 reportError9(ParserErrorCode.VOID_PARAMETER, type.name.beginToken, []); | 2171 reportError10(ParserErrorCode.VOID_PARAMETER, type.name.beginToken, []); |
| 2061 } else if (holder.keyword != null && matches3(holder.keyword, Keyword.VAR)
) { | 2172 } else if (holder.keyword != null && matches3(holder.keyword, Keyword.VAR)
) { |
| 2062 reportError9(ParserErrorCode.VAR_AND_TYPE, holder.keyword, []); | 2173 reportError10(ParserErrorCode.VAR_AND_TYPE, holder.keyword, []); |
| 2063 } | 2174 } |
| 2064 } | 2175 } |
| 2065 if (thisKeyword != null) { | 2176 if (thisKeyword != null) { |
| 2066 return new FieldFormalParameter.full(commentAndMetadata.comment, commentAn
dMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifier
, null); | 2177 return new FieldFormalParameter.full(commentAndMetadata.comment, commentAn
dMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifier
, null); |
| 2067 } | 2178 } |
| 2068 return new SimpleFormalParameter.full(commentAndMetadata.comment, commentAnd
Metadata.metadata, holder.keyword, holder.type, identifier); | 2179 return new SimpleFormalParameter.full(commentAndMetadata.comment, commentAnd
Metadata.metadata, holder.keyword, holder.type, identifier); |
| 2069 } | 2180 } |
| 2070 | 2181 |
| 2071 /** | 2182 /** |
| 2072 * Parse a prefixed identifier. | 2183 * Parse a prefixed identifier. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2114 * identifier ::= | 2225 * identifier ::= |
| 2115 * IDENTIFIER | 2226 * IDENTIFIER |
| 2116 * </pre> | 2227 * </pre> |
| 2117 * | 2228 * |
| 2118 * @return the simple identifier that was parsed | 2229 * @return the simple identifier that was parsed |
| 2119 */ | 2230 */ |
| 2120 SimpleIdentifier parseSimpleIdentifier() { | 2231 SimpleIdentifier parseSimpleIdentifier() { |
| 2121 if (matchesIdentifier()) { | 2232 if (matchesIdentifier()) { |
| 2122 return new SimpleIdentifier.full(andAdvance); | 2233 return new SimpleIdentifier.full(andAdvance); |
| 2123 } | 2234 } |
| 2124 reportError8(ParserErrorCode.MISSING_IDENTIFIER, []); | 2235 reportError9(ParserErrorCode.MISSING_IDENTIFIER, []); |
| 2125 return createSyntheticIdentifier(); | 2236 return createSyntheticIdentifier(); |
| 2126 } | 2237 } |
| 2127 | 2238 |
| 2128 /** | 2239 /** |
| 2129 * Parse a statement. | 2240 * Parse a statement. |
| 2130 * | 2241 * |
| 2131 * <pre> | 2242 * <pre> |
| 2132 * statement ::= | 2243 * statement ::= |
| 2133 * label* nonLabeledStatement | 2244 * label* nonLabeledStatement |
| 2134 * </pre> | 2245 * </pre> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2162 List<StringLiteral> strings = new List<StringLiteral>(); | 2273 List<StringLiteral> strings = new List<StringLiteral>(); |
| 2163 while (matches5(TokenType.STRING)) { | 2274 while (matches5(TokenType.STRING)) { |
| 2164 Token string = andAdvance; | 2275 Token string = andAdvance; |
| 2165 if (matches5(TokenType.STRING_INTERPOLATION_EXPRESSION) || matches5(TokenT
ype.STRING_INTERPOLATION_IDENTIFIER)) { | 2276 if (matches5(TokenType.STRING_INTERPOLATION_EXPRESSION) || matches5(TokenT
ype.STRING_INTERPOLATION_IDENTIFIER)) { |
| 2166 strings.add(parseStringInterpolation(string)); | 2277 strings.add(parseStringInterpolation(string)); |
| 2167 } else { | 2278 } else { |
| 2168 strings.add(new SimpleStringLiteral.full(string, computeStringValue(stri
ng.lexeme, true, true))); | 2279 strings.add(new SimpleStringLiteral.full(string, computeStringValue(stri
ng.lexeme, true, true))); |
| 2169 } | 2280 } |
| 2170 } | 2281 } |
| 2171 if (strings.length < 1) { | 2282 if (strings.length < 1) { |
| 2172 reportError8(ParserErrorCode.EXPECTED_STRING_LITERAL, []); | 2283 reportError9(ParserErrorCode.EXPECTED_STRING_LITERAL, []); |
| 2173 return createSyntheticStringLiteral(); | 2284 return createSyntheticStringLiteral(); |
| 2174 } else if (strings.length == 1) { | 2285 } else if (strings.length == 1) { |
| 2175 return strings[0]; | 2286 return strings[0]; |
| 2176 } else { | 2287 } else { |
| 2177 return new AdjacentStrings.full(strings); | 2288 return new AdjacentStrings.full(strings); |
| 2178 } | 2289 } |
| 2179 } | 2290 } |
| 2180 | 2291 |
| 2181 /** | 2292 /** |
| 2182 * Parse a list of type arguments. | 2293 * Parse a list of type arguments. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 2208 * <pre> | 2319 * <pre> |
| 2209 * type ::= | 2320 * type ::= |
| 2210 * qualified typeArguments? | 2321 * qualified typeArguments? |
| 2211 * </pre> | 2322 * </pre> |
| 2212 * | 2323 * |
| 2213 * @return the type name that was parsed | 2324 * @return the type name that was parsed |
| 2214 */ | 2325 */ |
| 2215 TypeName parseTypeName() { | 2326 TypeName parseTypeName() { |
| 2216 Identifier typeName; | 2327 Identifier typeName; |
| 2217 if (matches(Keyword.VAR)) { | 2328 if (matches(Keyword.VAR)) { |
| 2218 reportError8(ParserErrorCode.VAR_AS_TYPE_NAME, []); | 2329 reportError9(ParserErrorCode.VAR_AS_TYPE_NAME, []); |
| 2219 typeName = new SimpleIdentifier.full(andAdvance); | 2330 typeName = new SimpleIdentifier.full(andAdvance); |
| 2220 } else if (matchesIdentifier()) { | 2331 } else if (matchesIdentifier()) { |
| 2221 typeName = parsePrefixedIdentifier(); | 2332 typeName = parsePrefixedIdentifier(); |
| 2222 } else { | 2333 } else { |
| 2223 typeName = createSyntheticIdentifier(); | 2334 typeName = createSyntheticIdentifier(); |
| 2224 reportError8(ParserErrorCode.EXPECTED_TYPE_NAME, []); | 2335 reportError9(ParserErrorCode.EXPECTED_TYPE_NAME, []); |
| 2225 } | 2336 } |
| 2226 TypeArgumentList typeArguments = null; | 2337 TypeArgumentList typeArguments = null; |
| 2227 if (matches5(TokenType.LT)) { | 2338 if (matches5(TokenType.LT)) { |
| 2228 typeArguments = parseTypeArgumentList(); | 2339 typeArguments = parseTypeArgumentList(); |
| 2229 } | 2340 } |
| 2230 return new TypeName.full(typeName, typeArguments); | 2341 return new TypeName.full(typeName, typeArguments); |
| 2231 } | 2342 } |
| 2232 | 2343 |
| 2233 /** | 2344 /** |
| 2234 * Parse a type parameter. | 2345 * Parse a type parameter. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2284 */ | 2395 */ |
| 2285 WithClause parseWithClause() { | 2396 WithClause parseWithClause() { |
| 2286 Token with2 = expect(Keyword.WITH); | 2397 Token with2 = expect(Keyword.WITH); |
| 2287 List<TypeName> types = new List<TypeName>(); | 2398 List<TypeName> types = new List<TypeName>(); |
| 2288 types.add(parseTypeName()); | 2399 types.add(parseTypeName()); |
| 2289 while (optional(TokenType.COMMA)) { | 2400 while (optional(TokenType.COMMA)) { |
| 2290 types.add(parseTypeName()); | 2401 types.add(parseTypeName()); |
| 2291 } | 2402 } |
| 2292 return new WithClause.full(with2, types); | 2403 return new WithClause.full(with2, types); |
| 2293 } | 2404 } |
| 2405 |
| 2294 void set currentToken(Token currentToken) { | 2406 void set currentToken(Token currentToken) { |
| 2295 this._currentToken = currentToken; | 2407 this._currentToken = currentToken; |
| 2296 } | 2408 } |
| 2297 | 2409 |
| 2298 /** | 2410 /** |
| 2299 * Advance to the next token in the token stream. | 2411 * Advance to the next token in the token stream. |
| 2300 */ | 2412 */ |
| 2301 void advance() { | 2413 void advance() { |
| 2302 _currentToken = _currentToken.next; | 2414 _currentToken = _currentToken.next; |
| 2303 } | 2415 } |
| 2304 | 2416 |
| 2305 /** | 2417 /** |
| 2306 * Append the character equivalent of the given scalar value to the given buil
der. Use the start | 2418 * Append the character equivalent of the given scalar value to the given buil
der. Use the start |
| 2307 * and end indices to report an error, and don't append anything to the builde
r, if the scalar | 2419 * and end indices to report an error, and don't append anything to the builde
r, if the scalar |
| 2308 * value is invalid. | 2420 * value is invalid. |
| 2309 * | 2421 * |
| 2310 * @param builder the builder to which the scalar value is to be appended | 2422 * @param builder the builder to which the scalar value is to be appended |
| 2311 * @param escapeSequence the escape sequence that was parsed to produce the sc
alar value | 2423 * @param escapeSequence the escape sequence that was parsed to produce the sc
alar value |
| 2312 * @param scalarValue the value to be appended | 2424 * @param scalarValue the value to be appended |
| 2313 * @param startIndex the index of the first character representing the scalar
value | 2425 * @param startIndex the index of the first character representing the scalar
value |
| 2314 * @param endIndex the index of the last character representing the scalar val
ue | 2426 * @param endIndex the index of the last character representing the scalar val
ue |
| 2315 */ | 2427 */ |
| 2316 void appendScalarValue(JavaStringBuilder builder, String escapeSequence, int s
calarValue, int startIndex, int endIndex) { | 2428 void appendScalarValue(JavaStringBuilder builder, String escapeSequence, int s
calarValue, int startIndex, int endIndex) { |
| 2317 if (scalarValue < 0 || scalarValue > Character.MAX_CODE_POINT || (scalarValu
e >= 0xD800 && scalarValue <= 0xDFFF)) { | 2429 if (scalarValue < 0 || scalarValue > Character.MAX_CODE_POINT || (scalarValu
e >= 0xD800 && scalarValue <= 0xDFFF)) { |
| 2318 reportError8(ParserErrorCode.INVALID_CODE_POINT, [escapeSequence]); | 2430 reportError9(ParserErrorCode.INVALID_CODE_POINT, [escapeSequence]); |
| 2319 return; | 2431 return; |
| 2320 } | 2432 } |
| 2321 if (scalarValue < Character.MAX_VALUE) { | 2433 if (scalarValue < Character.MAX_VALUE) { |
| 2322 builder.appendChar(scalarValue as int); | 2434 builder.appendChar(scalarValue as int); |
| 2323 } else { | 2435 } else { |
| 2324 builder.append(Character.toChars(scalarValue)); | 2436 builder.append(Character.toChars(scalarValue)); |
| 2325 } | 2437 } |
| 2326 } | 2438 } |
| 2327 | 2439 |
| 2328 /** | 2440 /** |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2451 * | 2563 * |
| 2452 * assignableSelector ::= | 2564 * assignableSelector ::= |
| 2453 * '[' expression ']' | 2565 * '[' expression ']' |
| 2454 * | '.' identifier | 2566 * | '.' identifier |
| 2455 * </pre> | 2567 * </pre> |
| 2456 * | 2568 * |
| 2457 * @param expression the expression being checked | 2569 * @param expression the expression being checked |
| 2458 */ | 2570 */ |
| 2459 void ensureAssignable(Expression expression) { | 2571 void ensureAssignable(Expression expression) { |
| 2460 if (expression != null && !expression.isAssignable) { | 2572 if (expression != null && !expression.isAssignable) { |
| 2461 reportError8(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, []); | 2573 reportError9(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, []); |
| 2462 } | 2574 } |
| 2463 } | 2575 } |
| 2464 | 2576 |
| 2465 /** | 2577 /** |
| 2466 * If the current token is a keyword matching the given string, return it afte
r advancing to the | 2578 * If the current token is a keyword matching the given string, return it afte
r advancing to the |
| 2467 * next token. Otherwise report an error and return the current token without
advancing. | 2579 * next token. Otherwise report an error and return the current token without
advancing. |
| 2468 * | 2580 * |
| 2469 * @param keyword the keyword that is expected | 2581 * @param keyword the keyword that is expected |
| 2470 * @return the token that matched the given type | 2582 * @return the token that matched the given type |
| 2471 */ | 2583 */ |
| 2472 Token expect(Keyword keyword) { | 2584 Token expect(Keyword keyword) { |
| 2473 if (matches(keyword)) { | 2585 if (matches(keyword)) { |
| 2474 return andAdvance; | 2586 return andAdvance; |
| 2475 } | 2587 } |
| 2476 reportError8(ParserErrorCode.EXPECTED_TOKEN, [keyword.syntax]); | 2588 reportError9(ParserErrorCode.EXPECTED_TOKEN, [keyword.syntax]); |
| 2477 return _currentToken; | 2589 return _currentToken; |
| 2478 } | 2590 } |
| 2479 | 2591 |
| 2480 /** | 2592 /** |
| 2481 * If the current token has the expected type, return it after advancing to th
e next token. | 2593 * If the current token has the expected type, return it after advancing to th
e next token. |
| 2482 * Otherwise report an error and return the current token without advancing. | 2594 * Otherwise report an error and return the current token without advancing. |
| 2483 * | 2595 * |
| 2484 * @param type the type of token that is expected | 2596 * @param type the type of token that is expected |
| 2485 * @return the token that matched the given type | 2597 * @return the token that matched the given type |
| 2486 */ | 2598 */ |
| 2487 Token expect2(TokenType type) { | 2599 Token expect2(TokenType type) { |
| 2488 if (matches5(type)) { | 2600 if (matches5(type)) { |
| 2489 return andAdvance; | 2601 return andAdvance; |
| 2490 } | 2602 } |
| 2491 if (identical(type, TokenType.SEMICOLON)) { | 2603 if (identical(type, TokenType.SEMICOLON)) { |
| 2492 reportError9(ParserErrorCode.EXPECTED_TOKEN, _currentToken.previous, [type
.lexeme]); | 2604 reportError10(ParserErrorCode.EXPECTED_TOKEN, _currentToken.previous, [typ
e.lexeme]); |
| 2493 } else { | 2605 } else { |
| 2494 reportError8(ParserErrorCode.EXPECTED_TOKEN, [type.lexeme]); | 2606 reportError9(ParserErrorCode.EXPECTED_TOKEN, [type.lexeme]); |
| 2495 } | 2607 } |
| 2496 return _currentToken; | 2608 return _currentToken; |
| 2497 } | 2609 } |
| 2498 | 2610 |
| 2499 /** | 2611 /** |
| 2500 * Search the given list of ranges for a range that contains the given index.
Return the range | 2612 * Search the given list of ranges for a range that contains the given index.
Return the range |
| 2501 * that was found, or `null` if none of the ranges contain the index. | 2613 * that was found, or `null` if none of the ranges contain the index. |
| 2502 * | 2614 * |
| 2503 * @param ranges the ranges to be searched | 2615 * @param ranges the ranges to be searched |
| 2504 * @param index the index contained in the returned range | 2616 * @param index the index contained in the returned range |
| 2505 * @return the range that was found | 2617 * @return the range that was found |
| 2506 */ | 2618 */ |
| 2507 List<int> findRange(List<List<int>> ranges, int index) { | 2619 List<int> findRange(List<List<int>> ranges, int index) { |
| 2508 for (List<int> range in ranges) { | 2620 for (List<int> range in ranges) { |
| 2509 if (range[0] <= index && index <= range[1]) { | 2621 if (range[0] <= index && index <= range[1]) { |
| 2510 return range; | 2622 return range; |
| 2511 } else if (index < range[0]) { | 2623 } else if (index < range[0]) { |
| 2512 return null; | 2624 return null; |
| 2513 } | 2625 } |
| 2514 } | 2626 } |
| 2515 return null; | 2627 return null; |
| 2516 } | 2628 } |
| 2629 |
| 2517 void gatherTodoComments(Token token) { | 2630 void gatherTodoComments(Token token) { |
| 2518 while (token != null && token.type != TokenType.EOF) { | 2631 while (token != null && token.type != TokenType.EOF) { |
| 2519 Token commentToken = token.precedingComments; | 2632 Token commentToken = token.precedingComments; |
| 2520 while (commentToken != null) { | 2633 while (commentToken != null) { |
| 2521 if (identical(commentToken.type, TokenType.SINGLE_LINE_COMMENT) || ident
ical(commentToken.type, TokenType.MULTI_LINE_COMMENT)) { | 2634 if (identical(commentToken.type, TokenType.SINGLE_LINE_COMMENT) || ident
ical(commentToken.type, TokenType.MULTI_LINE_COMMENT)) { |
| 2522 scrapeTodoComment(commentToken); | 2635 scrapeTodoComment(commentToken); |
| 2523 } | 2636 } |
| 2524 commentToken = commentToken.next; | 2637 commentToken = commentToken.next; |
| 2525 } | 2638 } |
| 2526 token = token.next; | 2639 token = token.next; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2583 | 2696 |
| 2584 /** | 2697 /** |
| 2585 * Return the end token associated with the given begin token, or `null` if ei
ther the given | 2698 * Return the end token associated with the given begin token, or `null` if ei
ther the given |
| 2586 * token is not a begin token or it does not have an end token associated with
it. | 2699 * token is not a begin token or it does not have an end token associated with
it. |
| 2587 * | 2700 * |
| 2588 * @param beginToken the token that is expected to have an end token associate
d with it | 2701 * @param beginToken the token that is expected to have an end token associate
d with it |
| 2589 * @return the end token associated with the begin token | 2702 * @return the end token associated with the begin token |
| 2590 */ | 2703 */ |
| 2591 Token getEndToken(Token beginToken) { | 2704 Token getEndToken(Token beginToken) { |
| 2592 if (beginToken is BeginToken) { | 2705 if (beginToken is BeginToken) { |
| 2593 return ((beginToken as BeginToken)).endToken; | 2706 return (beginToken as BeginToken).endToken; |
| 2594 } | 2707 } |
| 2595 return null; | 2708 return null; |
| 2596 } | 2709 } |
| 2597 | 2710 |
| 2598 /** | 2711 /** |
| 2599 * Return `true` if the current token is the first token of a return type that
is followed | 2712 * Return `true` if the current token is the first token of a return type that
is followed |
| 2600 * by an identifier, possibly followed by a list of type parameters, followed
by a | 2713 * by an identifier, possibly followed by a list of type parameters, followed
by a |
| 2601 * left-parenthesis. This is used by parseTypeAlias to determine whether or no
t to parse a return | 2714 * left-parenthesis. This is used by parseTypeAlias to determine whether or no
t to parse a return |
| 2602 * type. | 2715 * type. |
| 2603 * | 2716 * |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2750 return nextChar == 0x5B; | 2863 return nextChar == 0x5B; |
| 2751 } | 2864 } |
| 2752 | 2865 |
| 2753 /** | 2866 /** |
| 2754 * Return `true` if the given token appears to be the beginning of an operator
declaration. | 2867 * Return `true` if the given token appears to be the beginning of an operator
declaration. |
| 2755 * | 2868 * |
| 2756 * @param startToken the token that might be the start of an operator declarat
ion | 2869 * @param startToken the token that might be the start of an operator declarat
ion |
| 2757 * @return `true` if the given token appears to be the beginning of an operato
r declaration | 2870 * @return `true` if the given token appears to be the beginning of an operato
r declaration |
| 2758 */ | 2871 */ |
| 2759 bool isOperator(Token startToken) { | 2872 bool isOperator(Token startToken) { |
| 2760 if (startToken.isOperator) { | 2873 if (!startToken.isOperator) { |
| 2761 Token token = startToken.next; | 2874 return false; |
| 2762 while (token.isOperator) { | |
| 2763 token = token.next; | |
| 2764 } | |
| 2765 return matches4(token, TokenType.OPEN_PAREN); | |
| 2766 } | 2875 } |
| 2767 return false; | 2876 if (identical(startToken.type, TokenType.EQ)) { |
| 2877 return false; |
| 2878 } |
| 2879 Token token = startToken.next; |
| 2880 while (token.isOperator) { |
| 2881 token = token.next; |
| 2882 } |
| 2883 return matches4(token, TokenType.OPEN_PAREN); |
| 2768 } | 2884 } |
| 2769 | 2885 |
| 2770 /** | 2886 /** |
| 2771 * Return `true` if the current token appears to be the beginning of a switch
member. | 2887 * Return `true` if the current token appears to be the beginning of a switch
member. |
| 2772 * | 2888 * |
| 2773 * @return `true` if the current token appears to be the beginning of a switch
member | 2889 * @return `true` if the current token appears to be the beginning of a switch
member |
| 2774 */ | 2890 */ |
| 2775 bool isSwitchMember() { | 2891 bool isSwitchMember() { |
| 2776 Token token = _currentToken; | 2892 Token token = _currentToken; |
| 2777 while (matches4(token, TokenType.IDENTIFIER) && matches4(token.next, TokenTy
pe.COLON)) { | 2893 while (matches4(token, TokenType.IDENTIFIER) && matches4(token.next, TokenTy
pe.COLON)) { |
| 2778 token = token.next.next; | 2894 token = token.next.next; |
| 2779 } | 2895 } |
| 2780 if (identical(token.type, TokenType.KEYWORD)) { | 2896 if (identical(token.type, TokenType.KEYWORD)) { |
| 2781 Keyword keyword = ((token as KeywordToken)).keyword; | 2897 Keyword keyword = (token as KeywordToken).keyword; |
| 2782 return identical(keyword, Keyword.CASE) || identical(keyword, Keyword.DEFA
ULT); | 2898 return identical(keyword, Keyword.CASE) || identical(keyword, Keyword.DEFA
ULT); |
| 2783 } | 2899 } |
| 2784 return false; | 2900 return false; |
| 2785 } | 2901 } |
| 2786 | 2902 |
| 2787 /** | 2903 /** |
| 2788 * Return `true` if the given token appears to be the first token of a type na
me that is | 2904 * Return `true` if the given token appears to be the first token of a type na
me that is |
| 2789 * followed by a variable or field formal parameter. | 2905 * followed by a variable or field formal parameter. |
| 2790 * | 2906 * |
| 2791 * @param startToken the first token of the sequence being checked | 2907 * @param startToken the first token of the sequence being checked |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2843 */ | 2959 */ |
| 2844 bool matches2(String identifier) => identical(_currentToken.type, TokenType.ID
ENTIFIER) && _currentToken.lexeme == identifier; | 2960 bool matches2(String identifier) => identical(_currentToken.type, TokenType.ID
ENTIFIER) && _currentToken.lexeme == identifier; |
| 2845 | 2961 |
| 2846 /** | 2962 /** |
| 2847 * Return `true` if the given token matches the given keyword. | 2963 * Return `true` if the given token matches the given keyword. |
| 2848 * | 2964 * |
| 2849 * @param token the token being tested | 2965 * @param token the token being tested |
| 2850 * @param keyword the keyword that is being tested for | 2966 * @param keyword the keyword that is being tested for |
| 2851 * @return `true` if the given token matches the given keyword | 2967 * @return `true` if the given token matches the given keyword |
| 2852 */ | 2968 */ |
| 2853 bool matches3(Token token, Keyword keyword) => identical(token.type, TokenType
.KEYWORD) && identical(((token as KeywordToken)).keyword, keyword); | 2969 bool matches3(Token token, Keyword keyword) => identical(token.type, TokenType
.KEYWORD) && identical((token as KeywordToken).keyword, keyword); |
| 2854 | 2970 |
| 2855 /** | 2971 /** |
| 2856 * Return `true` if the given token has the given type. | 2972 * Return `true` if the given token has the given type. |
| 2857 * | 2973 * |
| 2858 * @param token the token being tested | 2974 * @param token the token being tested |
| 2859 * @param type the type of token that is being tested for | 2975 * @param type the type of token that is being tested for |
| 2860 * @return `true` if the given token has the given type | 2976 * @return `true` if the given token has the given type |
| 2861 */ | 2977 */ |
| 2862 bool matches4(Token token, TokenType type) => identical(token.type, type); | 2978 bool matches4(Token token, TokenType type) => identical(token.type, type); |
| 2863 | 2979 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2934 * @return `true` if the current token is a valid identifier | 3050 * @return `true` if the current token is a valid identifier |
| 2935 */ | 3051 */ |
| 2936 bool matchesIdentifier() => matchesIdentifier2(_currentToken); | 3052 bool matchesIdentifier() => matchesIdentifier2(_currentToken); |
| 2937 | 3053 |
| 2938 /** | 3054 /** |
| 2939 * Return `true` if the given token is a valid identifier. Valid identifiers i
nclude | 3055 * Return `true` if the given token is a valid identifier. Valid identifiers i
nclude |
| 2940 * built-in identifiers (pseudo-keywords). | 3056 * built-in identifiers (pseudo-keywords). |
| 2941 * | 3057 * |
| 2942 * @return `true` if the given token is a valid identifier | 3058 * @return `true` if the given token is a valid identifier |
| 2943 */ | 3059 */ |
| 2944 bool matchesIdentifier2(Token token) => matches4(token, TokenType.IDENTIFIER)
|| (matches4(token, TokenType.KEYWORD) && ((token as KeywordToken)).keyword.isPs
eudoKeyword); | 3060 bool matchesIdentifier2(Token token) => matches4(token, TokenType.IDENTIFIER)
|| (matches4(token, TokenType.KEYWORD) && (token as KeywordToken).keyword.isPseu
doKeyword); |
| 2945 | 3061 |
| 2946 /** | 3062 /** |
| 2947 * If the current token has the given type, then advance to the next token and
return `true` | 3063 * If the current token has the given type, then advance to the next token and
return `true` |
| 2948 * . Otherwise, return `false` without advancing. | 3064 * . Otherwise, return `false` without advancing. |
| 2949 * | 3065 * |
| 2950 * @param type the type of token that can optionally appear in the current loc
ation | 3066 * @param type the type of token that can optionally appear in the current loc
ation |
| 2951 * @return `true` if the current token has the given type | 3067 * @return `true` if the current token has the given type |
| 2952 */ | 3068 */ |
| 2953 bool optional(TokenType type) { | 3069 bool optional(TokenType type) { |
| 2954 if (matches5(type)) { | 3070 if (matches5(type)) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2989 * <pre> | 3105 * <pre> |
| 2990 * argumentDefinitionTest ::= | 3106 * argumentDefinitionTest ::= |
| 2991 * '?' identifier | 3107 * '?' identifier |
| 2992 * </pre> | 3108 * </pre> |
| 2993 * | 3109 * |
| 2994 * @return the argument definition test that was parsed | 3110 * @return the argument definition test that was parsed |
| 2995 */ | 3111 */ |
| 2996 ArgumentDefinitionTest parseArgumentDefinitionTest() { | 3112 ArgumentDefinitionTest parseArgumentDefinitionTest() { |
| 2997 Token question = expect2(TokenType.QUESTION); | 3113 Token question = expect2(TokenType.QUESTION); |
| 2998 SimpleIdentifier identifier = parseSimpleIdentifier(); | 3114 SimpleIdentifier identifier = parseSimpleIdentifier(); |
| 2999 reportError9(ParserErrorCode.DEPRECATED_ARGUMENT_DEFINITION_TEST, question,
[]); | 3115 reportError10(ParserErrorCode.DEPRECATED_ARGUMENT_DEFINITION_TEST, question,
[]); |
| 3000 return new ArgumentDefinitionTest.full(question, identifier); | 3116 return new ArgumentDefinitionTest.full(question, identifier); |
| 3001 } | 3117 } |
| 3002 | 3118 |
| 3003 /** | 3119 /** |
| 3004 * Parse an assert statement. | 3120 * Parse an assert statement. |
| 3005 * | 3121 * |
| 3006 * <pre> | 3122 * <pre> |
| 3007 * assertStatement ::= | 3123 * assertStatement ::= |
| 3008 * 'assert' '(' conditionalExpression ')' ';' | 3124 * 'assert' '(' conditionalExpression ')' ';' |
| 3009 * </pre> | 3125 * </pre> |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3096 if (matches5(TokenType.OPEN_SQUARE_BRACKET)) { | 3212 if (matches5(TokenType.OPEN_SQUARE_BRACKET)) { |
| 3097 Token leftBracket = andAdvance; | 3213 Token leftBracket = andAdvance; |
| 3098 Expression index = parseExpression2(); | 3214 Expression index = parseExpression2(); |
| 3099 Token rightBracket = expect2(TokenType.CLOSE_SQUARE_BRACKET); | 3215 Token rightBracket = expect2(TokenType.CLOSE_SQUARE_BRACKET); |
| 3100 return new IndexExpression.forTarget_full(prefix, leftBracket, index, righ
tBracket); | 3216 return new IndexExpression.forTarget_full(prefix, leftBracket, index, righ
tBracket); |
| 3101 } else if (matches5(TokenType.PERIOD)) { | 3217 } else if (matches5(TokenType.PERIOD)) { |
| 3102 Token period = andAdvance; | 3218 Token period = andAdvance; |
| 3103 return new PropertyAccess.full(prefix, period, parseSimpleIdentifier()); | 3219 return new PropertyAccess.full(prefix, period, parseSimpleIdentifier()); |
| 3104 } else { | 3220 } else { |
| 3105 if (!optional) { | 3221 if (!optional) { |
| 3106 reportError8(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, []); | 3222 reportError9(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, []); |
| 3107 } | 3223 } |
| 3108 return prefix; | 3224 return prefix; |
| 3109 } | 3225 } |
| 3110 } | 3226 } |
| 3111 | 3227 |
| 3112 /** | 3228 /** |
| 3113 * Parse a bitwise and expression. | 3229 * Parse a bitwise and expression. |
| 3114 * | 3230 * |
| 3115 * <pre> | 3231 * <pre> |
| 3116 * bitwiseAndExpression ::= | 3232 * bitwiseAndExpression ::= |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3169 * | 3285 * |
| 3170 * @return the break statement that was parsed | 3286 * @return the break statement that was parsed |
| 3171 */ | 3287 */ |
| 3172 Statement parseBreakStatement() { | 3288 Statement parseBreakStatement() { |
| 3173 Token breakKeyword = expect(Keyword.BREAK); | 3289 Token breakKeyword = expect(Keyword.BREAK); |
| 3174 SimpleIdentifier label = null; | 3290 SimpleIdentifier label = null; |
| 3175 if (matchesIdentifier()) { | 3291 if (matchesIdentifier()) { |
| 3176 label = parseSimpleIdentifier(); | 3292 label = parseSimpleIdentifier(); |
| 3177 } | 3293 } |
| 3178 if (!_inLoop && !_inSwitch && label == null) { | 3294 if (!_inLoop && !_inSwitch && label == null) { |
| 3179 reportError9(ParserErrorCode.BREAK_OUTSIDE_OF_LOOP, breakKeyword, []); | 3295 reportError10(ParserErrorCode.BREAK_OUTSIDE_OF_LOOP, breakKeyword, []); |
| 3180 } | 3296 } |
| 3181 Token semicolon = expect2(TokenType.SEMICOLON); | 3297 Token semicolon = expect2(TokenType.SEMICOLON); |
| 3182 return new BreakStatement.full(breakKeyword, label, semicolon); | 3298 return new BreakStatement.full(breakKeyword, label, semicolon); |
| 3183 } | 3299 } |
| 3184 | 3300 |
| 3185 /** | 3301 /** |
| 3186 * Parse a cascade section. | 3302 * Parse a cascade section. |
| 3187 * | 3303 * |
| 3188 * <pre> | 3304 * <pre> |
| 3189 * cascadeSection ::= | 3305 * cascadeSection ::= |
| (...skipping 15 matching lines...) Expand all Loading... |
| 3205 SimpleIdentifier functionName = null; | 3321 SimpleIdentifier functionName = null; |
| 3206 if (matchesIdentifier()) { | 3322 if (matchesIdentifier()) { |
| 3207 functionName = parseSimpleIdentifier(); | 3323 functionName = parseSimpleIdentifier(); |
| 3208 } else if (identical(_currentToken.type, TokenType.OPEN_SQUARE_BRACKET)) { | 3324 } else if (identical(_currentToken.type, TokenType.OPEN_SQUARE_BRACKET)) { |
| 3209 Token leftBracket = andAdvance; | 3325 Token leftBracket = andAdvance; |
| 3210 Expression index = parseExpression2(); | 3326 Expression index = parseExpression2(); |
| 3211 Token rightBracket = expect2(TokenType.CLOSE_SQUARE_BRACKET); | 3327 Token rightBracket = expect2(TokenType.CLOSE_SQUARE_BRACKET); |
| 3212 expression = new IndexExpression.forCascade_full(period, leftBracket, inde
x, rightBracket); | 3328 expression = new IndexExpression.forCascade_full(period, leftBracket, inde
x, rightBracket); |
| 3213 period = null; | 3329 period = null; |
| 3214 } else { | 3330 } else { |
| 3215 reportError9(ParserErrorCode.MISSING_IDENTIFIER, _currentToken, [_currentT
oken.lexeme]); | 3331 reportError10(ParserErrorCode.MISSING_IDENTIFIER, _currentToken, [_current
Token.lexeme]); |
| 3216 functionName = createSyntheticIdentifier(); | 3332 functionName = createSyntheticIdentifier(); |
| 3217 } | 3333 } |
| 3218 if (identical(_currentToken.type, TokenType.OPEN_PAREN)) { | 3334 if (identical(_currentToken.type, TokenType.OPEN_PAREN)) { |
| 3219 while (identical(_currentToken.type, TokenType.OPEN_PAREN)) { | 3335 while (identical(_currentToken.type, TokenType.OPEN_PAREN)) { |
| 3220 if (functionName != null) { | 3336 if (functionName != null) { |
| 3221 expression = new MethodInvocation.full(expression, period, functionNam
e, parseArgumentList()); | 3337 expression = new MethodInvocation.full(expression, period, functionNam
e, parseArgumentList()); |
| 3222 period = null; | 3338 period = null; |
| 3223 functionName = null; | 3339 functionName = null; |
| 3224 } else if (expression == null) { | 3340 } else if (expression == null) { |
| 3225 expression = new MethodInvocation.full(expression, period, createSynth
eticIdentifier(), parseArgumentList()); | 3341 expression = new MethodInvocation.full(expression, period, createSynth
eticIdentifier(), parseArgumentList()); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3291 } | 3407 } |
| 3292 ExtendsClause extendsClause = null; | 3408 ExtendsClause extendsClause = null; |
| 3293 WithClause withClause = null; | 3409 WithClause withClause = null; |
| 3294 ImplementsClause implementsClause = null; | 3410 ImplementsClause implementsClause = null; |
| 3295 bool foundClause = true; | 3411 bool foundClause = true; |
| 3296 while (foundClause) { | 3412 while (foundClause) { |
| 3297 if (matches(Keyword.EXTENDS)) { | 3413 if (matches(Keyword.EXTENDS)) { |
| 3298 if (extendsClause == null) { | 3414 if (extendsClause == null) { |
| 3299 extendsClause = parseExtendsClause(); | 3415 extendsClause = parseExtendsClause(); |
| 3300 if (withClause != null) { | 3416 if (withClause != null) { |
| 3301 reportError9(ParserErrorCode.WITH_BEFORE_EXTENDS, withClause.withKey
word, []); | 3417 reportError10(ParserErrorCode.WITH_BEFORE_EXTENDS, withClause.withKe
yword, []); |
| 3302 } else if (implementsClause != null) { | 3418 } else if (implementsClause != null) { |
| 3303 reportError9(ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS, implementsCl
ause.keyword, []); | 3419 reportError10(ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS, implementsC
lause.keyword, []); |
| 3304 } | 3420 } |
| 3305 } else { | 3421 } else { |
| 3306 reportError9(ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES, extendsClause.k
eyword, []); | 3422 reportError10(ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES, extendsClause.
keyword, []); |
| 3307 parseExtendsClause(); | 3423 parseExtendsClause(); |
| 3308 } | 3424 } |
| 3309 } else if (matches(Keyword.WITH)) { | 3425 } else if (matches(Keyword.WITH)) { |
| 3310 if (withClause == null) { | 3426 if (withClause == null) { |
| 3311 withClause = parseWithClause(); | 3427 withClause = parseWithClause(); |
| 3312 if (implementsClause != null) { | 3428 if (implementsClause != null) { |
| 3313 reportError9(ParserErrorCode.IMPLEMENTS_BEFORE_WITH, implementsClaus
e.keyword, []); | 3429 reportError10(ParserErrorCode.IMPLEMENTS_BEFORE_WITH, implementsClau
se.keyword, []); |
| 3314 } | 3430 } |
| 3315 } else { | 3431 } else { |
| 3316 reportError9(ParserErrorCode.MULTIPLE_WITH_CLAUSES, withClause.withKey
word, []); | 3432 reportError10(ParserErrorCode.MULTIPLE_WITH_CLAUSES, withClause.withKe
yword, []); |
| 3317 parseWithClause(); | 3433 parseWithClause(); |
| 3318 } | 3434 } |
| 3319 } else if (matches(Keyword.IMPLEMENTS)) { | 3435 } else if (matches(Keyword.IMPLEMENTS)) { |
| 3320 if (implementsClause == null) { | 3436 if (implementsClause == null) { |
| 3321 implementsClause = parseImplementsClause(); | 3437 implementsClause = parseImplementsClause(); |
| 3322 } else { | 3438 } else { |
| 3323 reportError9(ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES, implementsCl
ause.keyword, []); | 3439 reportError10(ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES, implementsC
lause.keyword, []); |
| 3324 parseImplementsClause(); | 3440 parseImplementsClause(); |
| 3325 } | 3441 } |
| 3326 } else { | 3442 } else { |
| 3327 foundClause = false; | 3443 foundClause = false; |
| 3328 } | 3444 } |
| 3329 } | 3445 } |
| 3330 if (withClause != null && extendsClause == null) { | 3446 if (withClause != null && extendsClause == null) { |
| 3331 reportError9(ParserErrorCode.WITH_WITHOUT_EXTENDS, withClause.withKeyword,
[]); | 3447 reportError10(ParserErrorCode.WITH_WITHOUT_EXTENDS, withClause.withKeyword
, []); |
| 3332 } | 3448 } |
| 3333 NativeClause nativeClause = null; | 3449 NativeClause nativeClause = null; |
| 3334 if (matches2(_NATIVE) && matches4(peek(), TokenType.STRING)) { | 3450 if (matches2(_NATIVE) && matches4(peek(), TokenType.STRING)) { |
| 3335 nativeClause = parseNativeClause(); | 3451 nativeClause = parseNativeClause(); |
| 3336 } | 3452 } |
| 3337 Token leftBracket = null; | 3453 Token leftBracket = null; |
| 3338 List<ClassMember> members = null; | 3454 List<ClassMember> members = null; |
| 3339 Token rightBracket = null; | 3455 Token rightBracket = null; |
| 3340 if (matches5(TokenType.OPEN_CURLY_BRACKET)) { | 3456 if (matches5(TokenType.OPEN_CURLY_BRACKET)) { |
| 3341 leftBracket = expect2(TokenType.OPEN_CURLY_BRACKET); | 3457 leftBracket = expect2(TokenType.OPEN_CURLY_BRACKET); |
| 3342 members = parseClassMembers(className, getEndToken(leftBracket)); | 3458 members = parseClassMembers(className, getEndToken(leftBracket)); |
| 3343 rightBracket = expect2(TokenType.CLOSE_CURLY_BRACKET); | 3459 rightBracket = expect2(TokenType.CLOSE_CURLY_BRACKET); |
| 3344 } else { | 3460 } else { |
| 3345 leftBracket = createSyntheticToken2(TokenType.OPEN_CURLY_BRACKET); | 3461 leftBracket = createSyntheticToken2(TokenType.OPEN_CURLY_BRACKET); |
| 3346 rightBracket = createSyntheticToken2(TokenType.CLOSE_CURLY_BRACKET); | 3462 rightBracket = createSyntheticToken2(TokenType.CLOSE_CURLY_BRACKET); |
| 3347 reportError8(ParserErrorCode.MISSING_CLASS_BODY, []); | 3463 reportError9(ParserErrorCode.MISSING_CLASS_BODY, []); |
| 3348 } | 3464 } |
| 3349 ClassDeclaration classDeclaration = new ClassDeclaration.full(commentAndMeta
data.comment, commentAndMetadata.metadata, abstractKeyword, keyword, name, typeP
arameters, extendsClause, withClause, implementsClause, leftBracket, members, ri
ghtBracket); | 3465 ClassDeclaration classDeclaration = new ClassDeclaration.full(commentAndMeta
data.comment, commentAndMetadata.metadata, abstractKeyword, keyword, name, typeP
arameters, extendsClause, withClause, implementsClause, leftBracket, members, ri
ghtBracket); |
| 3350 classDeclaration.nativeClause = nativeClause; | 3466 classDeclaration.nativeClause = nativeClause; |
| 3351 return classDeclaration; | 3467 return classDeclaration; |
| 3352 } | 3468 } |
| 3353 | 3469 |
| 3354 /** | 3470 /** |
| 3355 * Parse a list of class members. | 3471 * Parse a list of class members. |
| 3356 * | 3472 * |
| 3357 * <pre> | 3473 * <pre> |
| 3358 * classMembers ::= | 3474 * classMembers ::= |
| 3359 * (metadata memberDefinition)* | 3475 * (metadata memberDefinition)* |
| 3360 * </pre> | 3476 * </pre> |
| 3361 * | 3477 * |
| 3362 * @param className the name of the class whose members are being parsed | 3478 * @param className the name of the class whose members are being parsed |
| 3363 * @param closingBracket the closing bracket for the class, or `null` if the c
losing bracket | 3479 * @param closingBracket the closing bracket for the class, or `null` if the c
losing bracket |
| 3364 * is missing | 3480 * is missing |
| 3365 * @return the list of class members that were parsed | 3481 * @return the list of class members that were parsed |
| 3366 */ | 3482 */ |
| 3367 List<ClassMember> parseClassMembers(String className, Token closingBracket) { | 3483 List<ClassMember> parseClassMembers(String className, Token closingBracket) { |
| 3368 List<ClassMember> members = new List<ClassMember>(); | 3484 List<ClassMember> members = new List<ClassMember>(); |
| 3369 Token memberStart = _currentToken; | 3485 Token memberStart = _currentToken; |
| 3370 while (!matches5(TokenType.EOF) && !matches5(TokenType.CLOSE_CURLY_BRACKET)
&& (closingBracket != null || (!matches(Keyword.CLASS) && !matches(Keyword.TYPED
EF)))) { | 3486 while (!matches5(TokenType.EOF) && !matches5(TokenType.CLOSE_CURLY_BRACKET)
&& (closingBracket != null || (!matches(Keyword.CLASS) && !matches(Keyword.TYPED
EF)))) { |
| 3371 if (matches5(TokenType.SEMICOLON)) { | 3487 if (matches5(TokenType.SEMICOLON)) { |
| 3372 reportError9(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_currentT
oken.lexeme]); | 3488 reportError10(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_current
Token.lexeme]); |
| 3373 advance(); | 3489 advance(); |
| 3374 } else { | 3490 } else { |
| 3375 ClassMember member = parseClassMember(className); | 3491 ClassMember member = parseClassMember(className); |
| 3376 if (member != null) { | 3492 if (member != null) { |
| 3377 members.add(member); | 3493 members.add(member); |
| 3378 } | 3494 } |
| 3379 } | 3495 } |
| 3380 if (identical(_currentToken, memberStart)) { | 3496 if (identical(_currentToken, memberStart)) { |
| 3381 reportError9(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_currentT
oken.lexeme]); | 3497 reportError10(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_current
Token.lexeme]); |
| 3382 advance(); | 3498 advance(); |
| 3383 } | 3499 } |
| 3384 memberStart = _currentToken; | 3500 memberStart = _currentToken; |
| 3385 } | 3501 } |
| 3386 return members; | 3502 return members; |
| 3387 } | 3503 } |
| 3388 | 3504 |
| 3389 /** | 3505 /** |
| 3390 * Parse a class type alias. | 3506 * Parse a class type alias. |
| 3391 * | 3507 * |
| (...skipping 27 matching lines...) Expand all Loading... |
| 3419 } | 3535 } |
| 3420 ImplementsClause implementsClause = null; | 3536 ImplementsClause implementsClause = null; |
| 3421 if (matches(Keyword.IMPLEMENTS)) { | 3537 if (matches(Keyword.IMPLEMENTS)) { |
| 3422 implementsClause = parseImplementsClause(); | 3538 implementsClause = parseImplementsClause(); |
| 3423 } | 3539 } |
| 3424 Token semicolon; | 3540 Token semicolon; |
| 3425 if (matches5(TokenType.SEMICOLON)) { | 3541 if (matches5(TokenType.SEMICOLON)) { |
| 3426 semicolon = andAdvance; | 3542 semicolon = andAdvance; |
| 3427 } else { | 3543 } else { |
| 3428 if (matches5(TokenType.OPEN_CURLY_BRACKET)) { | 3544 if (matches5(TokenType.OPEN_CURLY_BRACKET)) { |
| 3429 reportError8(ParserErrorCode.EXPECTED_TOKEN, [TokenType.SEMICOLON.lexeme
]); | 3545 reportError9(ParserErrorCode.EXPECTED_TOKEN, [TokenType.SEMICOLON.lexeme
]); |
| 3430 Token leftBracket = andAdvance; | 3546 Token leftBracket = andAdvance; |
| 3431 parseClassMembers(className.name, getEndToken(leftBracket)); | 3547 parseClassMembers(className.name, getEndToken(leftBracket)); |
| 3432 expect2(TokenType.CLOSE_CURLY_BRACKET); | 3548 expect2(TokenType.CLOSE_CURLY_BRACKET); |
| 3433 } else { | 3549 } else { |
| 3434 reportError9(ParserErrorCode.EXPECTED_TOKEN, _currentToken.previous, [To
kenType.SEMICOLON.lexeme]); | 3550 reportError10(ParserErrorCode.EXPECTED_TOKEN, _currentToken.previous, [T
okenType.SEMICOLON.lexeme]); |
| 3435 } | 3551 } |
| 3436 semicolon = createSyntheticToken2(TokenType.SEMICOLON); | 3552 semicolon = createSyntheticToken2(TokenType.SEMICOLON); |
| 3437 } | 3553 } |
| 3438 return new ClassTypeAlias.full(commentAndMetadata.comment, commentAndMetadat
a.metadata, keyword, className, typeParameters, equals, abstractKeyword, supercl
ass, withClause, implementsClause, semicolon); | 3554 return new ClassTypeAlias.full(commentAndMetadata.comment, commentAndMetadat
a.metadata, keyword, className, typeParameters, equals, abstractKeyword, supercl
ass, withClause, implementsClause, semicolon); |
| 3439 } | 3555 } |
| 3440 | 3556 |
| 3441 /** | 3557 /** |
| 3442 * Parse a list of combinators in a directive. | 3558 * Parse a list of combinators in a directive. |
| 3443 * | 3559 * |
| 3444 * <pre> | 3560 * <pre> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3501 * comment | 3617 * comment |
| 3502 * @param sourceOffset the offset of the first character of the reference sour
ce | 3618 * @param sourceOffset the offset of the first character of the reference sour
ce |
| 3503 * @return the comment reference that was parsed, or `null` if no reference co
uld be found | 3619 * @return the comment reference that was parsed, or `null` if no reference co
uld be found |
| 3504 */ | 3620 */ |
| 3505 CommentReference parseCommentReference(String referenceSource, int sourceOffse
t) { | 3621 CommentReference parseCommentReference(String referenceSource, int sourceOffse
t) { |
| 3506 if (referenceSource.length == 0) { | 3622 if (referenceSource.length == 0) { |
| 3507 return null; | 3623 return null; |
| 3508 } | 3624 } |
| 3509 try { | 3625 try { |
| 3510 List<bool> errorFound = [false]; | 3626 List<bool> errorFound = [false]; |
| 3511 AnalysisErrorListener listener = new AnalysisErrorListener_15(errorFound); | 3627 AnalysisErrorListener listener = new AnalysisErrorListener_16(errorFound); |
| 3512 Scanner scanner = new Scanner(null, new SubSequenceReader(new CharSequence
(referenceSource), sourceOffset), listener); | 3628 Scanner scanner = new Scanner(null, new SubSequenceReader(new CharSequence
(referenceSource), sourceOffset), listener); |
| 3513 scanner.setSourceStart(1, 1); | 3629 scanner.setSourceStart(1, 1); |
| 3514 Token firstToken = scanner.tokenize(); | 3630 Token firstToken = scanner.tokenize(); |
| 3515 if (errorFound[0]) { | 3631 if (errorFound[0]) { |
| 3516 return null; | 3632 return null; |
| 3517 } | 3633 } |
| 3518 Token newKeyword = null; | 3634 Token newKeyword = null; |
| 3519 if (matches3(firstToken, Keyword.NEW)) { | 3635 if (matches3(firstToken, Keyword.NEW)) { |
| 3520 newKeyword = firstToken; | 3636 newKeyword = firstToken; |
| 3521 firstToken = firstToken.next; | 3637 firstToken = firstToken.next; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3609 * </pre> | 3725 * </pre> |
| 3610 * | 3726 * |
| 3611 * @param commentAndMetadata the metadata to be associated with the member | 3727 * @param commentAndMetadata the metadata to be associated with the member |
| 3612 * @return the compilation unit member that was parsed, or `null` if what was
parsed could | 3728 * @return the compilation unit member that was parsed, or `null` if what was
parsed could |
| 3613 * not be represented as a compilation unit member | 3729 * not be represented as a compilation unit member |
| 3614 */ | 3730 */ |
| 3615 CompilationUnitMember parseCompilationUnitMember(CommentAndMetadata commentAnd
Metadata) { | 3731 CompilationUnitMember parseCompilationUnitMember(CommentAndMetadata commentAnd
Metadata) { |
| 3616 Modifiers modifiers = parseModifiers(); | 3732 Modifiers modifiers = parseModifiers(); |
| 3617 if (matches(Keyword.CLASS)) { | 3733 if (matches(Keyword.CLASS)) { |
| 3618 return parseClassDeclaration(commentAndMetadata, validateModifiersForClass
(modifiers)); | 3734 return parseClassDeclaration(commentAndMetadata, validateModifiersForClass
(modifiers)); |
| 3619 } else if (matches(Keyword.TYPEDEF) && !matches4(peek(), TokenType.PERIOD) &
& !matches4(peek(), TokenType.LT)) { | 3735 } else if (matches(Keyword.TYPEDEF) && !matches4(peek(), TokenType.PERIOD) &
& !matches4(peek(), TokenType.LT) && !matches4(peek(), TokenType.OPEN_PAREN)) { |
| 3620 validateModifiersForTypedef(modifiers); | 3736 validateModifiersForTypedef(modifiers); |
| 3621 return parseTypeAlias(commentAndMetadata); | 3737 return parseTypeAlias(commentAndMetadata); |
| 3622 } | 3738 } |
| 3623 if (matches(Keyword.VOID)) { | 3739 if (matches(Keyword.VOID)) { |
| 3624 TypeName returnType = parseReturnType(); | 3740 TypeName returnType = parseReturnType(); |
| 3625 if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifier2(p
eek())) { | 3741 if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifier2(p
eek())) { |
| 3626 validateModifiersForTopLevelFunction(modifiers); | 3742 validateModifiersForTopLevelFunction(modifiers); |
| 3627 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKe
yword, null); | 3743 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKe
yword, null); |
| 3628 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) { | 3744 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) { |
| 3629 reportError9(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []); | 3745 reportError10(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []); |
| 3630 return convertToFunctionDeclaration(parseOperator(commentAndMetadata, mo
difiers.externalKeyword, returnType)); | 3746 return convertToFunctionDeclaration(parseOperator(commentAndMetadata, mo
difiers.externalKeyword, returnType)); |
| 3631 } else if (matchesIdentifier() && matchesAny(peek(), [ | 3747 } else if (matchesIdentifier() && matchesAny(peek(), [ |
| 3632 TokenType.OPEN_PAREN, | 3748 TokenType.OPEN_PAREN, |
| 3633 TokenType.OPEN_CURLY_BRACKET, | 3749 TokenType.OPEN_CURLY_BRACKET, |
| 3634 TokenType.FUNCTION])) { | 3750 TokenType.FUNCTION])) { |
| 3635 validateModifiersForTopLevelFunction(modifiers); | 3751 validateModifiersForTopLevelFunction(modifiers); |
| 3636 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKe
yword, returnType); | 3752 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKe
yword, returnType); |
| 3637 } else { | 3753 } else { |
| 3638 if (matchesIdentifier()) { | 3754 if (matchesIdentifier()) { |
| 3639 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMIC
OLON])) { | 3755 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMIC
OLON])) { |
| 3640 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []); | 3756 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []); |
| 3641 return new TopLevelVariableDeclaration.full(commentAndMetadata.comme
nt, commentAndMetadata.metadata, parseVariableDeclarationList2(null, validateMod
ifiersForTopLevelVariable(modifiers), null), expect2(TokenType.SEMICOLON)); | 3757 return new TopLevelVariableDeclaration.full(commentAndMetadata.comme
nt, commentAndMetadata.metadata, parseVariableDeclarationList2(null, validateMod
ifiersForTopLevelVariable(modifiers), null), expect2(TokenType.SEMICOLON)); |
| 3642 } | 3758 } |
| 3643 } | 3759 } |
| 3644 reportError9(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []); | 3760 reportError10(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []); |
| 3645 return null; | 3761 return null; |
| 3646 } | 3762 } |
| 3647 } else if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifi
er2(peek())) { | 3763 } else if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifi
er2(peek())) { |
| 3648 validateModifiersForTopLevelFunction(modifiers); | 3764 validateModifiersForTopLevelFunction(modifiers); |
| 3649 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw
ord, null); | 3765 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw
ord, null); |
| 3650 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) { | 3766 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) { |
| 3651 reportError9(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []); | 3767 reportError10(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []); |
| 3652 return convertToFunctionDeclaration(parseOperator(commentAndMetadata, modi
fiers.externalKeyword, null)); | 3768 return convertToFunctionDeclaration(parseOperator(commentAndMetadata, modi
fiers.externalKeyword, null)); |
| 3653 } else if (!matchesIdentifier()) { | 3769 } else if (!matchesIdentifier()) { |
| 3654 reportError9(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []); | 3770 reportError10(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []); |
| 3655 return null; | 3771 return null; |
| 3656 } else if (matches4(peek(), TokenType.OPEN_PAREN)) { | 3772 } else if (matches4(peek(), TokenType.OPEN_PAREN)) { |
| 3657 validateModifiersForTopLevelFunction(modifiers); | 3773 validateModifiersForTopLevelFunction(modifiers); |
| 3658 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw
ord, null); | 3774 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw
ord, null); |
| 3659 } else if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMI
COLON])) { | 3775 } else if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEMI
COLON])) { |
| 3660 if (modifiers.constKeyword == null && modifiers.finalKeyword == null && mo
difiers.varKeyword == null) { | 3776 if (modifiers.constKeyword == null && modifiers.finalKeyword == null && mo
difiers.varKeyword == null) { |
| 3661 reportError8(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, []); | 3777 reportError9(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, []); |
| 3662 } | 3778 } |
| 3663 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co
mmentAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiers
ForTopLevelVariable(modifiers), null), expect2(TokenType.SEMICOLON)); | 3779 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co
mmentAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiers
ForTopLevelVariable(modifiers), null), expect2(TokenType.SEMICOLON)); |
| 3664 } | 3780 } |
| 3665 TypeName returnType = parseReturnType(); | 3781 TypeName returnType = parseReturnType(); |
| 3666 if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifier2(pee
k())) { | 3782 if ((matches(Keyword.GET) || matches(Keyword.SET)) && matchesIdentifier2(pee
k())) { |
| 3667 validateModifiersForTopLevelFunction(modifiers); | 3783 validateModifiersForTopLevelFunction(modifiers); |
| 3668 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw
ord, returnType); | 3784 return parseFunctionDeclaration(commentAndMetadata, modifiers.externalKeyw
ord, returnType); |
| 3669 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) { | 3785 } else if (matches(Keyword.OPERATOR) && isOperator(peek())) { |
| 3670 reportError9(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []); | 3786 reportError10(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken, []); |
| 3671 return convertToFunctionDeclaration(parseOperator(commentAndMetadata, modi
fiers.externalKeyword, returnType)); | 3787 return convertToFunctionDeclaration(parseOperator(commentAndMetadata, modi
fiers.externalKeyword, returnType)); |
| 3672 } else if (matches5(TokenType.AT)) { | 3788 } else if (matches5(TokenType.AT)) { |
| 3673 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co
mmentAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiers
ForTopLevelVariable(modifiers), returnType), expect2(TokenType.SEMICOLON)); | 3789 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co
mmentAndMetadata.metadata, parseVariableDeclarationList2(null, validateModifiers
ForTopLevelVariable(modifiers), returnType), expect2(TokenType.SEMICOLON)); |
| 3674 } else if (!matchesIdentifier()) { | 3790 } else if (!matchesIdentifier()) { |
| 3675 reportError9(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []); | 3791 reportError10(ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken, []); |
| 3676 Token semicolon; | 3792 Token semicolon; |
| 3677 if (matches5(TokenType.SEMICOLON)) { | 3793 if (matches5(TokenType.SEMICOLON)) { |
| 3678 semicolon = andAdvance; | 3794 semicolon = andAdvance; |
| 3679 } else { | 3795 } else { |
| 3680 semicolon = createSyntheticToken2(TokenType.SEMICOLON); | 3796 semicolon = createSyntheticToken2(TokenType.SEMICOLON); |
| 3681 } | 3797 } |
| 3682 List<VariableDeclaration> variables = new List<VariableDeclaration>(); | 3798 List<VariableDeclaration> variables = new List<VariableDeclaration>(); |
| 3683 variables.add(new VariableDeclaration.full(null, null, createSyntheticIden
tifier(), null, null)); | 3799 variables.add(new VariableDeclaration.full(null, null, createSyntheticIden
tifier(), null, null)); |
| 3684 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co
mmentAndMetadata.metadata, new VariableDeclarationList.full(null, null, null, re
turnType, variables), semicolon); | 3800 return new TopLevelVariableDeclaration.full(commentAndMetadata.comment, co
mmentAndMetadata.metadata, new VariableDeclarationList.full(null, null, null, re
turnType, variables), semicolon); |
| 3685 } | 3801 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 3709 Token keyword = expect(Keyword.CONST); | 3825 Token keyword = expect(Keyword.CONST); |
| 3710 if (matches5(TokenType.OPEN_SQUARE_BRACKET) || matches5(TokenType.INDEX)) { | 3826 if (matches5(TokenType.OPEN_SQUARE_BRACKET) || matches5(TokenType.INDEX)) { |
| 3711 return parseListLiteral(keyword, null); | 3827 return parseListLiteral(keyword, null); |
| 3712 } else if (matches5(TokenType.OPEN_CURLY_BRACKET)) { | 3828 } else if (matches5(TokenType.OPEN_CURLY_BRACKET)) { |
| 3713 return parseMapLiteral(keyword, null); | 3829 return parseMapLiteral(keyword, null); |
| 3714 } else if (matches5(TokenType.LT)) { | 3830 } else if (matches5(TokenType.LT)) { |
| 3715 return parseListOrMapLiteral(keyword); | 3831 return parseListOrMapLiteral(keyword); |
| 3716 } | 3832 } |
| 3717 return parseInstanceCreationExpression(keyword); | 3833 return parseInstanceCreationExpression(keyword); |
| 3718 } | 3834 } |
| 3835 |
| 3719 ConstructorDeclaration parseConstructor(CommentAndMetadata commentAndMetadata,
Token externalKeyword, Token constKeyword, Token factoryKeyword, SimpleIdentifi
er returnType, Token period, SimpleIdentifier name, FormalParameterList paramete
rs) { | 3836 ConstructorDeclaration parseConstructor(CommentAndMetadata commentAndMetadata,
Token externalKeyword, Token constKeyword, Token factoryKeyword, SimpleIdentifi
er returnType, Token period, SimpleIdentifier name, FormalParameterList paramete
rs) { |
| 3720 bool bodyAllowed = externalKeyword == null; | 3837 bool bodyAllowed = externalKeyword == null; |
| 3721 Token separator = null; | 3838 Token separator = null; |
| 3722 List<ConstructorInitializer> initializers = null; | 3839 List<ConstructorInitializer> initializers = null; |
| 3723 if (matches5(TokenType.COLON)) { | 3840 if (matches5(TokenType.COLON)) { |
| 3724 separator = andAdvance; | 3841 separator = andAdvance; |
| 3725 initializers = new List<ConstructorInitializer>(); | 3842 initializers = new List<ConstructorInitializer>(); |
| 3726 do { | 3843 do { |
| 3727 if (matches(Keyword.THIS)) { | 3844 if (matches(Keyword.THIS)) { |
| 3728 if (matches4(peek(), TokenType.OPEN_PAREN)) { | 3845 if (matches4(peek(), TokenType.OPEN_PAREN)) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 3746 if (matches5(TokenType.EQ)) { | 3863 if (matches5(TokenType.EQ)) { |
| 3747 separator = andAdvance; | 3864 separator = andAdvance; |
| 3748 redirectedConstructor = parseConstructorName(); | 3865 redirectedConstructor = parseConstructorName(); |
| 3749 body = new EmptyFunctionBody.full(expect2(TokenType.SEMICOLON)); | 3866 body = new EmptyFunctionBody.full(expect2(TokenType.SEMICOLON)); |
| 3750 if (factoryKeyword == null) { | 3867 if (factoryKeyword == null) { |
| 3751 reportError(ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR, redi
rectedConstructor, []); | 3868 reportError(ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR, redi
rectedConstructor, []); |
| 3752 } | 3869 } |
| 3753 } else { | 3870 } else { |
| 3754 body = parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION_BODY, fals
e); | 3871 body = parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION_BODY, fals
e); |
| 3755 if (constKeyword != null && factoryKeyword != null) { | 3872 if (constKeyword != null && factoryKeyword != null) { |
| 3756 reportError9(ParserErrorCode.CONST_FACTORY, factoryKeyword, []); | 3873 reportError10(ParserErrorCode.CONST_FACTORY, factoryKeyword, []); |
| 3757 } else if (body is EmptyFunctionBody) { | 3874 } else if (body is EmptyFunctionBody) { |
| 3758 if (factoryKeyword != null && externalKeyword == null) { | 3875 if (factoryKeyword != null && externalKeyword == null) { |
| 3759 reportError9(ParserErrorCode.FACTORY_WITHOUT_BODY, factoryKeyword, [])
; | 3876 reportError10(ParserErrorCode.FACTORY_WITHOUT_BODY, factoryKeyword, []
); |
| 3760 } | 3877 } |
| 3761 } else { | 3878 } else { |
| 3762 if (constKeyword != null) { | 3879 if (constKeyword != null) { |
| 3763 reportError(ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, body, []); | 3880 reportError(ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, body, []); |
| 3764 } else if (!bodyAllowed) { | 3881 } else if (!bodyAllowed) { |
| 3765 reportError(ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY, body, []); | 3882 reportError(ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY, body, []); |
| 3766 } | 3883 } |
| 3767 } | 3884 } |
| 3768 } | 3885 } |
| 3769 return new ConstructorDeclaration.full(commentAndMetadata.comment, commentAn
dMetadata.metadata, externalKeyword, constKeyword, factoryKeyword, returnType, p
eriod, name, parameters, separator, initializers, redirectedConstructor, body); | 3886 return new ConstructorDeclaration.full(commentAndMetadata.comment, commentAn
dMetadata.metadata, externalKeyword, constKeyword, factoryKeyword, returnType, p
eriod, name, parameters, separator, initializers, redirectedConstructor, body); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3810 * <pre> | 3927 * <pre> |
| 3811 * continueStatement ::= | 3928 * continueStatement ::= |
| 3812 * 'continue' identifier? ';' | 3929 * 'continue' identifier? ';' |
| 3813 * </pre> | 3930 * </pre> |
| 3814 * | 3931 * |
| 3815 * @return the continue statement that was parsed | 3932 * @return the continue statement that was parsed |
| 3816 */ | 3933 */ |
| 3817 Statement parseContinueStatement() { | 3934 Statement parseContinueStatement() { |
| 3818 Token continueKeyword = expect(Keyword.CONTINUE); | 3935 Token continueKeyword = expect(Keyword.CONTINUE); |
| 3819 if (!_inLoop && !_inSwitch) { | 3936 if (!_inLoop && !_inSwitch) { |
| 3820 reportError9(ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, continueKeyword, []
); | 3937 reportError10(ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, continueKeyword, [
]); |
| 3821 } | 3938 } |
| 3822 SimpleIdentifier label = null; | 3939 SimpleIdentifier label = null; |
| 3823 if (matchesIdentifier()) { | 3940 if (matchesIdentifier()) { |
| 3824 label = parseSimpleIdentifier(); | 3941 label = parseSimpleIdentifier(); |
| 3825 } | 3942 } |
| 3826 if (_inSwitch && !_inLoop && label == null) { | 3943 if (_inSwitch && !_inLoop && label == null) { |
| 3827 reportError9(ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE, continueKeywo
rd, []); | 3944 reportError10(ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE, continueKeyw
ord, []); |
| 3828 } | 3945 } |
| 3829 Token semicolon = expect2(TokenType.SEMICOLON); | 3946 Token semicolon = expect2(TokenType.SEMICOLON); |
| 3830 return new ContinueStatement.full(continueKeyword, label, semicolon); | 3947 return new ContinueStatement.full(continueKeyword, label, semicolon); |
| 3831 } | 3948 } |
| 3832 | 3949 |
| 3833 /** | 3950 /** |
| 3834 * Parse a directive. | 3951 * Parse a directive. |
| 3835 * | 3952 * |
| 3836 * <pre> | 3953 * <pre> |
| 3837 * directive ::= | 3954 * directive ::= |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4024 keyword = andAdvance; | 4141 keyword = andAdvance; |
| 4025 if (isTypedIdentifier(_currentToken)) { | 4142 if (isTypedIdentifier(_currentToken)) { |
| 4026 type = parseTypeName(); | 4143 type = parseTypeName(); |
| 4027 } | 4144 } |
| 4028 } else if (matches(Keyword.VAR)) { | 4145 } else if (matches(Keyword.VAR)) { |
| 4029 keyword = andAdvance; | 4146 keyword = andAdvance; |
| 4030 } else { | 4147 } else { |
| 4031 if (isTypedIdentifier(_currentToken)) { | 4148 if (isTypedIdentifier(_currentToken)) { |
| 4032 type = parseReturnType(); | 4149 type = parseReturnType(); |
| 4033 } else if (!optional) { | 4150 } else if (!optional) { |
| 4034 reportError8(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, []); | 4151 reportError9(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, []); |
| 4035 } | 4152 } |
| 4036 } | 4153 } |
| 4037 return new FinalConstVarOrType(keyword, type); | 4154 return new FinalConstVarOrType(keyword, type); |
| 4038 } | 4155 } |
| 4039 | 4156 |
| 4040 /** | 4157 /** |
| 4041 * Parse a formal parameter. At most one of `isOptional` and `isNamed` can be | 4158 * Parse a formal parameter. At most one of `isOptional` and `isNamed` can be |
| 4042 * `true`. | 4159 * `true`. |
| 4043 * | 4160 * |
| 4044 * <pre> | 4161 * <pre> |
| 4045 * defaultFormalParameter ::= | 4162 * defaultFormalParameter ::= |
| 4046 * normalFormalParameter ('=' expression)? | 4163 * normalFormalParameter ('=' expression)? |
| 4047 * | 4164 * |
| 4048 * defaultNamedParameter ::= | 4165 * defaultNamedParameter ::= |
| 4049 * normalFormalParameter (':' expression)? | 4166 * normalFormalParameter (':' expression)? |
| 4050 * </pre> | 4167 * </pre> |
| 4051 * | 4168 * |
| 4052 * @param kind the kind of parameter being expected based on the presence or a
bsence of group | 4169 * @param kind the kind of parameter being expected based on the presence or a
bsence of group |
| 4053 * delimiters | 4170 * delimiters |
| 4054 * @return the formal parameter that was parsed | 4171 * @return the formal parameter that was parsed |
| 4055 */ | 4172 */ |
| 4056 FormalParameter parseFormalParameter(ParameterKind kind) { | 4173 FormalParameter parseFormalParameter(ParameterKind kind) { |
| 4057 NormalFormalParameter parameter = parseNormalFormalParameter(); | 4174 NormalFormalParameter parameter = parseNormalFormalParameter(); |
| 4058 if (matches5(TokenType.EQ)) { | 4175 if (matches5(TokenType.EQ)) { |
| 4059 Token seperator = andAdvance; | 4176 Token seperator = andAdvance; |
| 4060 Expression defaultValue = parseExpression2(); | 4177 Expression defaultValue = parseExpression2(); |
| 4061 if (identical(kind, ParameterKind.NAMED)) { | 4178 if (identical(kind, ParameterKind.NAMED)) { |
| 4062 reportError9(ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER, sepera
tor, []); | 4179 reportError10(ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER, seper
ator, []); |
| 4063 } else if (identical(kind, ParameterKind.REQUIRED)) { | 4180 } else if (identical(kind, ParameterKind.REQUIRED)) { |
| 4064 reportError(ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP, paramete
r, []); | 4181 reportError(ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP, paramete
r, []); |
| 4065 } | 4182 } |
| 4066 return new DefaultFormalParameter.full(parameter, kind, seperator, default
Value); | 4183 return new DefaultFormalParameter.full(parameter, kind, seperator, default
Value); |
| 4067 } else if (matches5(TokenType.COLON)) { | 4184 } else if (matches5(TokenType.COLON)) { |
| 4068 Token seperator = andAdvance; | 4185 Token seperator = andAdvance; |
| 4069 Expression defaultValue = parseExpression2(); | 4186 Expression defaultValue = parseExpression2(); |
| 4070 if (identical(kind, ParameterKind.POSITIONAL)) { | 4187 if (identical(kind, ParameterKind.POSITIONAL)) { |
| 4071 reportError9(ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER, s
eperator, []); | 4188 reportError10(ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER,
seperator, []); |
| 4072 } else if (identical(kind, ParameterKind.REQUIRED)) { | 4189 } else if (identical(kind, ParameterKind.REQUIRED)) { |
| 4073 reportError(ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, parameter, []
); | 4190 reportError(ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, parameter, []
); |
| 4074 } | 4191 } |
| 4075 return new DefaultFormalParameter.full(parameter, kind, seperator, default
Value); | 4192 return new DefaultFormalParameter.full(parameter, kind, seperator, default
Value); |
| 4076 } else if (kind != ParameterKind.REQUIRED) { | 4193 } else if (kind != ParameterKind.REQUIRED) { |
| 4077 return new DefaultFormalParameter.full(parameter, kind, null, null); | 4194 return new DefaultFormalParameter.full(parameter, kind, null, null); |
| 4078 } | 4195 } |
| 4079 return parameter; | 4196 return parameter; |
| 4080 } | 4197 } |
| 4081 | 4198 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4115 variableList = new VariableDeclarationList.full(commentAndMetadata.com
ment, commentAndMetadata.metadata, null, null, variables); | 4232 variableList = new VariableDeclarationList.full(commentAndMetadata.com
ment, commentAndMetadata.metadata, null, null, variables); |
| 4116 } else if (isInitializedVariableDeclaration()) { | 4233 } else if (isInitializedVariableDeclaration()) { |
| 4117 variableList = parseVariableDeclarationList(commentAndMetadata); | 4234 variableList = parseVariableDeclarationList(commentAndMetadata); |
| 4118 } else { | 4235 } else { |
| 4119 initialization = parseExpression2(); | 4236 initialization = parseExpression2(); |
| 4120 } | 4237 } |
| 4121 if (matches(Keyword.IN)) { | 4238 if (matches(Keyword.IN)) { |
| 4122 DeclaredIdentifier loopVariable = null; | 4239 DeclaredIdentifier loopVariable = null; |
| 4123 SimpleIdentifier identifier = null; | 4240 SimpleIdentifier identifier = null; |
| 4124 if (variableList == null) { | 4241 if (variableList == null) { |
| 4125 reportError8(ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH, []); | 4242 reportError9(ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH, []); |
| 4126 } else { | 4243 } else { |
| 4127 NodeList<VariableDeclaration> variables = variableList.variables; | 4244 NodeList<VariableDeclaration> variables = variableList.variables; |
| 4128 if (variables.length > 1) { | 4245 if (variables.length > 1) { |
| 4129 reportError8(ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH, [vari
ables.length.toString()]); | 4246 reportError9(ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH, [vari
ables.length.toString()]); |
| 4130 } | 4247 } |
| 4131 VariableDeclaration variable = variables[0]; | 4248 VariableDeclaration variable = variables[0]; |
| 4132 if (variable.initializer != null) { | 4249 if (variable.initializer != null) { |
| 4133 reportError8(ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, [])
; | 4250 reportError9(ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, [])
; |
| 4134 } | 4251 } |
| 4135 Token keyword = variableList.keyword; | 4252 Token keyword = variableList.keyword; |
| 4136 TypeName type = variableList.type; | 4253 TypeName type = variableList.type; |
| 4137 if (keyword != null || type != null) { | 4254 if (keyword != null || type != null) { |
| 4138 loopVariable = new DeclaredIdentifier.full(commentAndMetadata.comm
ent, commentAndMetadata.metadata, keyword, type, variable.name); | 4255 loopVariable = new DeclaredIdentifier.full(commentAndMetadata.comm
ent, commentAndMetadata.metadata, keyword, type, variable.name); |
| 4139 } else { | 4256 } else { |
| 4140 if (!commentAndMetadata.metadata.isEmpty) { | 4257 if (!commentAndMetadata.metadata.isEmpty) { |
| 4141 } | 4258 } |
| 4142 identifier = variable.name; | 4259 identifier = variable.name; |
| 4143 } | 4260 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4190 * @return the function body that was parsed | 4307 * @return the function body that was parsed |
| 4191 */ | 4308 */ |
| 4192 FunctionBody parseFunctionBody(bool mayBeEmpty, ParserErrorCode emptyErrorCode
, bool inExpression) { | 4309 FunctionBody parseFunctionBody(bool mayBeEmpty, ParserErrorCode emptyErrorCode
, bool inExpression) { |
| 4193 bool wasInLoop = _inLoop; | 4310 bool wasInLoop = _inLoop; |
| 4194 bool wasInSwitch = _inSwitch; | 4311 bool wasInSwitch = _inSwitch; |
| 4195 _inLoop = false; | 4312 _inLoop = false; |
| 4196 _inSwitch = false; | 4313 _inSwitch = false; |
| 4197 try { | 4314 try { |
| 4198 if (matches5(TokenType.SEMICOLON)) { | 4315 if (matches5(TokenType.SEMICOLON)) { |
| 4199 if (!mayBeEmpty) { | 4316 if (!mayBeEmpty) { |
| 4200 reportError8(emptyErrorCode, []); | 4317 reportError9(emptyErrorCode, []); |
| 4201 } | 4318 } |
| 4202 return new EmptyFunctionBody.full(andAdvance); | 4319 return new EmptyFunctionBody.full(andAdvance); |
| 4203 } else if (matches5(TokenType.FUNCTION)) { | 4320 } else if (matches5(TokenType.FUNCTION)) { |
| 4204 Token functionDefinition = andAdvance; | 4321 Token functionDefinition = andAdvance; |
| 4205 Expression expression = parseExpression2(); | 4322 Expression expression = parseExpression2(); |
| 4206 Token semicolon = null; | 4323 Token semicolon = null; |
| 4207 if (!inExpression) { | 4324 if (!inExpression) { |
| 4208 semicolon = expect2(TokenType.SEMICOLON); | 4325 semicolon = expect2(TokenType.SEMICOLON); |
| 4209 } | 4326 } |
| 4210 return new ExpressionFunctionBody.full(functionDefinition, expression, s
emicolon); | 4327 return new ExpressionFunctionBody.full(functionDefinition, expression, s
emicolon); |
| 4211 } else if (matches5(TokenType.OPEN_CURLY_BRACKET)) { | 4328 } else if (matches5(TokenType.OPEN_CURLY_BRACKET)) { |
| 4212 return new BlockFunctionBody.full(parseBlock()); | 4329 return new BlockFunctionBody.full(parseBlock()); |
| 4213 } else if (matches2(_NATIVE)) { | 4330 } else if (matches2(_NATIVE)) { |
| 4214 Token nativeToken = andAdvance; | 4331 Token nativeToken = andAdvance; |
| 4215 StringLiteral stringLiteral = null; | 4332 StringLiteral stringLiteral = null; |
| 4216 if (matches5(TokenType.STRING)) { | 4333 if (matches5(TokenType.STRING)) { |
| 4217 stringLiteral = parseStringLiteral(); | 4334 stringLiteral = parseStringLiteral(); |
| 4218 } | 4335 } |
| 4219 return new NativeFunctionBody.full(nativeToken, stringLiteral, expect2(T
okenType.SEMICOLON)); | 4336 return new NativeFunctionBody.full(nativeToken, stringLiteral, expect2(T
okenType.SEMICOLON)); |
| 4220 } else { | 4337 } else { |
| 4221 reportError8(emptyErrorCode, []); | 4338 reportError9(emptyErrorCode, []); |
| 4222 return new EmptyFunctionBody.full(createSyntheticToken2(TokenType.SEMICO
LON)); | 4339 return new EmptyFunctionBody.full(createSyntheticToken2(TokenType.SEMICO
LON)); |
| 4223 } | 4340 } |
| 4224 } finally { | 4341 } finally { |
| 4225 _inLoop = wasInLoop; | 4342 _inLoop = wasInLoop; |
| 4226 _inSwitch = wasInSwitch; | 4343 _inSwitch = wasInSwitch; |
| 4227 } | 4344 } |
| 4228 } | 4345 } |
| 4229 | 4346 |
| 4230 /** | 4347 /** |
| 4231 * Parse a function declaration. | 4348 * Parse a function declaration. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 4252 } else if (matches(Keyword.SET) && !matches4(peek(), TokenType.OPEN_PAREN))
{ | 4369 } else if (matches(Keyword.SET) && !matches4(peek(), TokenType.OPEN_PAREN))
{ |
| 4253 keyword = andAdvance; | 4370 keyword = andAdvance; |
| 4254 } | 4371 } |
| 4255 SimpleIdentifier name = parseSimpleIdentifier(); | 4372 SimpleIdentifier name = parseSimpleIdentifier(); |
| 4256 FormalParameterList parameters = null; | 4373 FormalParameterList parameters = null; |
| 4257 if (!isGetter) { | 4374 if (!isGetter) { |
| 4258 if (matches5(TokenType.OPEN_PAREN)) { | 4375 if (matches5(TokenType.OPEN_PAREN)) { |
| 4259 parameters = parseFormalParameterList(); | 4376 parameters = parseFormalParameterList(); |
| 4260 validateFormalParameterList(parameters); | 4377 validateFormalParameterList(parameters); |
| 4261 } else { | 4378 } else { |
| 4262 reportError8(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, []); | 4379 reportError9(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, []); |
| 4263 } | 4380 } |
| 4264 } else if (matches5(TokenType.OPEN_PAREN)) { | 4381 } else if (matches5(TokenType.OPEN_PAREN)) { |
| 4265 reportError8(ParserErrorCode.GETTER_WITH_PARAMETERS, []); | 4382 reportError9(ParserErrorCode.GETTER_WITH_PARAMETERS, []); |
| 4266 parseFormalParameterList(); | 4383 parseFormalParameterList(); |
| 4267 } | 4384 } |
| 4268 FunctionBody body; | 4385 FunctionBody body; |
| 4269 if (externalKeyword == null) { | 4386 if (externalKeyword == null) { |
| 4270 body = parseFunctionBody(false, ParserErrorCode.MISSING_FUNCTION_BODY, fal
se); | 4387 body = parseFunctionBody(false, ParserErrorCode.MISSING_FUNCTION_BODY, fal
se); |
| 4271 } else { | 4388 } else { |
| 4272 body = new EmptyFunctionBody.full(expect2(TokenType.SEMICOLON)); | 4389 body = new EmptyFunctionBody.full(expect2(TokenType.SEMICOLON)); |
| 4273 } | 4390 } |
| 4274 return new FunctionDeclaration.full(commentAndMetadata.comment, commentAndMe
tadata.metadata, externalKeyword, returnType, keyword, name, new FunctionExpress
ion.full(parameters, body)); | 4391 return new FunctionDeclaration.full(commentAndMetadata.comment, commentAndMe
tadata.metadata, externalKeyword, returnType, keyword, name, new FunctionExpress
ion.full(parameters, body)); |
| 4275 } | 4392 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 4300 * | 4417 * |
| 4301 * @param commentAndMetadata the documentation comment and metadata to be asso
ciated with the | 4418 * @param commentAndMetadata the documentation comment and metadata to be asso
ciated with the |
| 4302 * declaration | 4419 * declaration |
| 4303 * @param returnType the return type, or `null` if there is no return type | 4420 * @param returnType the return type, or `null` if there is no return type |
| 4304 * @return the function declaration statement that was parsed | 4421 * @return the function declaration statement that was parsed |
| 4305 */ | 4422 */ |
| 4306 Statement parseFunctionDeclarationStatement2(CommentAndMetadata commentAndMeta
data, TypeName returnType) { | 4423 Statement parseFunctionDeclarationStatement2(CommentAndMetadata commentAndMeta
data, TypeName returnType) { |
| 4307 FunctionDeclaration declaration = parseFunctionDeclaration(commentAndMetadat
a, null, returnType); | 4424 FunctionDeclaration declaration = parseFunctionDeclaration(commentAndMetadat
a, null, returnType); |
| 4308 Token propertyKeyword = declaration.propertyKeyword; | 4425 Token propertyKeyword = declaration.propertyKeyword; |
| 4309 if (propertyKeyword != null) { | 4426 if (propertyKeyword != null) { |
| 4310 if (identical(((propertyKeyword as KeywordToken)).keyword, Keyword.GET)) { | 4427 if (identical((propertyKeyword as KeywordToken).keyword, Keyword.GET)) { |
| 4311 reportError9(ParserErrorCode.GETTER_IN_FUNCTION, propertyKeyword, []); | 4428 reportError10(ParserErrorCode.GETTER_IN_FUNCTION, propertyKeyword, []); |
| 4312 } else { | 4429 } else { |
| 4313 reportError9(ParserErrorCode.SETTER_IN_FUNCTION, propertyKeyword, []); | 4430 reportError10(ParserErrorCode.SETTER_IN_FUNCTION, propertyKeyword, []); |
| 4314 } | 4431 } |
| 4315 } | 4432 } |
| 4316 return new FunctionDeclarationStatement.full(declaration); | 4433 return new FunctionDeclarationStatement.full(declaration); |
| 4317 } | 4434 } |
| 4318 | 4435 |
| 4319 /** | 4436 /** |
| 4320 * Parse a function type alias. | 4437 * Parse a function type alias. |
| 4321 * | 4438 * |
| 4322 * <pre> | 4439 * <pre> |
| 4323 * functionTypeAlias ::= | 4440 * functionTypeAlias ::= |
| (...skipping 11 matching lines...) Expand all Loading... |
| 4335 TypeName returnType = null; | 4452 TypeName returnType = null; |
| 4336 if (hasReturnTypeInTypeAlias()) { | 4453 if (hasReturnTypeInTypeAlias()) { |
| 4337 returnType = parseReturnType(); | 4454 returnType = parseReturnType(); |
| 4338 } | 4455 } |
| 4339 SimpleIdentifier name = parseSimpleIdentifier(); | 4456 SimpleIdentifier name = parseSimpleIdentifier(); |
| 4340 TypeParameterList typeParameters = null; | 4457 TypeParameterList typeParameters = null; |
| 4341 if (matches5(TokenType.LT)) { | 4458 if (matches5(TokenType.LT)) { |
| 4342 typeParameters = parseTypeParameterList(); | 4459 typeParameters = parseTypeParameterList(); |
| 4343 } | 4460 } |
| 4344 if (matches5(TokenType.SEMICOLON) || matches5(TokenType.EOF)) { | 4461 if (matches5(TokenType.SEMICOLON) || matches5(TokenType.EOF)) { |
| 4345 reportError8(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, []); | 4462 reportError9(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, []); |
| 4346 FormalParameterList parameters = new FormalParameterList.full(createSynthe
ticToken2(TokenType.OPEN_PAREN), null, null, null, createSyntheticToken2(TokenTy
pe.CLOSE_PAREN)); | 4463 FormalParameterList parameters = new FormalParameterList.full(createSynthe
ticToken2(TokenType.OPEN_PAREN), null, null, null, createSyntheticToken2(TokenTy
pe.CLOSE_PAREN)); |
| 4347 Token semicolon = expect2(TokenType.SEMICOLON); | 4464 Token semicolon = expect2(TokenType.SEMICOLON); |
| 4348 return new FunctionTypeAlias.full(commentAndMetadata.comment, commentAndMe
tadata.metadata, keyword, returnType, name, typeParameters, parameters, semicolo
n); | 4465 return new FunctionTypeAlias.full(commentAndMetadata.comment, commentAndMe
tadata.metadata, keyword, returnType, name, typeParameters, parameters, semicolo
n); |
| 4349 } else if (!matches5(TokenType.OPEN_PAREN)) { | 4466 } else if (!matches5(TokenType.OPEN_PAREN)) { |
| 4350 reportError8(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, []); | 4467 reportError9(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, []); |
| 4351 return new FunctionTypeAlias.full(commentAndMetadata.comment, commentAndMe
tadata.metadata, keyword, returnType, name, typeParameters, new FormalParameterL
ist.full(createSyntheticToken2(TokenType.OPEN_PAREN), null, null, null, createSy
ntheticToken2(TokenType.CLOSE_PAREN)), createSyntheticToken2(TokenType.SEMICOLON
)); | 4468 return new FunctionTypeAlias.full(commentAndMetadata.comment, commentAndMe
tadata.metadata, keyword, returnType, name, typeParameters, new FormalParameterL
ist.full(createSyntheticToken2(TokenType.OPEN_PAREN), null, null, null, createSy
ntheticToken2(TokenType.CLOSE_PAREN)), createSyntheticToken2(TokenType.SEMICOLON
)); |
| 4352 } | 4469 } |
| 4353 FormalParameterList parameters = parseFormalParameterList(); | 4470 FormalParameterList parameters = parseFormalParameterList(); |
| 4354 validateFormalParameterList(parameters); | 4471 validateFormalParameterList(parameters); |
| 4355 Token semicolon = expect2(TokenType.SEMICOLON); | 4472 Token semicolon = expect2(TokenType.SEMICOLON); |
| 4356 return new FunctionTypeAlias.full(commentAndMetadata.comment, commentAndMeta
data.metadata, keyword, returnType, name, typeParameters, parameters, semicolon)
; | 4473 return new FunctionTypeAlias.full(commentAndMetadata.comment, commentAndMeta
data.metadata, keyword, returnType, name, typeParameters, parameters, semicolon)
; |
| 4357 } | 4474 } |
| 4358 | 4475 |
| 4359 /** | 4476 /** |
| 4360 * Parse a getter. | 4477 * Parse a getter. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 4372 * @param externalKeyword the 'external' token | 4489 * @param externalKeyword the 'external' token |
| 4373 * @param staticKeyword the static keyword, or `null` if the getter is not sta
tic | 4490 * @param staticKeyword the static keyword, or `null` if the getter is not sta
tic |
| 4374 * @param the return type that has already been parsed, or `null` if there was
no return | 4491 * @param the return type that has already been parsed, or `null` if there was
no return |
| 4375 * type | 4492 * type |
| 4376 * @return the getter that was parsed | 4493 * @return the getter that was parsed |
| 4377 */ | 4494 */ |
| 4378 MethodDeclaration parseGetter(CommentAndMetadata commentAndMetadata, Token ext
ernalKeyword, Token staticKeyword, TypeName returnType) { | 4495 MethodDeclaration parseGetter(CommentAndMetadata commentAndMetadata, Token ext
ernalKeyword, Token staticKeyword, TypeName returnType) { |
| 4379 Token propertyKeyword = expect(Keyword.GET); | 4496 Token propertyKeyword = expect(Keyword.GET); |
| 4380 SimpleIdentifier name = parseSimpleIdentifier(); | 4497 SimpleIdentifier name = parseSimpleIdentifier(); |
| 4381 if (matches5(TokenType.OPEN_PAREN) && matches4(peek(), TokenType.CLOSE_PAREN
)) { | 4498 if (matches5(TokenType.OPEN_PAREN) && matches4(peek(), TokenType.CLOSE_PAREN
)) { |
| 4382 reportError8(ParserErrorCode.GETTER_WITH_PARAMETERS, []); | 4499 reportError9(ParserErrorCode.GETTER_WITH_PARAMETERS, []); |
| 4383 advance(); | 4500 advance(); |
| 4384 advance(); | 4501 advance(); |
| 4385 } | 4502 } |
| 4386 FunctionBody body = parseFunctionBody(externalKeyword != null || staticKeywo
rd == null, ParserErrorCode.STATIC_GETTER_WITHOUT_BODY, false); | 4503 FunctionBody body = parseFunctionBody(externalKeyword != null || staticKeywo
rd == null, ParserErrorCode.STATIC_GETTER_WITHOUT_BODY, false); |
| 4387 if (externalKeyword != null && body is! EmptyFunctionBody) { | 4504 if (externalKeyword != null && body is! EmptyFunctionBody) { |
| 4388 reportError8(ParserErrorCode.EXTERNAL_GETTER_WITH_BODY, []); | 4505 reportError9(ParserErrorCode.EXTERNAL_GETTER_WITH_BODY, []); |
| 4389 } | 4506 } |
| 4390 return new MethodDeclaration.full(commentAndMetadata.comment, commentAndMeta
data.metadata, externalKeyword, staticKeyword, returnType, propertyKeyword, null
, name, null, body); | 4507 return new MethodDeclaration.full(commentAndMetadata.comment, commentAndMeta
data.metadata, externalKeyword, staticKeyword, returnType, propertyKeyword, null
, name, null, body); |
| 4391 } | 4508 } |
| 4392 | 4509 |
| 4393 /** | 4510 /** |
| 4394 * Parse a list of identifiers. | 4511 * Parse a list of identifiers. |
| 4395 * | 4512 * |
| 4396 * <pre> | 4513 * <pre> |
| 4397 * identifierList ::= | 4514 * identifierList ::= |
| 4398 * identifier (',' identifier)* | 4515 * identifier (',' identifier)* |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4536 * missing | 4653 * missing |
| 4537 * @return the library name that was parsed | 4654 * @return the library name that was parsed |
| 4538 */ | 4655 */ |
| 4539 LibraryIdentifier parseLibraryName(ParserErrorCode missingNameError, Token mis
singNameToken) { | 4656 LibraryIdentifier parseLibraryName(ParserErrorCode missingNameError, Token mis
singNameToken) { |
| 4540 if (matchesIdentifier()) { | 4657 if (matchesIdentifier()) { |
| 4541 return parseLibraryIdentifier(); | 4658 return parseLibraryIdentifier(); |
| 4542 } else if (matches5(TokenType.STRING)) { | 4659 } else if (matches5(TokenType.STRING)) { |
| 4543 StringLiteral string = parseStringLiteral(); | 4660 StringLiteral string = parseStringLiteral(); |
| 4544 reportError(ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME, string, []); | 4661 reportError(ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME, string, []); |
| 4545 } else { | 4662 } else { |
| 4546 reportError9(missingNameError, missingNameToken, []); | 4663 reportError10(missingNameError, missingNameToken, []); |
| 4547 } | 4664 } |
| 4548 List<SimpleIdentifier> components = new List<SimpleIdentifier>(); | 4665 List<SimpleIdentifier> components = new List<SimpleIdentifier>(); |
| 4549 components.add(createSyntheticIdentifier()); | 4666 components.add(createSyntheticIdentifier()); |
| 4550 return new LibraryIdentifier.full(components); | 4667 return new LibraryIdentifier.full(components); |
| 4551 } | 4668 } |
| 4552 | 4669 |
| 4553 /** | 4670 /** |
| 4554 * Parse a list literal. | 4671 * Parse a list literal. |
| 4555 * | 4672 * |
| 4556 * <pre> | 4673 * <pre> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4607 TypedLiteral parseListOrMapLiteral(Token modifier) { | 4724 TypedLiteral parseListOrMapLiteral(Token modifier) { |
| 4608 TypeArgumentList typeArguments = null; | 4725 TypeArgumentList typeArguments = null; |
| 4609 if (matches5(TokenType.LT)) { | 4726 if (matches5(TokenType.LT)) { |
| 4610 typeArguments = parseTypeArgumentList(); | 4727 typeArguments = parseTypeArgumentList(); |
| 4611 } | 4728 } |
| 4612 if (matches5(TokenType.OPEN_CURLY_BRACKET)) { | 4729 if (matches5(TokenType.OPEN_CURLY_BRACKET)) { |
| 4613 return parseMapLiteral(modifier, typeArguments); | 4730 return parseMapLiteral(modifier, typeArguments); |
| 4614 } else if (matches5(TokenType.OPEN_SQUARE_BRACKET) || matches5(TokenType.IND
EX)) { | 4731 } else if (matches5(TokenType.OPEN_SQUARE_BRACKET) || matches5(TokenType.IND
EX)) { |
| 4615 return parseListLiteral(modifier, typeArguments); | 4732 return parseListLiteral(modifier, typeArguments); |
| 4616 } | 4733 } |
| 4617 reportError8(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL, []); | 4734 reportError9(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL, []); |
| 4618 return new ListLiteral.full(modifier, typeArguments, createSyntheticToken2(T
okenType.OPEN_SQUARE_BRACKET), null, createSyntheticToken2(TokenType.CLOSE_SQUAR
E_BRACKET)); | 4735 return new ListLiteral.full(modifier, typeArguments, createSyntheticToken2(T
okenType.OPEN_SQUARE_BRACKET), null, createSyntheticToken2(TokenType.CLOSE_SQUAR
E_BRACKET)); |
| 4619 } | 4736 } |
| 4620 | 4737 |
| 4621 /** | 4738 /** |
| 4622 * Parse a logical and expression. | 4739 * Parse a logical and expression. |
| 4623 * | 4740 * |
| 4624 * <pre> | 4741 * <pre> |
| 4625 * logicalAndExpression ::= | 4742 * logicalAndExpression ::= |
| 4626 * equalityExpression ('&&' equalityExpression)* | 4743 * equalityExpression ('&&' equalityExpression)* |
| 4627 * </pre> | 4744 * </pre> |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4733 * modifiers ::= | 4850 * modifiers ::= |
| 4734 * ('abstract' | 'const' | 'external' | 'factory' | 'final' | 'static' | '
var')* | 4851 * ('abstract' | 'const' | 'external' | 'factory' | 'final' | 'static' | '
var')* |
| 4735 * </pre> | 4852 * </pre> |
| 4736 * | 4853 * |
| 4737 * @return the modifiers that were parsed | 4854 * @return the modifiers that were parsed |
| 4738 */ | 4855 */ |
| 4739 Modifiers parseModifiers() { | 4856 Modifiers parseModifiers() { |
| 4740 Modifiers modifiers = new Modifiers(); | 4857 Modifiers modifiers = new Modifiers(); |
| 4741 bool progress = true; | 4858 bool progress = true; |
| 4742 while (progress) { | 4859 while (progress) { |
| 4743 if (matches(Keyword.ABSTRACT) && !matches4(peek(), TokenType.PERIOD) && !m
atches4(peek(), TokenType.LT)) { | 4860 if (matches4(peek(), TokenType.PERIOD) || matches4(peek(), TokenType.LT) |
| matches4(peek(), TokenType.OPEN_PAREN)) { |
| 4861 return modifiers; |
| 4862 } |
| 4863 if (matches(Keyword.ABSTRACT)) { |
| 4744 if (modifiers.abstractKeyword != null) { | 4864 if (modifiers.abstractKeyword != null) { |
| 4745 reportError8(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); | 4865 reportError9(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); |
| 4746 advance(); | 4866 advance(); |
| 4747 } else { | 4867 } else { |
| 4748 modifiers.abstractKeyword = andAdvance; | 4868 modifiers.abstractKeyword = andAdvance; |
| 4749 } | 4869 } |
| 4750 } else if (matches(Keyword.CONST)) { | 4870 } else if (matches(Keyword.CONST)) { |
| 4751 if (modifiers.constKeyword != null) { | 4871 if (modifiers.constKeyword != null) { |
| 4752 reportError8(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); | 4872 reportError9(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); |
| 4753 advance(); | 4873 advance(); |
| 4754 } else { | 4874 } else { |
| 4755 modifiers.constKeyword = andAdvance; | 4875 modifiers.constKeyword = andAdvance; |
| 4756 } | 4876 } |
| 4757 } else if (matches(Keyword.EXTERNAL) && !matches4(peek(), TokenType.PERIOD
) && !matches4(peek(), TokenType.LT)) { | 4877 } else if (matches(Keyword.EXTERNAL) && !matches4(peek(), TokenType.PERIOD
) && !matches4(peek(), TokenType.LT)) { |
| 4758 if (modifiers.externalKeyword != null) { | 4878 if (modifiers.externalKeyword != null) { |
| 4759 reportError8(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); | 4879 reportError9(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); |
| 4760 advance(); | 4880 advance(); |
| 4761 } else { | 4881 } else { |
| 4762 modifiers.externalKeyword = andAdvance; | 4882 modifiers.externalKeyword = andAdvance; |
| 4763 } | 4883 } |
| 4764 } else if (matches(Keyword.FACTORY) && !matches4(peek(), TokenType.PERIOD)
&& !matches4(peek(), TokenType.LT)) { | 4884 } else if (matches(Keyword.FACTORY) && !matches4(peek(), TokenType.PERIOD)
&& !matches4(peek(), TokenType.LT)) { |
| 4765 if (modifiers.factoryKeyword != null) { | 4885 if (modifiers.factoryKeyword != null) { |
| 4766 reportError8(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); | 4886 reportError9(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); |
| 4767 advance(); | 4887 advance(); |
| 4768 } else { | 4888 } else { |
| 4769 modifiers.factoryKeyword = andAdvance; | 4889 modifiers.factoryKeyword = andAdvance; |
| 4770 } | 4890 } |
| 4771 } else if (matches(Keyword.FINAL)) { | 4891 } else if (matches(Keyword.FINAL)) { |
| 4772 if (modifiers.finalKeyword != null) { | 4892 if (modifiers.finalKeyword != null) { |
| 4773 reportError8(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); | 4893 reportError9(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); |
| 4774 advance(); | 4894 advance(); |
| 4775 } else { | 4895 } else { |
| 4776 modifiers.finalKeyword = andAdvance; | 4896 modifiers.finalKeyword = andAdvance; |
| 4777 } | 4897 } |
| 4778 } else if (matches(Keyword.STATIC) && !matches4(peek(), TokenType.PERIOD)
&& !matches4(peek(), TokenType.LT)) { | 4898 } else if (matches(Keyword.STATIC) && !matches4(peek(), TokenType.PERIOD)
&& !matches4(peek(), TokenType.LT)) { |
| 4779 if (modifiers.staticKeyword != null) { | 4899 if (modifiers.staticKeyword != null) { |
| 4780 reportError8(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); | 4900 reportError9(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); |
| 4781 advance(); | 4901 advance(); |
| 4782 } else { | 4902 } else { |
| 4783 modifiers.staticKeyword = andAdvance; | 4903 modifiers.staticKeyword = andAdvance; |
| 4784 } | 4904 } |
| 4785 } else if (matches(Keyword.VAR)) { | 4905 } else if (matches(Keyword.VAR)) { |
| 4786 if (modifiers.varKeyword != null) { | 4906 if (modifiers.varKeyword != null) { |
| 4787 reportError8(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); | 4907 reportError9(ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexem
e]); |
| 4788 advance(); | 4908 advance(); |
| 4789 } else { | 4909 } else { |
| 4790 modifiers.varKeyword = andAdvance; | 4910 modifiers.varKeyword = andAdvance; |
| 4791 } | 4911 } |
| 4792 } else { | 4912 } else { |
| 4793 progress = false; | 4913 progress = false; |
| 4794 } | 4914 } |
| 4795 } | 4915 } |
| 4796 return modifiers; | 4916 return modifiers; |
| 4797 } | 4917 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4875 Statement parseNonLabeledStatement() { | 4995 Statement parseNonLabeledStatement() { |
| 4876 CommentAndMetadata commentAndMetadata = parseCommentAndMetadata(); | 4996 CommentAndMetadata commentAndMetadata = parseCommentAndMetadata(); |
| 4877 if (matches5(TokenType.OPEN_CURLY_BRACKET)) { | 4997 if (matches5(TokenType.OPEN_CURLY_BRACKET)) { |
| 4878 if (matches4(peek(), TokenType.STRING)) { | 4998 if (matches4(peek(), TokenType.STRING)) { |
| 4879 Token afterString = skipStringLiteral(_currentToken.next); | 4999 Token afterString = skipStringLiteral(_currentToken.next); |
| 4880 if (afterString != null && identical(afterString.type, TokenType.COLON))
{ | 5000 if (afterString != null && identical(afterString.type, TokenType.COLON))
{ |
| 4881 return new ExpressionStatement.full(parseExpression2(), expect2(TokenT
ype.SEMICOLON)); | 5001 return new ExpressionStatement.full(parseExpression2(), expect2(TokenT
ype.SEMICOLON)); |
| 4882 } | 5002 } |
| 4883 } | 5003 } |
| 4884 return parseBlock(); | 5004 return parseBlock(); |
| 4885 } else if (matches5(TokenType.KEYWORD) && !((_currentToken as KeywordToken))
.keyword.isPseudoKeyword) { | 5005 } else if (matches5(TokenType.KEYWORD) && !(_currentToken as KeywordToken).k
eyword.isPseudoKeyword) { |
| 4886 Keyword keyword = ((_currentToken as KeywordToken)).keyword; | 5006 Keyword keyword = (_currentToken as KeywordToken).keyword; |
| 4887 if (identical(keyword, Keyword.ASSERT)) { | 5007 if (identical(keyword, Keyword.ASSERT)) { |
| 4888 return parseAssertStatement(); | 5008 return parseAssertStatement(); |
| 4889 } else if (identical(keyword, Keyword.BREAK)) { | 5009 } else if (identical(keyword, Keyword.BREAK)) { |
| 4890 return parseBreakStatement(); | 5010 return parseBreakStatement(); |
| 4891 } else if (identical(keyword, Keyword.CONTINUE)) { | 5011 } else if (identical(keyword, Keyword.CONTINUE)) { |
| 4892 return parseContinueStatement(); | 5012 return parseContinueStatement(); |
| 4893 } else if (identical(keyword, Keyword.DO)) { | 5013 } else if (identical(keyword, Keyword.DO)) { |
| 4894 return parseDoStatement(); | 5014 return parseDoStatement(); |
| 4895 } else if (identical(keyword, Keyword.FOR)) { | 5015 } else if (identical(keyword, Keyword.FOR)) { |
| 4896 return parseForStatement(); | 5016 return parseForStatement(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 4919 return parseFunctionDeclarationStatement2(commentAndMetadata, returnTy
pe); | 5039 return parseFunctionDeclarationStatement2(commentAndMetadata, returnTy
pe); |
| 4920 } else { | 5040 } else { |
| 4921 if (matchesIdentifier()) { | 5041 if (matchesIdentifier()) { |
| 4922 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEM
ICOLON])) { | 5042 if (matchesAny(peek(), [TokenType.EQ, TokenType.COMMA, TokenType.SEM
ICOLON])) { |
| 4923 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []); | 5043 reportError(ParserErrorCode.VOID_VARIABLE, returnType, []); |
| 4924 return parseVariableDeclarationStatement(commentAndMetadata); | 5044 return parseVariableDeclarationStatement(commentAndMetadata); |
| 4925 } | 5045 } |
| 4926 } else if (matches5(TokenType.CLOSE_CURLY_BRACKET)) { | 5046 } else if (matches5(TokenType.CLOSE_CURLY_BRACKET)) { |
| 4927 return parseVariableDeclarationStatement2(commentAndMetadata, null,
returnType); | 5047 return parseVariableDeclarationStatement2(commentAndMetadata, null,
returnType); |
| 4928 } | 5048 } |
| 4929 reportError8(ParserErrorCode.MISSING_STATEMENT, []); | 5049 reportError9(ParserErrorCode.MISSING_STATEMENT, []); |
| 4930 return new EmptyStatement.full(createSyntheticToken2(TokenType.SEMICOL
ON)); | 5050 return new EmptyStatement.full(createSyntheticToken2(TokenType.SEMICOL
ON)); |
| 4931 } | 5051 } |
| 4932 } else if (identical(keyword, Keyword.CONST)) { | 5052 } else if (identical(keyword, Keyword.CONST)) { |
| 4933 if (matchesAny(peek(), [ | 5053 if (matchesAny(peek(), [ |
| 4934 TokenType.LT, | 5054 TokenType.LT, |
| 4935 TokenType.OPEN_CURLY_BRACKET, | 5055 TokenType.OPEN_CURLY_BRACKET, |
| 4936 TokenType.OPEN_SQUARE_BRACKET, | 5056 TokenType.OPEN_SQUARE_BRACKET, |
| 4937 TokenType.INDEX])) { | 5057 TokenType.INDEX])) { |
| 4938 return new ExpressionStatement.full(parseExpression2(), expect2(TokenT
ype.SEMICOLON)); | 5058 return new ExpressionStatement.full(parseExpression2(), expect2(TokenT
ype.SEMICOLON)); |
| 4939 } else if (matches4(peek(), TokenType.IDENTIFIER)) { | 5059 } else if (matches4(peek(), TokenType.IDENTIFIER)) { |
| 4940 Token afterType = skipTypeName(peek()); | 5060 Token afterType = skipTypeName(peek()); |
| 4941 if (afterType != null) { | 5061 if (afterType != null) { |
| 4942 if (matches4(afterType, TokenType.OPEN_PAREN) || (matches4(afterType
, TokenType.PERIOD) && matches4(afterType.next, TokenType.IDENTIFIER) && matches
4(afterType.next.next, TokenType.OPEN_PAREN))) { | 5062 if (matches4(afterType, TokenType.OPEN_PAREN) || (matches4(afterType
, TokenType.PERIOD) && matches4(afterType.next, TokenType.IDENTIFIER) && matches
4(afterType.next.next, TokenType.OPEN_PAREN))) { |
| 4943 return new ExpressionStatement.full(parseExpression2(), expect2(To
kenType.SEMICOLON)); | 5063 return new ExpressionStatement.full(parseExpression2(), expect2(To
kenType.SEMICOLON)); |
| 4944 } | 5064 } |
| 4945 } | 5065 } |
| 4946 } | 5066 } |
| 4947 return parseVariableDeclarationStatement(commentAndMetadata); | 5067 return parseVariableDeclarationStatement(commentAndMetadata); |
| 4948 } else if (identical(keyword, Keyword.NEW) || identical(keyword, Keyword.T
RUE) || identical(keyword, Keyword.FALSE) || identical(keyword, Keyword.NULL) ||
identical(keyword, Keyword.SUPER) || identical(keyword, Keyword.THIS)) { | 5068 } else if (identical(keyword, Keyword.NEW) || identical(keyword, Keyword.T
RUE) || identical(keyword, Keyword.FALSE) || identical(keyword, Keyword.NULL) ||
identical(keyword, Keyword.SUPER) || identical(keyword, Keyword.THIS)) { |
| 4949 return new ExpressionStatement.full(parseExpression2(), expect2(TokenTyp
e.SEMICOLON)); | 5069 return new ExpressionStatement.full(parseExpression2(), expect2(TokenTyp
e.SEMICOLON)); |
| 4950 } else { | 5070 } else { |
| 4951 reportError8(ParserErrorCode.MISSING_STATEMENT, []); | 5071 reportError9(ParserErrorCode.MISSING_STATEMENT, []); |
| 4952 return new EmptyStatement.full(createSyntheticToken2(TokenType.SEMICOLON
)); | 5072 return new EmptyStatement.full(createSyntheticToken2(TokenType.SEMICOLON
)); |
| 4953 } | 5073 } |
| 4954 } else if (matches5(TokenType.SEMICOLON)) { | 5074 } else if (matches5(TokenType.SEMICOLON)) { |
| 4955 return parseEmptyStatement(); | 5075 return parseEmptyStatement(); |
| 4956 } else if (isInitializedVariableDeclaration()) { | 5076 } else if (isInitializedVariableDeclaration()) { |
| 4957 return parseVariableDeclarationStatement(commentAndMetadata); | 5077 return parseVariableDeclarationStatement(commentAndMetadata); |
| 4958 } else if (isFunctionDeclaration()) { | 5078 } else if (isFunctionDeclaration()) { |
| 4959 return parseFunctionDeclarationStatement(); | 5079 return parseFunctionDeclarationStatement(); |
| 4960 } else if (matches5(TokenType.CLOSE_CURLY_BRACKET)) { | 5080 } else if (matches5(TokenType.CLOSE_CURLY_BRACKET)) { |
| 4961 reportError8(ParserErrorCode.MISSING_STATEMENT, []); | 5081 reportError9(ParserErrorCode.MISSING_STATEMENT, []); |
| 4962 return new EmptyStatement.full(createSyntheticToken2(TokenType.SEMICOLON))
; | 5082 return new EmptyStatement.full(createSyntheticToken2(TokenType.SEMICOLON))
; |
| 4963 } else { | 5083 } else { |
| 4964 return new ExpressionStatement.full(parseExpression2(), expect2(TokenType.
SEMICOLON)); | 5084 return new ExpressionStatement.full(parseExpression2(), expect2(TokenType.
SEMICOLON)); |
| 4965 } | 5085 } |
| 4966 } | 5086 } |
| 4967 | 5087 |
| 4968 /** | 5088 /** |
| 4969 * Parse an operator declaration. | 5089 * Parse an operator declaration. |
| 4970 * | 5090 * |
| 4971 * <pre> | 5091 * <pre> |
| 4972 * operatorDeclaration ::= | 5092 * operatorDeclaration ::= |
| 4973 * operatorSignature (';' | functionBody) | 5093 * operatorSignature (';' | functionBody) |
| 4974 * | 5094 * |
| 4975 * operatorSignature ::= | 5095 * operatorSignature ::= |
| 4976 * 'external'? returnType? 'operator' operator formalParameterList | 5096 * 'external'? returnType? 'operator' operator formalParameterList |
| 4977 * </pre> | 5097 * </pre> |
| 4978 * | 5098 * |
| 4979 * @param commentAndMetadata the documentation comment and metadata to be asso
ciated with the | 5099 * @param commentAndMetadata the documentation comment and metadata to be asso
ciated with the |
| 4980 * declaration | 5100 * declaration |
| 4981 * @param externalKeyword the 'external' token | 5101 * @param externalKeyword the 'external' token |
| 4982 * @param the return type that has already been parsed, or `null` if there was
no return | 5102 * @param the return type that has already been parsed, or `null` if there was
no return |
| 4983 * type | 5103 * type |
| 4984 * @return the operator declaration that was parsed | 5104 * @return the operator declaration that was parsed |
| 4985 */ | 5105 */ |
| 4986 MethodDeclaration parseOperator(CommentAndMetadata commentAndMetadata, Token e
xternalKeyword, TypeName returnType) { | 5106 MethodDeclaration parseOperator(CommentAndMetadata commentAndMetadata, Token e
xternalKeyword, TypeName returnType) { |
| 4987 Token operatorKeyword; | 5107 Token operatorKeyword; |
| 4988 if (matches(Keyword.OPERATOR)) { | 5108 if (matches(Keyword.OPERATOR)) { |
| 4989 operatorKeyword = andAdvance; | 5109 operatorKeyword = andAdvance; |
| 4990 } else { | 5110 } else { |
| 4991 reportError9(ParserErrorCode.MISSING_KEYWORD_OPERATOR, _currentToken, []); | 5111 reportError10(ParserErrorCode.MISSING_KEYWORD_OPERATOR, _currentToken, [])
; |
| 4992 operatorKeyword = createSyntheticToken(Keyword.OPERATOR); | 5112 operatorKeyword = createSyntheticToken(Keyword.OPERATOR); |
| 4993 } | 5113 } |
| 4994 if (!_currentToken.isUserDefinableOperator) { | 5114 if (!_currentToken.isUserDefinableOperator) { |
| 4995 reportError8(ParserErrorCode.NON_USER_DEFINABLE_OPERATOR, [_currentToken.l
exeme]); | 5115 reportError9(ParserErrorCode.NON_USER_DEFINABLE_OPERATOR, [_currentToken.l
exeme]); |
| 4996 } | 5116 } |
| 4997 SimpleIdentifier name = new SimpleIdentifier.full(andAdvance); | 5117 SimpleIdentifier name = new SimpleIdentifier.full(andAdvance); |
| 4998 if (matches5(TokenType.EQ)) { | 5118 if (matches5(TokenType.EQ)) { |
| 4999 Token previous = _currentToken.previous; | 5119 Token previous = _currentToken.previous; |
| 5000 if ((matches4(previous, TokenType.EQ_EQ) || matches4(previous, TokenType.B
ANG_EQ)) && _currentToken.offset == previous.offset + 2) { | 5120 if ((matches4(previous, TokenType.EQ_EQ) || matches4(previous, TokenType.B
ANG_EQ)) && _currentToken.offset == previous.offset + 2) { |
| 5001 reportError8(ParserErrorCode.INVALID_OPERATOR, ["${previous.lexeme}${_cu
rrentToken.lexeme}"]); | 5121 reportError9(ParserErrorCode.INVALID_OPERATOR, ["${previous.lexeme}${_cu
rrentToken.lexeme}"]); |
| 5002 advance(); | 5122 advance(); |
| 5003 } | 5123 } |
| 5004 } | 5124 } |
| 5005 FormalParameterList parameters = parseFormalParameterList(); | 5125 FormalParameterList parameters = parseFormalParameterList(); |
| 5006 validateFormalParameterList(parameters); | 5126 validateFormalParameterList(parameters); |
| 5007 FunctionBody body = parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION
_BODY, false); | 5127 FunctionBody body = parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION
_BODY, false); |
| 5008 if (externalKeyword != null && body is! EmptyFunctionBody) { | 5128 if (externalKeyword != null && body is! EmptyFunctionBody) { |
| 5009 reportError8(ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY, []); | 5129 reportError9(ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY, []); |
| 5010 } | 5130 } |
| 5011 return new MethodDeclaration.full(commentAndMetadata.comment, commentAndMeta
data.metadata, externalKeyword, null, returnType, null, operatorKeyword, name, p
arameters, body); | 5131 return new MethodDeclaration.full(commentAndMetadata.comment, commentAndMeta
data.metadata, externalKeyword, null, returnType, null, operatorKeyword, name, p
arameters, body); |
| 5012 } | 5132 } |
| 5013 | 5133 |
| 5014 /** | 5134 /** |
| 5015 * Parse a return type if one is given, otherwise return `null` without advanc
ing. | 5135 * Parse a return type if one is given, otherwise return `null` without advanc
ing. |
| 5016 * | 5136 * |
| 5017 * @return the return type that was parsed | 5137 * @return the return type that was parsed |
| 5018 */ | 5138 */ |
| 5019 TypeName parseOptionalReturnType() { | 5139 TypeName parseOptionalReturnType() { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5084 } else { | 5204 } else { |
| 5085 operand = parseAssignableSelector(operand, true); | 5205 operand = parseAssignableSelector(operand, true); |
| 5086 } | 5206 } |
| 5087 } while (matches5(TokenType.OPEN_SQUARE_BRACKET) || matches5(TokenType.PER
IOD) || matches5(TokenType.OPEN_PAREN)); | 5207 } while (matches5(TokenType.OPEN_SQUARE_BRACKET) || matches5(TokenType.PER
IOD) || matches5(TokenType.OPEN_PAREN)); |
| 5088 return operand; | 5208 return operand; |
| 5089 } | 5209 } |
| 5090 if (!_currentToken.type.isIncrementOperator) { | 5210 if (!_currentToken.type.isIncrementOperator) { |
| 5091 return operand; | 5211 return operand; |
| 5092 } | 5212 } |
| 5093 if (operand is Literal || operand is FunctionExpressionInvocation) { | 5213 if (operand is Literal || operand is FunctionExpressionInvocation) { |
| 5094 reportError8(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, []); | 5214 reportError9(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, []); |
| 5095 } | 5215 } |
| 5096 Token operator = andAdvance; | 5216 Token operator = andAdvance; |
| 5097 return new PostfixExpression.full(operand, operator); | 5217 return new PostfixExpression.full(operand, operator); |
| 5098 } | 5218 } |
| 5099 | 5219 |
| 5100 /** | 5220 /** |
| 5101 * Parse a primary expression. | 5221 * Parse a primary expression. |
| 5102 * | 5222 * |
| 5103 * <pre> | 5223 * <pre> |
| 5104 * primary ::= | 5224 * primary ::= |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5177 } | 5297 } |
| 5178 Token leftParenthesis = andAdvance; | 5298 Token leftParenthesis = andAdvance; |
| 5179 Expression expression = parseExpression2(); | 5299 Expression expression = parseExpression2(); |
| 5180 Token rightParenthesis = expect2(TokenType.CLOSE_PAREN); | 5300 Token rightParenthesis = expect2(TokenType.CLOSE_PAREN); |
| 5181 return new ParenthesizedExpression.full(leftParenthesis, expression, right
Parenthesis); | 5301 return new ParenthesizedExpression.full(leftParenthesis, expression, right
Parenthesis); |
| 5182 } else if (matches5(TokenType.LT)) { | 5302 } else if (matches5(TokenType.LT)) { |
| 5183 return parseListOrMapLiteral(null); | 5303 return parseListOrMapLiteral(null); |
| 5184 } else if (matches5(TokenType.QUESTION)) { | 5304 } else if (matches5(TokenType.QUESTION)) { |
| 5185 return parseArgumentDefinitionTest(); | 5305 return parseArgumentDefinitionTest(); |
| 5186 } else if (matches(Keyword.VOID)) { | 5306 } else if (matches(Keyword.VOID)) { |
| 5187 reportError8(ParserErrorCode.UNEXPECTED_TOKEN, [_currentToken.lexeme]); | 5307 reportError9(ParserErrorCode.UNEXPECTED_TOKEN, [_currentToken.lexeme]); |
| 5188 advance(); | 5308 advance(); |
| 5189 return parsePrimaryExpression(); | 5309 return parsePrimaryExpression(); |
| 5190 } else if (matches5(TokenType.HASH)) { | 5310 } else if (matches5(TokenType.HASH)) { |
| 5191 return parseSymbolLiteral(); | 5311 return parseSymbolLiteral(); |
| 5192 } else { | 5312 } else { |
| 5193 reportError8(ParserErrorCode.MISSING_IDENTIFIER, []); | 5313 reportError9(ParserErrorCode.MISSING_IDENTIFIER, []); |
| 5194 return createSyntheticIdentifier(); | 5314 return createSyntheticIdentifier(); |
| 5195 } | 5315 } |
| 5196 } | 5316 } |
| 5197 | 5317 |
| 5198 /** | 5318 /** |
| 5199 * Parse a redirecting constructor invocation. | 5319 * Parse a redirecting constructor invocation. |
| 5200 * | 5320 * |
| 5201 * <pre> | 5321 * <pre> |
| 5202 * redirectingConstructorInvocation ::= | 5322 * redirectingConstructorInvocation ::= |
| 5203 * 'this' ('.' identifier)? arguments | 5323 * 'this' ('.' identifier)? arguments |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5304 * type | 5424 * type |
| 5305 * @return the setter that was parsed | 5425 * @return the setter that was parsed |
| 5306 */ | 5426 */ |
| 5307 MethodDeclaration parseSetter(CommentAndMetadata commentAndMetadata, Token ext
ernalKeyword, Token staticKeyword, TypeName returnType) { | 5427 MethodDeclaration parseSetter(CommentAndMetadata commentAndMetadata, Token ext
ernalKeyword, Token staticKeyword, TypeName returnType) { |
| 5308 Token propertyKeyword = expect(Keyword.SET); | 5428 Token propertyKeyword = expect(Keyword.SET); |
| 5309 SimpleIdentifier name = parseSimpleIdentifier(); | 5429 SimpleIdentifier name = parseSimpleIdentifier(); |
| 5310 FormalParameterList parameters = parseFormalParameterList(); | 5430 FormalParameterList parameters = parseFormalParameterList(); |
| 5311 validateFormalParameterList(parameters); | 5431 validateFormalParameterList(parameters); |
| 5312 FunctionBody body = parseFunctionBody(externalKeyword != null || staticKeywo
rd == null, ParserErrorCode.STATIC_SETTER_WITHOUT_BODY, false); | 5432 FunctionBody body = parseFunctionBody(externalKeyword != null || staticKeywo
rd == null, ParserErrorCode.STATIC_SETTER_WITHOUT_BODY, false); |
| 5313 if (externalKeyword != null && body is! EmptyFunctionBody) { | 5433 if (externalKeyword != null && body is! EmptyFunctionBody) { |
| 5314 reportError8(ParserErrorCode.EXTERNAL_SETTER_WITH_BODY, []); | 5434 reportError9(ParserErrorCode.EXTERNAL_SETTER_WITH_BODY, []); |
| 5315 } | 5435 } |
| 5316 return new MethodDeclaration.full(commentAndMetadata.comment, commentAndMeta
data.metadata, externalKeyword, staticKeyword, returnType, propertyKeyword, null
, name, parameters, body); | 5436 return new MethodDeclaration.full(commentAndMetadata.comment, commentAndMeta
data.metadata, externalKeyword, staticKeyword, returnType, propertyKeyword, null
, name, parameters, body); |
| 5317 } | 5437 } |
| 5318 | 5438 |
| 5319 /** | 5439 /** |
| 5320 * Parse a shift expression. | 5440 * Parse a shift expression. |
| 5321 * | 5441 * |
| 5322 * <pre> | 5442 * <pre> |
| 5323 * shiftExpression ::= | 5443 * shiftExpression ::= |
| 5324 * additiveExpression (shiftOperator additiveExpression)* | 5444 * additiveExpression (shiftOperator additiveExpression)* |
| (...skipping 25 matching lines...) Expand all Loading... |
| 5350 * </pre> | 5470 * </pre> |
| 5351 * | 5471 * |
| 5352 * @return the statements that were parsed | 5472 * @return the statements that were parsed |
| 5353 */ | 5473 */ |
| 5354 List<Statement> parseStatements2() { | 5474 List<Statement> parseStatements2() { |
| 5355 List<Statement> statements = new List<Statement>(); | 5475 List<Statement> statements = new List<Statement>(); |
| 5356 Token statementStart = _currentToken; | 5476 Token statementStart = _currentToken; |
| 5357 while (!matches5(TokenType.EOF) && !matches5(TokenType.CLOSE_CURLY_BRACKET)
&& !isSwitchMember()) { | 5477 while (!matches5(TokenType.EOF) && !matches5(TokenType.CLOSE_CURLY_BRACKET)
&& !isSwitchMember()) { |
| 5358 statements.add(parseStatement2()); | 5478 statements.add(parseStatement2()); |
| 5359 if (identical(_currentToken, statementStart)) { | 5479 if (identical(_currentToken, statementStart)) { |
| 5360 reportError9(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_currentT
oken.lexeme]); | 5480 reportError10(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [_current
Token.lexeme]); |
| 5361 advance(); | 5481 advance(); |
| 5362 } | 5482 } |
| 5363 statementStart = _currentToken; | 5483 statementStart = _currentToken; |
| 5364 } | 5484 } |
| 5365 return statements; | 5485 return statements; |
| 5366 } | 5486 } |
| 5367 | 5487 |
| 5368 /** | 5488 /** |
| 5369 * Parse a string literal that contains interpolations. | 5489 * Parse a string literal that contains interpolations. |
| 5370 * | 5490 * |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5448 Token rightParenthesis = expect2(TokenType.CLOSE_PAREN); | 5568 Token rightParenthesis = expect2(TokenType.CLOSE_PAREN); |
| 5449 Token leftBracket = expect2(TokenType.OPEN_CURLY_BRACKET); | 5569 Token leftBracket = expect2(TokenType.OPEN_CURLY_BRACKET); |
| 5450 Token defaultKeyword = null; | 5570 Token defaultKeyword = null; |
| 5451 List<SwitchMember> members = new List<SwitchMember>(); | 5571 List<SwitchMember> members = new List<SwitchMember>(); |
| 5452 while (!matches5(TokenType.EOF) && !matches5(TokenType.CLOSE_CURLY_BRACKET
)) { | 5572 while (!matches5(TokenType.EOF) && !matches5(TokenType.CLOSE_CURLY_BRACKET
)) { |
| 5453 List<Label> labels = new List<Label>(); | 5573 List<Label> labels = new List<Label>(); |
| 5454 while (matchesIdentifier() && matches4(peek(), TokenType.COLON)) { | 5574 while (matchesIdentifier() && matches4(peek(), TokenType.COLON)) { |
| 5455 SimpleIdentifier identifier = parseSimpleIdentifier(); | 5575 SimpleIdentifier identifier = parseSimpleIdentifier(); |
| 5456 String label = identifier.token.lexeme; | 5576 String label = identifier.token.lexeme; |
| 5457 if (definedLabels.contains(label)) { | 5577 if (definedLabels.contains(label)) { |
| 5458 reportError9(ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT, id
entifier.token, [label]); | 5578 reportError10(ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT, i
dentifier.token, [label]); |
| 5459 } else { | 5579 } else { |
| 5460 javaSetAdd(definedLabels, label); | 5580 javaSetAdd(definedLabels, label); |
| 5461 } | 5581 } |
| 5462 Token colon = expect2(TokenType.COLON); | 5582 Token colon = expect2(TokenType.COLON); |
| 5463 labels.add(new Label.full(identifier, colon)); | 5583 labels.add(new Label.full(identifier, colon)); |
| 5464 } | 5584 } |
| 5465 if (matches(Keyword.CASE)) { | 5585 if (matches(Keyword.CASE)) { |
| 5466 Token caseKeyword = andAdvance; | 5586 Token caseKeyword = andAdvance; |
| 5467 Expression caseExpression = parseExpression2(); | 5587 Expression caseExpression = parseExpression2(); |
| 5468 Token colon = expect2(TokenType.COLON); | 5588 Token colon = expect2(TokenType.COLON); |
| 5469 members.add(new SwitchCase.full(labels, caseKeyword, caseExpression, c
olon, parseStatements2())); | 5589 members.add(new SwitchCase.full(labels, caseKeyword, caseExpression, c
olon, parseStatements2())); |
| 5470 if (defaultKeyword != null) { | 5590 if (defaultKeyword != null) { |
| 5471 reportError9(ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, cas
eKeyword, []); | 5591 reportError10(ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, ca
seKeyword, []); |
| 5472 } | 5592 } |
| 5473 } else if (matches(Keyword.DEFAULT)) { | 5593 } else if (matches(Keyword.DEFAULT)) { |
| 5474 if (defaultKeyword != null) { | 5594 if (defaultKeyword != null) { |
| 5475 reportError9(ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, peek
(), []); | 5595 reportError10(ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, pee
k(), []); |
| 5476 } | 5596 } |
| 5477 defaultKeyword = andAdvance; | 5597 defaultKeyword = andAdvance; |
| 5478 Token colon = expect2(TokenType.COLON); | 5598 Token colon = expect2(TokenType.COLON); |
| 5479 members.add(new SwitchDefault.full(labels, defaultKeyword, colon, pars
eStatements2())); | 5599 members.add(new SwitchDefault.full(labels, defaultKeyword, colon, pars
eStatements2())); |
| 5480 } else { | 5600 } else { |
| 5481 reportError8(ParserErrorCode.EXPECTED_CASE_OR_DEFAULT, []); | 5601 reportError9(ParserErrorCode.EXPECTED_CASE_OR_DEFAULT, []); |
| 5482 while (!matches5(TokenType.EOF) && !matches5(TokenType.CLOSE_CURLY_BRA
CKET) && !matches(Keyword.CASE) && !matches(Keyword.DEFAULT)) { | 5602 while (!matches5(TokenType.EOF) && !matches5(TokenType.CLOSE_CURLY_BRA
CKET) && !matches(Keyword.CASE) && !matches(Keyword.DEFAULT)) { |
| 5483 advance(); | 5603 advance(); |
| 5484 } | 5604 } |
| 5485 } | 5605 } |
| 5486 } | 5606 } |
| 5487 Token rightBracket = expect2(TokenType.CLOSE_CURLY_BRACKET); | 5607 Token rightBracket = expect2(TokenType.CLOSE_CURLY_BRACKET); |
| 5488 return new SwitchStatement.full(keyword, leftParenthesis, expression, righ
tParenthesis, leftBracket, members, rightBracket); | 5608 return new SwitchStatement.full(keyword, leftParenthesis, expression, righ
tParenthesis, leftBracket, members, rightBracket); |
| 5489 } finally { | 5609 } finally { |
| 5490 _inSwitch = wasInSwitch; | 5610 _inSwitch = wasInSwitch; |
| 5491 } | 5611 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 5504 SymbolLiteral parseSymbolLiteral() { | 5624 SymbolLiteral parseSymbolLiteral() { |
| 5505 Token poundSign = andAdvance; | 5625 Token poundSign = andAdvance; |
| 5506 List<Token> components = new List<Token>(); | 5626 List<Token> components = new List<Token>(); |
| 5507 if (matchesIdentifier()) { | 5627 if (matchesIdentifier()) { |
| 5508 components.add(andAdvance); | 5628 components.add(andAdvance); |
| 5509 while (matches5(TokenType.PERIOD)) { | 5629 while (matches5(TokenType.PERIOD)) { |
| 5510 advance(); | 5630 advance(); |
| 5511 if (matchesIdentifier()) { | 5631 if (matchesIdentifier()) { |
| 5512 components.add(andAdvance); | 5632 components.add(andAdvance); |
| 5513 } else { | 5633 } else { |
| 5514 reportError8(ParserErrorCode.MISSING_IDENTIFIER, []); | 5634 reportError9(ParserErrorCode.MISSING_IDENTIFIER, []); |
| 5515 components.add(createSyntheticToken2(TokenType.IDENTIFIER)); | 5635 components.add(createSyntheticToken2(TokenType.IDENTIFIER)); |
| 5516 break; | 5636 break; |
| 5517 } | 5637 } |
| 5518 } | 5638 } |
| 5519 } else if (_currentToken.isOperator) { | 5639 } else if (_currentToken.isOperator) { |
| 5520 components.add(andAdvance); | 5640 components.add(andAdvance); |
| 5521 } else { | 5641 } else { |
| 5522 reportError8(ParserErrorCode.MISSING_IDENTIFIER, []); | 5642 reportError9(ParserErrorCode.MISSING_IDENTIFIER, []); |
| 5523 components.add(createSyntheticToken2(TokenType.IDENTIFIER)); | 5643 components.add(createSyntheticToken2(TokenType.IDENTIFIER)); |
| 5524 } | 5644 } |
| 5525 return new SymbolLiteral.full(poundSign, new List.from(components)); | 5645 return new SymbolLiteral.full(poundSign, new List.from(components)); |
| 5526 } | 5646 } |
| 5527 | 5647 |
| 5528 /** | 5648 /** |
| 5529 * Parse a throw expression. | 5649 * Parse a throw expression. |
| 5530 * | 5650 * |
| 5531 * <pre> | 5651 * <pre> |
| 5532 * throwExpression ::= | 5652 * throwExpression ::= |
| 5533 * 'throw' expression | 5653 * 'throw' expression |
| 5534 * </pre> | 5654 * </pre> |
| 5535 * | 5655 * |
| 5536 * @return the throw expression that was parsed | 5656 * @return the throw expression that was parsed |
| 5537 */ | 5657 */ |
| 5538 Expression parseThrowExpression() { | 5658 Expression parseThrowExpression() { |
| 5539 Token keyword = expect(Keyword.THROW); | 5659 Token keyword = expect(Keyword.THROW); |
| 5540 if (matches5(TokenType.SEMICOLON) || matches5(TokenType.CLOSE_PAREN)) { | 5660 if (matches5(TokenType.SEMICOLON) || matches5(TokenType.CLOSE_PAREN)) { |
| 5541 reportError9(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, _currentToken, [
]); | 5661 reportError10(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, _currentToken,
[]); |
| 5542 return new ThrowExpression.full(keyword, createSyntheticIdentifier()); | 5662 return new ThrowExpression.full(keyword, createSyntheticIdentifier()); |
| 5543 } | 5663 } |
| 5544 Expression expression = parseExpression2(); | 5664 Expression expression = parseExpression2(); |
| 5545 return new ThrowExpression.full(keyword, expression); | 5665 return new ThrowExpression.full(keyword, expression); |
| 5546 } | 5666 } |
| 5547 | 5667 |
| 5548 /** | 5668 /** |
| 5549 * Parse a throw expression. | 5669 * Parse a throw expression. |
| 5550 * | 5670 * |
| 5551 * <pre> | 5671 * <pre> |
| 5552 * throwExpressionWithoutCascade ::= | 5672 * throwExpressionWithoutCascade ::= |
| 5553 * 'throw' expressionWithoutCascade | 5673 * 'throw' expressionWithoutCascade |
| 5554 * </pre> | 5674 * </pre> |
| 5555 * | 5675 * |
| 5556 * @return the throw expression that was parsed | 5676 * @return the throw expression that was parsed |
| 5557 */ | 5677 */ |
| 5558 Expression parseThrowExpressionWithoutCascade() { | 5678 Expression parseThrowExpressionWithoutCascade() { |
| 5559 Token keyword = expect(Keyword.THROW); | 5679 Token keyword = expect(Keyword.THROW); |
| 5560 if (matches5(TokenType.SEMICOLON) || matches5(TokenType.CLOSE_PAREN)) { | 5680 if (matches5(TokenType.SEMICOLON) || matches5(TokenType.CLOSE_PAREN)) { |
| 5561 reportError9(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, _currentToken, [
]); | 5681 reportError10(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, _currentToken,
[]); |
| 5562 return new ThrowExpression.full(keyword, createSyntheticIdentifier()); | 5682 return new ThrowExpression.full(keyword, createSyntheticIdentifier()); |
| 5563 } | 5683 } |
| 5564 Expression expression = parseExpressionWithoutCascade(); | 5684 Expression expression = parseExpressionWithoutCascade(); |
| 5565 return new ThrowExpression.full(keyword, expression); | 5685 return new ThrowExpression.full(keyword, expression); |
| 5566 } | 5686 } |
| 5567 | 5687 |
| 5568 /** | 5688 /** |
| 5569 * Parse a try statement. | 5689 * Parse a try statement. |
| 5570 * | 5690 * |
| 5571 * <pre> | 5691 * <pre> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5615 } | 5735 } |
| 5616 Block catchBody = parseBlock(); | 5736 Block catchBody = parseBlock(); |
| 5617 catchClauses.add(new CatchClause.full(onKeyword, exceptionType, catchKeywo
rd, leftParenthesis, exceptionParameter, comma, stackTraceParameter, rightParent
hesis, catchBody)); | 5737 catchClauses.add(new CatchClause.full(onKeyword, exceptionType, catchKeywo
rd, leftParenthesis, exceptionParameter, comma, stackTraceParameter, rightParent
hesis, catchBody)); |
| 5618 } | 5738 } |
| 5619 Token finallyKeyword = null; | 5739 Token finallyKeyword = null; |
| 5620 if (matches(Keyword.FINALLY)) { | 5740 if (matches(Keyword.FINALLY)) { |
| 5621 finallyKeyword = andAdvance; | 5741 finallyKeyword = andAdvance; |
| 5622 finallyClause = parseBlock(); | 5742 finallyClause = parseBlock(); |
| 5623 } else { | 5743 } else { |
| 5624 if (catchClauses.isEmpty) { | 5744 if (catchClauses.isEmpty) { |
| 5625 reportError8(ParserErrorCode.MISSING_CATCH_OR_FINALLY, []); | 5745 reportError9(ParserErrorCode.MISSING_CATCH_OR_FINALLY, []); |
| 5626 } | 5746 } |
| 5627 } | 5747 } |
| 5628 return new TryStatement.full(tryKeyword, body, catchClauses, finallyKeyword,
finallyClause); | 5748 return new TryStatement.full(tryKeyword, body, catchClauses, finallyKeyword,
finallyClause); |
| 5629 } | 5749 } |
| 5630 | 5750 |
| 5631 /** | 5751 /** |
| 5632 * Parse a type alias. | 5752 * Parse a type alias. |
| 5633 * | 5753 * |
| 5634 * <pre> | 5754 * <pre> |
| 5635 * typeAlias ::= | 5755 * typeAlias ::= |
| (...skipping 20 matching lines...) Expand all Loading... |
| 5656 * @return the type alias that was parsed | 5776 * @return the type alias that was parsed |
| 5657 */ | 5777 */ |
| 5658 TypeAlias parseTypeAlias(CommentAndMetadata commentAndMetadata) { | 5778 TypeAlias parseTypeAlias(CommentAndMetadata commentAndMetadata) { |
| 5659 Token keyword = expect(Keyword.TYPEDEF); | 5779 Token keyword = expect(Keyword.TYPEDEF); |
| 5660 if (matchesIdentifier()) { | 5780 if (matchesIdentifier()) { |
| 5661 Token next = peek(); | 5781 Token next = peek(); |
| 5662 if (matches4(next, TokenType.LT)) { | 5782 if (matches4(next, TokenType.LT)) { |
| 5663 next = skipTypeParameterList(next); | 5783 next = skipTypeParameterList(next); |
| 5664 if (next != null && matches4(next, TokenType.EQ)) { | 5784 if (next != null && matches4(next, TokenType.EQ)) { |
| 5665 TypeAlias typeAlias = parseClassTypeAlias(commentAndMetadata, keyword)
; | 5785 TypeAlias typeAlias = parseClassTypeAlias(commentAndMetadata, keyword)
; |
| 5666 reportError9(ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, keyword, [])
; | 5786 reportError10(ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, keyword, []
); |
| 5667 return typeAlias; | 5787 return typeAlias; |
| 5668 } | 5788 } |
| 5669 } else if (matches4(next, TokenType.EQ)) { | 5789 } else if (matches4(next, TokenType.EQ)) { |
| 5670 TypeAlias typeAlias = parseClassTypeAlias(commentAndMetadata, keyword); | 5790 TypeAlias typeAlias = parseClassTypeAlias(commentAndMetadata, keyword); |
| 5671 reportError9(ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, keyword, []); | 5791 reportError10(ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, keyword, []); |
| 5672 return typeAlias; | 5792 return typeAlias; |
| 5673 } | 5793 } |
| 5674 } | 5794 } |
| 5675 return parseFunctionTypeAlias(commentAndMetadata, keyword); | 5795 return parseFunctionTypeAlias(commentAndMetadata, keyword); |
| 5676 } | 5796 } |
| 5677 | 5797 |
| 5678 /** | 5798 /** |
| 5679 * Parse a unary expression. | 5799 * Parse a unary expression. |
| 5680 * | 5800 * |
| 5681 * <pre> | 5801 * <pre> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 5707 } | 5827 } |
| 5708 if (identical(operator.type, TokenType.MINUS_MINUS)) { | 5828 if (identical(operator.type, TokenType.MINUS_MINUS)) { |
| 5709 int offset = operator.offset; | 5829 int offset = operator.offset; |
| 5710 Token firstOperator = new Token(TokenType.MINUS, offset); | 5830 Token firstOperator = new Token(TokenType.MINUS, offset); |
| 5711 Token secondOperator = new Token(TokenType.MINUS, offset + 1); | 5831 Token secondOperator = new Token(TokenType.MINUS, offset + 1); |
| 5712 secondOperator.setNext(_currentToken); | 5832 secondOperator.setNext(_currentToken); |
| 5713 firstOperator.setNext(secondOperator); | 5833 firstOperator.setNext(secondOperator); |
| 5714 operator.previous.setNext(firstOperator); | 5834 operator.previous.setNext(firstOperator); |
| 5715 return new PrefixExpression.full(firstOperator, new PrefixExpression.f
ull(secondOperator, new SuperExpression.full(andAdvance))); | 5835 return new PrefixExpression.full(firstOperator, new PrefixExpression.f
ull(secondOperator, new SuperExpression.full(andAdvance))); |
| 5716 } else { | 5836 } else { |
| 5717 reportError8(ParserErrorCode.INVALID_OPERATOR_FOR_SUPER, [operator.lex
eme]); | 5837 reportError9(ParserErrorCode.INVALID_OPERATOR_FOR_SUPER, [operator.lex
eme]); |
| 5718 return new PrefixExpression.full(operator, new SuperExpression.full(an
dAdvance)); | 5838 return new PrefixExpression.full(operator, new SuperExpression.full(an
dAdvance)); |
| 5719 } | 5839 } |
| 5720 } | 5840 } |
| 5721 return new PrefixExpression.full(operator, parseAssignableExpression(false
)); | 5841 return new PrefixExpression.full(operator, parseAssignableExpression(false
)); |
| 5722 } else if (matches5(TokenType.PLUS)) { | 5842 } else if (matches5(TokenType.PLUS)) { |
| 5723 reportError8(ParserErrorCode.MISSING_IDENTIFIER, []); | 5843 reportError9(ParserErrorCode.MISSING_IDENTIFIER, []); |
| 5724 return createSyntheticIdentifier(); | 5844 return createSyntheticIdentifier(); |
| 5725 } | 5845 } |
| 5726 return parsePostfixExpression(); | 5846 return parsePostfixExpression(); |
| 5727 } | 5847 } |
| 5728 | 5848 |
| 5729 /** | 5849 /** |
| 5730 * Parse a variable declaration. | 5850 * Parse a variable declaration. |
| 5731 * | 5851 * |
| 5732 * <pre> | 5852 * <pre> |
| 5733 * variableDeclaration ::= | 5853 * variableDeclaration ::= |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5774 * | 5894 * |
| 5775 * @param commentAndMetadata the metadata to be associated with the variable d
eclaration list, or | 5895 * @param commentAndMetadata the metadata to be associated with the variable d
eclaration list, or |
| 5776 * `null` if there is no attempt at parsing the comment and metadata | 5896 * `null` if there is no attempt at parsing the comment and metadata |
| 5777 * @param keyword the token representing the 'final', 'const' or 'var' keyword
, or `null` if | 5897 * @param keyword the token representing the 'final', 'const' or 'var' keyword
, or `null` if |
| 5778 * there is no keyword | 5898 * there is no keyword |
| 5779 * @param type the type of the variables in the list | 5899 * @param type the type of the variables in the list |
| 5780 * @return the variable declaration list that was parsed | 5900 * @return the variable declaration list that was parsed |
| 5781 */ | 5901 */ |
| 5782 VariableDeclarationList parseVariableDeclarationList2(CommentAndMetadata comme
ntAndMetadata, Token keyword, TypeName type) { | 5902 VariableDeclarationList parseVariableDeclarationList2(CommentAndMetadata comme
ntAndMetadata, Token keyword, TypeName type) { |
| 5783 if (type != null && keyword != null && matches3(keyword, Keyword.VAR)) { | 5903 if (type != null && keyword != null && matches3(keyword, Keyword.VAR)) { |
| 5784 reportError9(ParserErrorCode.VAR_AND_TYPE, keyword, []); | 5904 reportError10(ParserErrorCode.VAR_AND_TYPE, keyword, []); |
| 5785 } | 5905 } |
| 5786 List<VariableDeclaration> variables = new List<VariableDeclaration>(); | 5906 List<VariableDeclaration> variables = new List<VariableDeclaration>(); |
| 5787 variables.add(parseVariableDeclaration()); | 5907 variables.add(parseVariableDeclaration()); |
| 5788 while (matches5(TokenType.COMMA)) { | 5908 while (matches5(TokenType.COMMA)) { |
| 5789 advance(); | 5909 advance(); |
| 5790 variables.add(parseVariableDeclaration()); | 5910 variables.add(parseVariableDeclaration()); |
| 5791 } | 5911 } |
| 5792 return new VariableDeclarationList.full(commentAndMetadata != null ? comment
AndMetadata.comment : null, commentAndMetadata != null ? commentAndMetadata.meta
data : null, keyword, type, variables); | 5912 return new VariableDeclarationList.full(commentAndMetadata != null ? comment
AndMetadata.comment : null, commentAndMetadata != null ? commentAndMetadata.meta
data : null, keyword, type, variables); |
| 5793 } | 5913 } |
| 5794 | 5914 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5889 void reportError(ParserErrorCode errorCode, ASTNode node, List<Object> argumen
ts) { | 6009 void reportError(ParserErrorCode errorCode, ASTNode node, List<Object> argumen
ts) { |
| 5890 _errorListener.onError(new AnalysisError.con2(_source, node.offset, node.len
gth, errorCode, arguments)); | 6010 _errorListener.onError(new AnalysisError.con2(_source, node.offset, node.len
gth, errorCode, arguments)); |
| 5891 } | 6011 } |
| 5892 | 6012 |
| 5893 /** | 6013 /** |
| 5894 * Report an error with the given error code and arguments. | 6014 * Report an error with the given error code and arguments. |
| 5895 * | 6015 * |
| 5896 * @param errorCode the error code of the error to be reported | 6016 * @param errorCode the error code of the error to be reported |
| 5897 * @param arguments the arguments to the error, used to compose the error mess
age | 6017 * @param arguments the arguments to the error, used to compose the error mess
age |
| 5898 */ | 6018 */ |
| 5899 void reportError8(ParserErrorCode errorCode, List<Object> arguments) { | 6019 void reportError9(ParserErrorCode errorCode, List<Object> arguments) { |
| 5900 reportError9(errorCode, _currentToken, arguments); | 6020 reportError10(errorCode, _currentToken, arguments); |
| 5901 } | 6021 } |
| 5902 | 6022 |
| 5903 /** | 6023 /** |
| 5904 * Report an error with the given error code and arguments. | 6024 * Report an error with the given error code and arguments. |
| 5905 * | 6025 * |
| 5906 * @param errorCode the error code of the error to be reported | 6026 * @param errorCode the error code of the error to be reported |
| 5907 * @param token the token specifying the location of the error | 6027 * @param token the token specifying the location of the error |
| 5908 * @param arguments the arguments to the error, used to compose the error mess
age | 6028 * @param arguments the arguments to the error, used to compose the error mess
age |
| 5909 */ | 6029 */ |
| 5910 void reportError9(ParserErrorCode errorCode, Token token, List<Object> argumen
ts) { | 6030 void reportError10(ParserErrorCode errorCode, Token token, List<Object> argume
nts) { |
| 5911 _errorListener.onError(new AnalysisError.con2(_source, token.offset, token.l
ength, errorCode, arguments)); | 6031 _errorListener.onError(new AnalysisError.con2(_source, token.offset, token.l
ength, errorCode, arguments)); |
| 5912 } | 6032 } |
| 5913 | 6033 |
| 5914 /** | 6034 /** |
| 5915 * Look for user defined tasks in comments and convert them into info level an
alysis issues. | 6035 * Look for user defined tasks in comments and convert them into info level an
alysis issues. |
| 5916 * | 6036 * |
| 5917 * @param commentToken the comment token to analyze | 6037 * @param commentToken the comment token to analyze |
| 5918 */ | 6038 */ |
| 5919 void scrapeTodoComment(Token commentToken) { | 6039 void scrapeTodoComment(Token commentToken) { |
| 5920 JavaPatternMatcher matcher = new JavaPatternMatcher(TodoCode.TODO_REGEX, com
mentToken.lexeme); | 6040 JavaPatternMatcher matcher = new JavaPatternMatcher(TodoCode.TODO_REGEX, com
mentToken.lexeme); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 5938 * | 'var' | 6058 * | 'var' |
| 5939 * | type | 6059 * | type |
| 5940 * </pre> | 6060 * </pre> |
| 5941 * | 6061 * |
| 5942 * @param startToken the token at which parsing is to begin | 6062 * @param startToken the token at which parsing is to begin |
| 5943 * @return the token following the type that was parsed | 6063 * @return the token following the type that was parsed |
| 5944 */ | 6064 */ |
| 5945 Token skipFinalConstVarOrType(Token startToken) { | 6065 Token skipFinalConstVarOrType(Token startToken) { |
| 5946 if (matches3(startToken, Keyword.FINAL) || matches3(startToken, Keyword.CONS
T)) { | 6066 if (matches3(startToken, Keyword.FINAL) || matches3(startToken, Keyword.CONS
T)) { |
| 5947 Token next = startToken.next; | 6067 Token next = startToken.next; |
| 5948 if (matchesIdentifier2(next.next) || matches4(next.next, TokenType.LT) ||
matches3(next.next, Keyword.THIS)) { | 6068 if (matchesIdentifier2(next)) { |
| 5949 return skipTypeName(next); | 6069 Token next2 = next.next; |
| 6070 if (matchesIdentifier2(next2) || matches4(next2, TokenType.LT) || matche
s4(next2, TokenType.PERIOD)) { |
| 6071 return skipTypeName(next); |
| 6072 } |
| 6073 return next; |
| 5950 } | 6074 } |
| 5951 } else if (matches3(startToken, Keyword.VAR)) { | 6075 } else if (matches3(startToken, Keyword.VAR)) { |
| 5952 return startToken.next; | 6076 return startToken.next; |
| 5953 } else if (matchesIdentifier2(startToken)) { | 6077 } else if (matchesIdentifier2(startToken)) { |
| 5954 Token next = startToken.next; | 6078 Token next = startToken.next; |
| 5955 if (matchesIdentifier2(next) || matches4(next, TokenType.LT) || matches3(n
ext, Keyword.THIS) || (matches4(next, TokenType.PERIOD) && matchesIdentifier2(ne
xt.next) && (matchesIdentifier2(next.next.next) || matches4(next.next.next, Toke
nType.LT) || matches3(next.next.next, Keyword.THIS)))) { | 6079 if (matchesIdentifier2(next) || matches4(next, TokenType.LT) || matches3(n
ext, Keyword.THIS) || (matches4(next, TokenType.PERIOD) && matchesIdentifier2(ne
xt.next) && (matchesIdentifier2(next.next.next) || matches4(next.next.next, Toke
nType.LT) || matches3(next.next.next, Keyword.THIS)))) { |
| 5956 return skipReturnType(startToken); | 6080 return skipReturnType(startToken); |
| 5957 } | 6081 } |
| 5958 } | 6082 } |
| 5959 return null; | 6083 return null; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6030 * If the given token is a begin token with an associated end token, then retu
rn the token | 6154 * If the given token is a begin token with an associated end token, then retu
rn the token |
| 6031 * following the end token. Otherwise, return `null`. | 6155 * following the end token. Otherwise, return `null`. |
| 6032 * | 6156 * |
| 6033 * @param startToken the token that is assumed to be a being token | 6157 * @param startToken the token that is assumed to be a being token |
| 6034 * @return the token following the matching end token | 6158 * @return the token following the matching end token |
| 6035 */ | 6159 */ |
| 6036 Token skipPastMatchingToken(Token startToken) { | 6160 Token skipPastMatchingToken(Token startToken) { |
| 6037 if (startToken is! BeginToken) { | 6161 if (startToken is! BeginToken) { |
| 6038 return null; | 6162 return null; |
| 6039 } | 6163 } |
| 6040 Token closeParen = ((startToken as BeginToken)).endToken; | 6164 Token closeParen = (startToken as BeginToken).endToken; |
| 6041 if (closeParen == null) { | 6165 if (closeParen == null) { |
| 6042 return null; | 6166 return null; |
| 6043 } | 6167 } |
| 6044 return closeParen.next; | 6168 return closeParen.next; |
| 6045 } | 6169 } |
| 6046 | 6170 |
| 6047 /** | 6171 /** |
| 6048 * Parse a prefixed identifier, starting at the given token, without actually
creating a prefixed | 6172 * Parse a prefixed identifier, starting at the given token, without actually
creating a prefixed |
| 6049 * identifier or changing the current token. Return the token following the pr
efixed identifier | 6173 * identifier or changing the current token. Return the token following the pr
efixed identifier |
| 6050 * that was parsed, or `null` if the given token is not the first token in a v
alid prefixed | 6174 * that was parsed, or `null` if the given token is not the first token in a v
alid prefixed |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6104 * | 6228 * |
| 6105 * <pre> | 6229 * <pre> |
| 6106 * identifier ::= | 6230 * identifier ::= |
| 6107 * IDENTIFIER | 6231 * IDENTIFIER |
| 6108 * </pre> | 6232 * </pre> |
| 6109 * | 6233 * |
| 6110 * @param startToken the token at which parsing is to begin | 6234 * @param startToken the token at which parsing is to begin |
| 6111 * @return the token following the simple identifier that was parsed | 6235 * @return the token following the simple identifier that was parsed |
| 6112 */ | 6236 */ |
| 6113 Token skipSimpleIdentifier(Token startToken) { | 6237 Token skipSimpleIdentifier(Token startToken) { |
| 6114 if (matches4(startToken, TokenType.IDENTIFIER) || (matches4(startToken, Toke
nType.KEYWORD) && ((startToken as KeywordToken)).keyword.isPseudoKeyword)) { | 6238 if (matches4(startToken, TokenType.IDENTIFIER) || (matches4(startToken, Toke
nType.KEYWORD) && (startToken as KeywordToken).keyword.isPseudoKeyword)) { |
| 6115 return startToken.next; | 6239 return startToken.next; |
| 6116 } | 6240 } |
| 6117 return null; | 6241 return null; |
| 6118 } | 6242 } |
| 6119 | 6243 |
| 6120 /** | 6244 /** |
| 6121 * Parse a string literal that contains interpolations, starting at the given
token, without | 6245 * Parse a string literal that contains interpolations, starting at the given
token, without |
| 6122 * actually creating a string literal or changing the current token. Return th
e token following | 6246 * actually creating a string literal or changing the current token. Return th
e token following |
| 6123 * the string literal that was parsed, or `null` if the given token is not the
first token | 6247 * the string literal that was parsed, or `null` if the given token is not the
first token |
| 6124 * in a valid string literal. | 6248 * in a valid string literal. |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6352 } else if (currentChar == 0x66) { | 6476 } else if (currentChar == 0x66) { |
| 6353 builder.appendChar(0xC); | 6477 builder.appendChar(0xC); |
| 6354 } else if (currentChar == 0x62) { | 6478 } else if (currentChar == 0x62) { |
| 6355 builder.appendChar(0x8); | 6479 builder.appendChar(0x8); |
| 6356 } else if (currentChar == 0x74) { | 6480 } else if (currentChar == 0x74) { |
| 6357 builder.appendChar(0x9); | 6481 builder.appendChar(0x9); |
| 6358 } else if (currentChar == 0x76) { | 6482 } else if (currentChar == 0x76) { |
| 6359 builder.appendChar(0xB); | 6483 builder.appendChar(0xB); |
| 6360 } else if (currentChar == 0x78) { | 6484 } else if (currentChar == 0x78) { |
| 6361 if (currentIndex + 2 >= length) { | 6485 if (currentIndex + 2 >= length) { |
| 6362 reportError8(ParserErrorCode.INVALID_HEX_ESCAPE, []); | 6486 reportError9(ParserErrorCode.INVALID_HEX_ESCAPE, []); |
| 6363 return length; | 6487 return length; |
| 6364 } | 6488 } |
| 6365 int firstDigit = lexeme.codeUnitAt(currentIndex + 1); | 6489 int firstDigit = lexeme.codeUnitAt(currentIndex + 1); |
| 6366 int secondDigit = lexeme.codeUnitAt(currentIndex + 2); | 6490 int secondDigit = lexeme.codeUnitAt(currentIndex + 2); |
| 6367 if (!isHexDigit(firstDigit) || !isHexDigit(secondDigit)) { | 6491 if (!isHexDigit(firstDigit) || !isHexDigit(secondDigit)) { |
| 6368 reportError8(ParserErrorCode.INVALID_HEX_ESCAPE, []); | 6492 reportError9(ParserErrorCode.INVALID_HEX_ESCAPE, []); |
| 6369 } else { | 6493 } else { |
| 6370 builder.appendChar(((Character.digit(firstDigit, 16) << 4) + Character.d
igit(secondDigit, 16)) as int); | 6494 builder.appendChar(((Character.digit(firstDigit, 16) << 4) + Character.d
igit(secondDigit, 16)) as int); |
| 6371 } | 6495 } |
| 6372 return currentIndex + 3; | 6496 return currentIndex + 3; |
| 6373 } else if (currentChar == 0x75) { | 6497 } else if (currentChar == 0x75) { |
| 6374 currentIndex++; | 6498 currentIndex++; |
| 6375 if (currentIndex >= length) { | 6499 if (currentIndex >= length) { |
| 6376 reportError8(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); | 6500 reportError9(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); |
| 6377 return length; | 6501 return length; |
| 6378 } | 6502 } |
| 6379 currentChar = lexeme.codeUnitAt(currentIndex); | 6503 currentChar = lexeme.codeUnitAt(currentIndex); |
| 6380 if (currentChar == 0x7B) { | 6504 if (currentChar == 0x7B) { |
| 6381 currentIndex++; | 6505 currentIndex++; |
| 6382 if (currentIndex >= length) { | 6506 if (currentIndex >= length) { |
| 6383 reportError8(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); | 6507 reportError9(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); |
| 6384 return length; | 6508 return length; |
| 6385 } | 6509 } |
| 6386 currentChar = lexeme.codeUnitAt(currentIndex); | 6510 currentChar = lexeme.codeUnitAt(currentIndex); |
| 6387 int digitCount = 0; | 6511 int digitCount = 0; |
| 6388 int value = 0; | 6512 int value = 0; |
| 6389 while (currentChar != 0x7D) { | 6513 while (currentChar != 0x7D) { |
| 6390 if (!isHexDigit(currentChar)) { | 6514 if (!isHexDigit(currentChar)) { |
| 6391 reportError8(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); | 6515 reportError9(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); |
| 6392 currentIndex++; | 6516 currentIndex++; |
| 6393 while (currentIndex < length && lexeme.codeUnitAt(currentIndex) != 0
x7D) { | 6517 while (currentIndex < length && lexeme.codeUnitAt(currentIndex) != 0
x7D) { |
| 6394 currentIndex++; | 6518 currentIndex++; |
| 6395 } | 6519 } |
| 6396 return currentIndex + 1; | 6520 return currentIndex + 1; |
| 6397 } | 6521 } |
| 6398 digitCount++; | 6522 digitCount++; |
| 6399 value = (value << 4) + Character.digit(currentChar, 16); | 6523 value = (value << 4) + Character.digit(currentChar, 16); |
| 6400 currentIndex++; | 6524 currentIndex++; |
| 6401 if (currentIndex >= length) { | 6525 if (currentIndex >= length) { |
| 6402 reportError8(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); | 6526 reportError9(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); |
| 6403 return length; | 6527 return length; |
| 6404 } | 6528 } |
| 6405 currentChar = lexeme.codeUnitAt(currentIndex); | 6529 currentChar = lexeme.codeUnitAt(currentIndex); |
| 6406 } | 6530 } |
| 6407 if (digitCount < 1 || digitCount > 6) { | 6531 if (digitCount < 1 || digitCount > 6) { |
| 6408 reportError8(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); | 6532 reportError9(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); |
| 6409 } | 6533 } |
| 6410 appendScalarValue(builder, lexeme.substring(index, currentIndex + 1), va
lue, index, currentIndex); | 6534 appendScalarValue(builder, lexeme.substring(index, currentIndex + 1), va
lue, index, currentIndex); |
| 6411 return currentIndex + 1; | 6535 return currentIndex + 1; |
| 6412 } else { | 6536 } else { |
| 6413 if (currentIndex + 3 >= length) { | 6537 if (currentIndex + 3 >= length) { |
| 6414 reportError8(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); | 6538 reportError9(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); |
| 6415 return length; | 6539 return length; |
| 6416 } | 6540 } |
| 6417 int firstDigit = currentChar; | 6541 int firstDigit = currentChar; |
| 6418 int secondDigit = lexeme.codeUnitAt(currentIndex + 1); | 6542 int secondDigit = lexeme.codeUnitAt(currentIndex + 1); |
| 6419 int thirdDigit = lexeme.codeUnitAt(currentIndex + 2); | 6543 int thirdDigit = lexeme.codeUnitAt(currentIndex + 2); |
| 6420 int fourthDigit = lexeme.codeUnitAt(currentIndex + 3); | 6544 int fourthDigit = lexeme.codeUnitAt(currentIndex + 3); |
| 6421 if (!isHexDigit(firstDigit) || !isHexDigit(secondDigit) || !isHexDigit(t
hirdDigit) || !isHexDigit(fourthDigit)) { | 6545 if (!isHexDigit(firstDigit) || !isHexDigit(secondDigit) || !isHexDigit(t
hirdDigit) || !isHexDigit(fourthDigit)) { |
| 6422 reportError8(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); | 6546 reportError9(ParserErrorCode.INVALID_UNICODE_ESCAPE, []); |
| 6423 } else { | 6547 } else { |
| 6424 appendScalarValue(builder, lexeme.substring(index, currentIndex + 1),
(((((Character.digit(firstDigit, 16) << 4) + Character.digit(secondDigit, 16)) <
< 4) + Character.digit(thirdDigit, 16)) << 4) + Character.digit(fourthDigit, 16)
, index, currentIndex + 3); | 6548 appendScalarValue(builder, lexeme.substring(index, currentIndex + 1),
(((((Character.digit(firstDigit, 16) << 4) + Character.digit(secondDigit, 16)) <
< 4) + Character.digit(thirdDigit, 16)) << 4) + Character.digit(fourthDigit, 16)
, index, currentIndex + 3); |
| 6425 } | 6549 } |
| 6426 return currentIndex + 4; | 6550 return currentIndex + 4; |
| 6427 } | 6551 } |
| 6428 } else { | 6552 } else { |
| 6429 builder.appendChar(currentChar); | 6553 builder.appendChar(currentChar); |
| 6430 } | 6554 } |
| 6431 return currentIndex + 1; | 6555 return currentIndex + 1; |
| 6432 } | 6556 } |
| 6433 | 6557 |
| 6434 /** | 6558 /** |
| 6435 * Validate that the given parameter list does not contain any field initializ
ers. | 6559 * Validate that the given parameter list does not contain any field initializ
ers. |
| 6436 * | 6560 * |
| 6437 * @param parameterList the parameter list to be validated | 6561 * @param parameterList the parameter list to be validated |
| 6438 */ | 6562 */ |
| 6439 void validateFormalParameterList(FormalParameterList parameterList) { | 6563 void validateFormalParameterList(FormalParameterList parameterList) { |
| 6440 for (FormalParameter parameter in parameterList.parameters) { | 6564 for (FormalParameter parameter in parameterList.parameters) { |
| 6441 if (parameter is FieldFormalParameter) { | 6565 if (parameter is FieldFormalParameter) { |
| 6442 reportError(ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, ((par
ameter as FieldFormalParameter)).identifier, []); | 6566 reportError(ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, (para
meter as FieldFormalParameter).identifier, []); |
| 6443 } | 6567 } |
| 6444 } | 6568 } |
| 6445 } | 6569 } |
| 6446 | 6570 |
| 6447 /** | 6571 /** |
| 6448 * Validate that the given set of modifiers is appropriate for a class and ret
urn the 'abstract' | 6572 * Validate that the given set of modifiers is appropriate for a class and ret
urn the 'abstract' |
| 6449 * keyword if there is one. | 6573 * keyword if there is one. |
| 6450 * | 6574 * |
| 6451 * @param modifiers the modifiers being validated | 6575 * @param modifiers the modifiers being validated |
| 6452 */ | 6576 */ |
| 6453 Token validateModifiersForClass(Modifiers modifiers) { | 6577 Token validateModifiersForClass(Modifiers modifiers) { |
| 6454 validateModifiersForTopLevelDeclaration(modifiers); | 6578 validateModifiersForTopLevelDeclaration(modifiers); |
| 6455 if (modifiers.constKeyword != null) { | 6579 if (modifiers.constKeyword != null) { |
| 6456 reportError9(ParserErrorCode.CONST_CLASS, modifiers.constKeyword, []); | 6580 reportError10(ParserErrorCode.CONST_CLASS, modifiers.constKeyword, []); |
| 6457 } | 6581 } |
| 6458 if (modifiers.externalKeyword != null) { | 6582 if (modifiers.externalKeyword != null) { |
| 6459 reportError9(ParserErrorCode.EXTERNAL_CLASS, modifiers.externalKeyword, []
); | 6583 reportError10(ParserErrorCode.EXTERNAL_CLASS, modifiers.externalKeyword, [
]); |
| 6460 } | 6584 } |
| 6461 if (modifiers.finalKeyword != null) { | 6585 if (modifiers.finalKeyword != null) { |
| 6462 reportError9(ParserErrorCode.FINAL_CLASS, modifiers.finalKeyword, []); | 6586 reportError10(ParserErrorCode.FINAL_CLASS, modifiers.finalKeyword, []); |
| 6463 } | 6587 } |
| 6464 if (modifiers.varKeyword != null) { | 6588 if (modifiers.varKeyword != null) { |
| 6465 reportError9(ParserErrorCode.VAR_CLASS, modifiers.varKeyword, []); | 6589 reportError10(ParserErrorCode.VAR_CLASS, modifiers.varKeyword, []); |
| 6466 } | 6590 } |
| 6467 return modifiers.abstractKeyword; | 6591 return modifiers.abstractKeyword; |
| 6468 } | 6592 } |
| 6469 | 6593 |
| 6470 /** | 6594 /** |
| 6471 * Validate that the given set of modifiers is appropriate for a constructor a
nd return the | 6595 * Validate that the given set of modifiers is appropriate for a constructor a
nd return the |
| 6472 * 'const' keyword if there is one. | 6596 * 'const' keyword if there is one. |
| 6473 * | 6597 * |
| 6474 * @param modifiers the modifiers being validated | 6598 * @param modifiers the modifiers being validated |
| 6475 * @return the 'const' or 'final' keyword associated with the constructor | 6599 * @return the 'const' or 'final' keyword associated with the constructor |
| 6476 */ | 6600 */ |
| 6477 Token validateModifiersForConstructor(Modifiers modifiers) { | 6601 Token validateModifiersForConstructor(Modifiers modifiers) { |
| 6478 if (modifiers.abstractKeyword != null) { | 6602 if (modifiers.abstractKeyword != null) { |
| 6479 reportError8(ParserErrorCode.ABSTRACT_CLASS_MEMBER, []); | 6603 reportError9(ParserErrorCode.ABSTRACT_CLASS_MEMBER, []); |
| 6480 } | 6604 } |
| 6481 if (modifiers.finalKeyword != null) { | 6605 if (modifiers.finalKeyword != null) { |
| 6482 reportError9(ParserErrorCode.FINAL_CONSTRUCTOR, modifiers.finalKeyword, []
); | 6606 reportError10(ParserErrorCode.FINAL_CONSTRUCTOR, modifiers.finalKeyword, [
]); |
| 6483 } | 6607 } |
| 6484 if (modifiers.staticKeyword != null) { | 6608 if (modifiers.staticKeyword != null) { |
| 6485 reportError9(ParserErrorCode.STATIC_CONSTRUCTOR, modifiers.staticKeyword,
[]); | 6609 reportError10(ParserErrorCode.STATIC_CONSTRUCTOR, modifiers.staticKeyword,
[]); |
| 6486 } | 6610 } |
| 6487 if (modifiers.varKeyword != null) { | 6611 if (modifiers.varKeyword != null) { |
| 6488 reportError9(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, modifiers.varKe
yword, []); | 6612 reportError10(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, modifiers.varK
eyword, []); |
| 6489 } | 6613 } |
| 6490 Token externalKeyword = modifiers.externalKeyword; | 6614 Token externalKeyword = modifiers.externalKeyword; |
| 6491 Token constKeyword = modifiers.constKeyword; | 6615 Token constKeyword = modifiers.constKeyword; |
| 6492 Token factoryKeyword = modifiers.factoryKeyword; | 6616 Token factoryKeyword = modifiers.factoryKeyword; |
| 6493 if (externalKeyword != null && constKeyword != null && constKeyword.offset <
externalKeyword.offset) { | 6617 if (externalKeyword != null && constKeyword != null && constKeyword.offset <
externalKeyword.offset) { |
| 6494 reportError9(ParserErrorCode.EXTERNAL_AFTER_CONST, externalKeyword, []); | 6618 reportError10(ParserErrorCode.EXTERNAL_AFTER_CONST, externalKeyword, []); |
| 6495 } | 6619 } |
| 6496 if (externalKeyword != null && factoryKeyword != null && factoryKeyword.offs
et < externalKeyword.offset) { | 6620 if (externalKeyword != null && factoryKeyword != null && factoryKeyword.offs
et < externalKeyword.offset) { |
| 6497 reportError9(ParserErrorCode.EXTERNAL_AFTER_FACTORY, externalKeyword, []); | 6621 reportError10(ParserErrorCode.EXTERNAL_AFTER_FACTORY, externalKeyword, [])
; |
| 6498 } | 6622 } |
| 6499 return constKeyword; | 6623 return constKeyword; |
| 6500 } | 6624 } |
| 6501 | 6625 |
| 6502 /** | 6626 /** |
| 6503 * Validate that the given set of modifiers is appropriate for a field and ret
urn the 'final', | 6627 * Validate that the given set of modifiers is appropriate for a field and ret
urn the 'final', |
| 6504 * 'const' or 'var' keyword if there is one. | 6628 * 'const' or 'var' keyword if there is one. |
| 6505 * | 6629 * |
| 6506 * @param modifiers the modifiers being validated | 6630 * @param modifiers the modifiers being validated |
| 6507 * @return the 'final', 'const' or 'var' keyword associated with the field | 6631 * @return the 'final', 'const' or 'var' keyword associated with the field |
| 6508 */ | 6632 */ |
| 6509 Token validateModifiersForField(Modifiers modifiers) { | 6633 Token validateModifiersForField(Modifiers modifiers) { |
| 6510 if (modifiers.abstractKeyword != null) { | 6634 if (modifiers.abstractKeyword != null) { |
| 6511 reportError8(ParserErrorCode.ABSTRACT_CLASS_MEMBER, []); | 6635 reportError9(ParserErrorCode.ABSTRACT_CLASS_MEMBER, []); |
| 6512 } | 6636 } |
| 6513 if (modifiers.externalKeyword != null) { | 6637 if (modifiers.externalKeyword != null) { |
| 6514 reportError9(ParserErrorCode.EXTERNAL_FIELD, modifiers.externalKeyword, []
); | 6638 reportError10(ParserErrorCode.EXTERNAL_FIELD, modifiers.externalKeyword, [
]); |
| 6515 } | 6639 } |
| 6516 if (modifiers.factoryKeyword != null) { | 6640 if (modifiers.factoryKeyword != null) { |
| 6517 reportError9(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKey
word, []); | 6641 reportError10(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKe
yword, []); |
| 6518 } | 6642 } |
| 6519 Token staticKeyword = modifiers.staticKeyword; | 6643 Token staticKeyword = modifiers.staticKeyword; |
| 6520 Token constKeyword = modifiers.constKeyword; | 6644 Token constKeyword = modifiers.constKeyword; |
| 6521 Token finalKeyword = modifiers.finalKeyword; | 6645 Token finalKeyword = modifiers.finalKeyword; |
| 6522 Token varKeyword = modifiers.varKeyword; | 6646 Token varKeyword = modifiers.varKeyword; |
| 6523 if (constKeyword != null) { | 6647 if (constKeyword != null) { |
| 6524 if (finalKeyword != null) { | 6648 if (finalKeyword != null) { |
| 6525 reportError9(ParserErrorCode.CONST_AND_FINAL, finalKeyword, []); | 6649 reportError10(ParserErrorCode.CONST_AND_FINAL, finalKeyword, []); |
| 6526 } | 6650 } |
| 6527 if (varKeyword != null) { | 6651 if (varKeyword != null) { |
| 6528 reportError9(ParserErrorCode.CONST_AND_VAR, varKeyword, []); | 6652 reportError10(ParserErrorCode.CONST_AND_VAR, varKeyword, []); |
| 6529 } | 6653 } |
| 6530 if (staticKeyword != null && constKeyword.offset < staticKeyword.offset) { | 6654 if (staticKeyword != null && constKeyword.offset < staticKeyword.offset) { |
| 6531 reportError9(ParserErrorCode.STATIC_AFTER_CONST, staticKeyword, []); | 6655 reportError10(ParserErrorCode.STATIC_AFTER_CONST, staticKeyword, []); |
| 6532 } | 6656 } |
| 6533 } else if (finalKeyword != null) { | 6657 } else if (finalKeyword != null) { |
| 6534 if (varKeyword != null) { | 6658 if (varKeyword != null) { |
| 6535 reportError9(ParserErrorCode.FINAL_AND_VAR, varKeyword, []); | 6659 reportError10(ParserErrorCode.FINAL_AND_VAR, varKeyword, []); |
| 6536 } | 6660 } |
| 6537 if (staticKeyword != null && finalKeyword.offset < staticKeyword.offset) { | 6661 if (staticKeyword != null && finalKeyword.offset < staticKeyword.offset) { |
| 6538 reportError9(ParserErrorCode.STATIC_AFTER_FINAL, staticKeyword, []); | 6662 reportError10(ParserErrorCode.STATIC_AFTER_FINAL, staticKeyword, []); |
| 6539 } | 6663 } |
| 6540 } else if (varKeyword != null && staticKeyword != null && varKeyword.offset
< staticKeyword.offset) { | 6664 } else if (varKeyword != null && staticKeyword != null && varKeyword.offset
< staticKeyword.offset) { |
| 6541 reportError9(ParserErrorCode.STATIC_AFTER_VAR, staticKeyword, []); | 6665 reportError10(ParserErrorCode.STATIC_AFTER_VAR, staticKeyword, []); |
| 6542 } | 6666 } |
| 6543 return lexicallyFirst([constKeyword, finalKeyword, varKeyword]); | 6667 return lexicallyFirst([constKeyword, finalKeyword, varKeyword]); |
| 6544 } | 6668 } |
| 6545 | 6669 |
| 6546 /** | 6670 /** |
| 6547 * Validate that the given set of modifiers is appropriate for a local functio
n. | 6671 * Validate that the given set of modifiers is appropriate for a local functio
n. |
| 6548 * | 6672 * |
| 6549 * @param modifiers the modifiers being validated | 6673 * @param modifiers the modifiers being validated |
| 6550 */ | 6674 */ |
| 6551 void validateModifiersForFunctionDeclarationStatement(Modifiers modifiers) { | 6675 void validateModifiersForFunctionDeclarationStatement(Modifiers modifiers) { |
| 6552 if (modifiers.abstractKeyword != null || modifiers.constKeyword != null || m
odifiers.externalKeyword != null || modifiers.factoryKeyword != null || modifier
s.finalKeyword != null || modifiers.staticKeyword != null || modifiers.varKeywor
d != null) { | 6676 if (modifiers.abstractKeyword != null || modifiers.constKeyword != null || m
odifiers.externalKeyword != null || modifiers.factoryKeyword != null || modifier
s.finalKeyword != null || modifiers.staticKeyword != null || modifiers.varKeywor
d != null) { |
| 6553 reportError8(ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER, []); | 6677 reportError9(ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER, []); |
| 6554 } | 6678 } |
| 6555 } | 6679 } |
| 6556 | 6680 |
| 6557 /** | 6681 /** |
| 6558 * Validate that the given set of modifiers is appropriate for a getter, sette
r, or method. | 6682 * Validate that the given set of modifiers is appropriate for a getter, sette
r, or method. |
| 6559 * | 6683 * |
| 6560 * @param modifiers the modifiers being validated | 6684 * @param modifiers the modifiers being validated |
| 6561 */ | 6685 */ |
| 6562 void validateModifiersForGetterOrSetterOrMethod(Modifiers modifiers) { | 6686 void validateModifiersForGetterOrSetterOrMethod(Modifiers modifiers) { |
| 6563 if (modifiers.abstractKeyword != null) { | 6687 if (modifiers.abstractKeyword != null) { |
| 6564 reportError8(ParserErrorCode.ABSTRACT_CLASS_MEMBER, []); | 6688 reportError9(ParserErrorCode.ABSTRACT_CLASS_MEMBER, []); |
| 6565 } | 6689 } |
| 6566 if (modifiers.constKeyword != null) { | 6690 if (modifiers.constKeyword != null) { |
| 6567 reportError9(ParserErrorCode.CONST_METHOD, modifiers.constKeyword, []); | 6691 reportError10(ParserErrorCode.CONST_METHOD, modifiers.constKeyword, []); |
| 6568 } | 6692 } |
| 6569 if (modifiers.factoryKeyword != null) { | 6693 if (modifiers.factoryKeyword != null) { |
| 6570 reportError9(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKey
word, []); | 6694 reportError10(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKe
yword, []); |
| 6571 } | 6695 } |
| 6572 if (modifiers.finalKeyword != null) { | 6696 if (modifiers.finalKeyword != null) { |
| 6573 reportError9(ParserErrorCode.FINAL_METHOD, modifiers.finalKeyword, []); | 6697 reportError10(ParserErrorCode.FINAL_METHOD, modifiers.finalKeyword, []); |
| 6574 } | 6698 } |
| 6575 if (modifiers.varKeyword != null) { | 6699 if (modifiers.varKeyword != null) { |
| 6576 reportError9(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword, []); | 6700 reportError10(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword, []); |
| 6577 } | 6701 } |
| 6578 Token externalKeyword = modifiers.externalKeyword; | 6702 Token externalKeyword = modifiers.externalKeyword; |
| 6579 Token staticKeyword = modifiers.staticKeyword; | 6703 Token staticKeyword = modifiers.staticKeyword; |
| 6580 if (externalKeyword != null && staticKeyword != null && staticKeyword.offset
< externalKeyword.offset) { | 6704 if (externalKeyword != null && staticKeyword != null && staticKeyword.offset
< externalKeyword.offset) { |
| 6581 reportError9(ParserErrorCode.EXTERNAL_AFTER_STATIC, externalKeyword, []); | 6705 reportError10(ParserErrorCode.EXTERNAL_AFTER_STATIC, externalKeyword, []); |
| 6582 } | 6706 } |
| 6583 } | 6707 } |
| 6584 | 6708 |
| 6585 /** | 6709 /** |
| 6586 * Validate that the given set of modifiers is appropriate for a getter, sette
r, or method. | 6710 * Validate that the given set of modifiers is appropriate for a getter, sette
r, or method. |
| 6587 * | 6711 * |
| 6588 * @param modifiers the modifiers being validated | 6712 * @param modifiers the modifiers being validated |
| 6589 */ | 6713 */ |
| 6590 void validateModifiersForOperator(Modifiers modifiers) { | 6714 void validateModifiersForOperator(Modifiers modifiers) { |
| 6591 if (modifiers.abstractKeyword != null) { | 6715 if (modifiers.abstractKeyword != null) { |
| 6592 reportError8(ParserErrorCode.ABSTRACT_CLASS_MEMBER, []); | 6716 reportError9(ParserErrorCode.ABSTRACT_CLASS_MEMBER, []); |
| 6593 } | 6717 } |
| 6594 if (modifiers.constKeyword != null) { | 6718 if (modifiers.constKeyword != null) { |
| 6595 reportError9(ParserErrorCode.CONST_METHOD, modifiers.constKeyword, []); | 6719 reportError10(ParserErrorCode.CONST_METHOD, modifiers.constKeyword, []); |
| 6596 } | 6720 } |
| 6597 if (modifiers.factoryKeyword != null) { | 6721 if (modifiers.factoryKeyword != null) { |
| 6598 reportError9(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKey
word, []); | 6722 reportError10(ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKe
yword, []); |
| 6599 } | 6723 } |
| 6600 if (modifiers.finalKeyword != null) { | 6724 if (modifiers.finalKeyword != null) { |
| 6601 reportError9(ParserErrorCode.FINAL_METHOD, modifiers.finalKeyword, []); | 6725 reportError10(ParserErrorCode.FINAL_METHOD, modifiers.finalKeyword, []); |
| 6602 } | 6726 } |
| 6603 if (modifiers.staticKeyword != null) { | 6727 if (modifiers.staticKeyword != null) { |
| 6604 reportError9(ParserErrorCode.STATIC_OPERATOR, modifiers.staticKeyword, [])
; | 6728 reportError10(ParserErrorCode.STATIC_OPERATOR, modifiers.staticKeyword, []
); |
| 6605 } | 6729 } |
| 6606 if (modifiers.varKeyword != null) { | 6730 if (modifiers.varKeyword != null) { |
| 6607 reportError9(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword, []); | 6731 reportError10(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword, []); |
| 6608 } | 6732 } |
| 6609 } | 6733 } |
| 6610 | 6734 |
| 6611 /** | 6735 /** |
| 6612 * Validate that the given set of modifiers is appropriate for a top-level dec
laration. | 6736 * Validate that the given set of modifiers is appropriate for a top-level dec
laration. |
| 6613 * | 6737 * |
| 6614 * @param modifiers the modifiers being validated | 6738 * @param modifiers the modifiers being validated |
| 6615 */ | 6739 */ |
| 6616 void validateModifiersForTopLevelDeclaration(Modifiers modifiers) { | 6740 void validateModifiersForTopLevelDeclaration(Modifiers modifiers) { |
| 6617 if (modifiers.factoryKeyword != null) { | 6741 if (modifiers.factoryKeyword != null) { |
| 6618 reportError9(ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION, modifiers.fact
oryKeyword, []); | 6742 reportError10(ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION, modifiers.fac
toryKeyword, []); |
| 6619 } | 6743 } |
| 6620 if (modifiers.staticKeyword != null) { | 6744 if (modifiers.staticKeyword != null) { |
| 6621 reportError9(ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION, modifiers.stati
cKeyword, []); | 6745 reportError10(ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION, modifiers.stat
icKeyword, []); |
| 6622 } | 6746 } |
| 6623 } | 6747 } |
| 6624 | 6748 |
| 6625 /** | 6749 /** |
| 6626 * Validate that the given set of modifiers is appropriate for a top-level fun
ction. | 6750 * Validate that the given set of modifiers is appropriate for a top-level fun
ction. |
| 6627 * | 6751 * |
| 6628 * @param modifiers the modifiers being validated | 6752 * @param modifiers the modifiers being validated |
| 6629 */ | 6753 */ |
| 6630 void validateModifiersForTopLevelFunction(Modifiers modifiers) { | 6754 void validateModifiersForTopLevelFunction(Modifiers modifiers) { |
| 6631 validateModifiersForTopLevelDeclaration(modifiers); | 6755 validateModifiersForTopLevelDeclaration(modifiers); |
| 6632 if (modifiers.abstractKeyword != null) { | 6756 if (modifiers.abstractKeyword != null) { |
| 6633 reportError8(ParserErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION, []); | 6757 reportError9(ParserErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION, []); |
| 6634 } | 6758 } |
| 6635 if (modifiers.constKeyword != null) { | 6759 if (modifiers.constKeyword != null) { |
| 6636 reportError9(ParserErrorCode.CONST_CLASS, modifiers.constKeyword, []); | 6760 reportError10(ParserErrorCode.CONST_CLASS, modifiers.constKeyword, []); |
| 6637 } | 6761 } |
| 6638 if (modifiers.finalKeyword != null) { | 6762 if (modifiers.finalKeyword != null) { |
| 6639 reportError9(ParserErrorCode.FINAL_CLASS, modifiers.finalKeyword, []); | 6763 reportError10(ParserErrorCode.FINAL_CLASS, modifiers.finalKeyword, []); |
| 6640 } | 6764 } |
| 6641 if (modifiers.varKeyword != null) { | 6765 if (modifiers.varKeyword != null) { |
| 6642 reportError9(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword, []); | 6766 reportError10(ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword, []); |
| 6643 } | 6767 } |
| 6644 } | 6768 } |
| 6645 | 6769 |
| 6646 /** | 6770 /** |
| 6647 * Validate that the given set of modifiers is appropriate for a field and ret
urn the 'final', | 6771 * Validate that the given set of modifiers is appropriate for a field and ret
urn the 'final', |
| 6648 * 'const' or 'var' keyword if there is one. | 6772 * 'const' or 'var' keyword if there is one. |
| 6649 * | 6773 * |
| 6650 * @param modifiers the modifiers being validated | 6774 * @param modifiers the modifiers being validated |
| 6651 * @return the 'final', 'const' or 'var' keyword associated with the field | 6775 * @return the 'final', 'const' or 'var' keyword associated with the field |
| 6652 */ | 6776 */ |
| 6653 Token validateModifiersForTopLevelVariable(Modifiers modifiers) { | 6777 Token validateModifiersForTopLevelVariable(Modifiers modifiers) { |
| 6654 validateModifiersForTopLevelDeclaration(modifiers); | 6778 validateModifiersForTopLevelDeclaration(modifiers); |
| 6655 if (modifiers.abstractKeyword != null) { | 6779 if (modifiers.abstractKeyword != null) { |
| 6656 reportError8(ParserErrorCode.ABSTRACT_TOP_LEVEL_VARIABLE, []); | 6780 reportError9(ParserErrorCode.ABSTRACT_TOP_LEVEL_VARIABLE, []); |
| 6657 } | 6781 } |
| 6658 if (modifiers.externalKeyword != null) { | 6782 if (modifiers.externalKeyword != null) { |
| 6659 reportError9(ParserErrorCode.EXTERNAL_FIELD, modifiers.externalKeyword, []
); | 6783 reportError10(ParserErrorCode.EXTERNAL_FIELD, modifiers.externalKeyword, [
]); |
| 6660 } | 6784 } |
| 6661 Token constKeyword = modifiers.constKeyword; | 6785 Token constKeyword = modifiers.constKeyword; |
| 6662 Token finalKeyword = modifiers.finalKeyword; | 6786 Token finalKeyword = modifiers.finalKeyword; |
| 6663 Token varKeyword = modifiers.varKeyword; | 6787 Token varKeyword = modifiers.varKeyword; |
| 6664 if (constKeyword != null) { | 6788 if (constKeyword != null) { |
| 6665 if (finalKeyword != null) { | 6789 if (finalKeyword != null) { |
| 6666 reportError9(ParserErrorCode.CONST_AND_FINAL, finalKeyword, []); | 6790 reportError10(ParserErrorCode.CONST_AND_FINAL, finalKeyword, []); |
| 6667 } | 6791 } |
| 6668 if (varKeyword != null) { | 6792 if (varKeyword != null) { |
| 6669 reportError9(ParserErrorCode.CONST_AND_VAR, varKeyword, []); | 6793 reportError10(ParserErrorCode.CONST_AND_VAR, varKeyword, []); |
| 6670 } | 6794 } |
| 6671 } else if (finalKeyword != null) { | 6795 } else if (finalKeyword != null) { |
| 6672 if (varKeyword != null) { | 6796 if (varKeyword != null) { |
| 6673 reportError9(ParserErrorCode.FINAL_AND_VAR, varKeyword, []); | 6797 reportError10(ParserErrorCode.FINAL_AND_VAR, varKeyword, []); |
| 6674 } | 6798 } |
| 6675 } | 6799 } |
| 6676 return lexicallyFirst([constKeyword, finalKeyword, varKeyword]); | 6800 return lexicallyFirst([constKeyword, finalKeyword, varKeyword]); |
| 6677 } | 6801 } |
| 6678 | 6802 |
| 6679 /** | 6803 /** |
| 6680 * Validate that the given set of modifiers is appropriate for a class and ret
urn the 'abstract' | 6804 * Validate that the given set of modifiers is appropriate for a class and ret
urn the 'abstract' |
| 6681 * keyword if there is one. | 6805 * keyword if there is one. |
| 6682 * | 6806 * |
| 6683 * @param modifiers the modifiers being validated | 6807 * @param modifiers the modifiers being validated |
| 6684 */ | 6808 */ |
| 6685 void validateModifiersForTypedef(Modifiers modifiers) { | 6809 void validateModifiersForTypedef(Modifiers modifiers) { |
| 6686 validateModifiersForTopLevelDeclaration(modifiers); | 6810 validateModifiersForTopLevelDeclaration(modifiers); |
| 6687 if (modifiers.abstractKeyword != null) { | 6811 if (modifiers.abstractKeyword != null) { |
| 6688 reportError9(ParserErrorCode.ABSTRACT_TYPEDEF, modifiers.abstractKeyword,
[]); | 6812 reportError10(ParserErrorCode.ABSTRACT_TYPEDEF, modifiers.abstractKeyword,
[]); |
| 6689 } | 6813 } |
| 6690 if (modifiers.constKeyword != null) { | 6814 if (modifiers.constKeyword != null) { |
| 6691 reportError9(ParserErrorCode.CONST_TYPEDEF, modifiers.constKeyword, []); | 6815 reportError10(ParserErrorCode.CONST_TYPEDEF, modifiers.constKeyword, []); |
| 6692 } | 6816 } |
| 6693 if (modifiers.externalKeyword != null) { | 6817 if (modifiers.externalKeyword != null) { |
| 6694 reportError9(ParserErrorCode.EXTERNAL_TYPEDEF, modifiers.externalKeyword,
[]); | 6818 reportError10(ParserErrorCode.EXTERNAL_TYPEDEF, modifiers.externalKeyword,
[]); |
| 6695 } | 6819 } |
| 6696 if (modifiers.finalKeyword != null) { | 6820 if (modifiers.finalKeyword != null) { |
| 6697 reportError9(ParserErrorCode.FINAL_TYPEDEF, modifiers.finalKeyword, []); | 6821 reportError10(ParserErrorCode.FINAL_TYPEDEF, modifiers.finalKeyword, []); |
| 6698 } | 6822 } |
| 6699 if (modifiers.varKeyword != null) { | 6823 if (modifiers.varKeyword != null) { |
| 6700 reportError9(ParserErrorCode.VAR_TYPEDEF, modifiers.varKeyword, []); | 6824 reportError10(ParserErrorCode.VAR_TYPEDEF, modifiers.varKeyword, []); |
| 6701 } | 6825 } |
| 6702 } | 6826 } |
| 6703 } | 6827 } |
| 6828 |
| 6704 /** | 6829 /** |
| 6705 * Instances of the class `SyntheticKeywordToken` implement a synthetic keyword
token. | 6830 * Instances of the class `SyntheticKeywordToken` implement a synthetic keyword
token. |
| 6706 */ | 6831 */ |
| 6707 class Parser_SyntheticKeywordToken extends KeywordToken { | 6832 class Parser_SyntheticKeywordToken extends KeywordToken { |
| 6708 | |
| 6709 /** | 6833 /** |
| 6710 * Initialize a newly created token to represent the given keyword. | 6834 * Initialize a newly created token to represent the given keyword. |
| 6711 * | 6835 * |
| 6712 * @param keyword the keyword being represented by this token | 6836 * @param keyword the keyword being represented by this token |
| 6713 * @param offset the offset from the beginning of the file to the first charac
ter in the token | 6837 * @param offset the offset from the beginning of the file to the first charac
ter in the token |
| 6714 */ | 6838 */ |
| 6715 Parser_SyntheticKeywordToken(Keyword keyword, int offset) : super(keyword, off
set); | 6839 Parser_SyntheticKeywordToken(Keyword keyword, int offset) : super(keyword, off
set); |
| 6840 |
| 6716 Token copy() => new Parser_SyntheticKeywordToken(keyword, offset); | 6841 Token copy() => new Parser_SyntheticKeywordToken(keyword, offset); |
| 6842 |
| 6717 int get length => 0; | 6843 int get length => 0; |
| 6718 } | 6844 } |
| 6719 class AnalysisErrorListener_15 implements AnalysisErrorListener { | 6845 |
| 6846 class AnalysisErrorListener_16 implements AnalysisErrorListener { |
| 6720 List<bool> errorFound; | 6847 List<bool> errorFound; |
| 6721 AnalysisErrorListener_15(this.errorFound); | 6848 |
| 6849 AnalysisErrorListener_16(this.errorFound); |
| 6850 |
| 6722 void onError(AnalysisError error) { | 6851 void onError(AnalysisError error) { |
| 6723 errorFound[0] = true; | 6852 errorFound[0] = true; |
| 6724 } | 6853 } |
| 6725 } | 6854 } |
| 6855 |
| 6726 /** | 6856 /** |
| 6727 * The enumeration `ParserErrorCode` defines the error codes used for errors det
ected by the | 6857 * The enumeration `ParserErrorCode` defines the error codes used for errors det
ected by the |
| 6728 * parser. The convention for this class is for the name of the error code to in
dicate the problem | 6858 * parser. The convention for this class is for the name of the error code to in
dicate the problem |
| 6729 * that caused the error to be generated and for the error message to explain wh
at is wrong and, | 6859 * that caused the error to be generated and for the error message to explain wh
at is wrong and, |
| 6730 * when appropriate, how the problem can be corrected. | 6860 * when appropriate, how the problem can be corrected. |
| 6731 * | 6861 * |
| 6732 * @coverage dart.engine.parser | 6862 * @coverage dart.engine.parser |
| 6733 */ | 6863 */ |
| 6734 class ParserErrorCode extends Enum<ParserErrorCode> implements ErrorCode { | 6864 class ParserErrorCode extends Enum<ParserErrorCode> implements ErrorCode { |
| 6735 static final ParserErrorCode ABSTRACT_CLASS_MEMBER = new ParserErrorCode.con3(
'ABSTRACT_CLASS_MEMBER', 0, "Members of classes cannot be declared to be 'abstra
ct'"); | 6865 static final ParserErrorCode ABSTRACT_CLASS_MEMBER = new ParserErrorCode.con3(
'ABSTRACT_CLASS_MEMBER', 0, "Members of classes cannot be declared to be 'abstra
ct'"); |
| 6866 |
| 6736 static final ParserErrorCode ABSTRACT_STATIC_METHOD = new ParserErrorCode.con3
('ABSTRACT_STATIC_METHOD', 1, "Static methods cannot be declared to be 'abstract
'"); | 6867 static final ParserErrorCode ABSTRACT_STATIC_METHOD = new ParserErrorCode.con3
('ABSTRACT_STATIC_METHOD', 1, "Static methods cannot be declared to be 'abstract
'"); |
| 6868 |
| 6737 static final ParserErrorCode ABSTRACT_TOP_LEVEL_FUNCTION = new ParserErrorCode
.con3('ABSTRACT_TOP_LEVEL_FUNCTION', 2, "Top-level functions cannot be declared
to be 'abstract'"); | 6869 static final ParserErrorCode ABSTRACT_TOP_LEVEL_FUNCTION = new ParserErrorCode
.con3('ABSTRACT_TOP_LEVEL_FUNCTION', 2, "Top-level functions cannot be declared
to be 'abstract'"); |
| 6870 |
| 6738 static final ParserErrorCode ABSTRACT_TOP_LEVEL_VARIABLE = new ParserErrorCode
.con3('ABSTRACT_TOP_LEVEL_VARIABLE', 3, "Top-level variables cannot be declared
to be 'abstract'"); | 6871 static final ParserErrorCode ABSTRACT_TOP_LEVEL_VARIABLE = new ParserErrorCode
.con3('ABSTRACT_TOP_LEVEL_VARIABLE', 3, "Top-level variables cannot be declared
to be 'abstract'"); |
| 6872 |
| 6739 static final ParserErrorCode ABSTRACT_TYPEDEF = new ParserErrorCode.con3('ABST
RACT_TYPEDEF', 4, "Type aliases cannot be declared to be 'abstract'"); | 6873 static final ParserErrorCode ABSTRACT_TYPEDEF = new ParserErrorCode.con3('ABST
RACT_TYPEDEF', 4, "Type aliases cannot be declared to be 'abstract'"); |
| 6874 |
| 6740 static final ParserErrorCode ASSERT_DOES_NOT_TAKE_ASSIGNMENT = new ParserError
Code.con3('ASSERT_DOES_NOT_TAKE_ASSIGNMENT', 5, "Assert cannot be called on an a
ssignment"); | 6875 static final ParserErrorCode ASSERT_DOES_NOT_TAKE_ASSIGNMENT = new ParserError
Code.con3('ASSERT_DOES_NOT_TAKE_ASSIGNMENT', 5, "Assert cannot be called on an a
ssignment"); |
| 6876 |
| 6741 static final ParserErrorCode ASSERT_DOES_NOT_TAKE_CASCADE = new ParserErrorCod
e.con3('ASSERT_DOES_NOT_TAKE_CASCADE', 6, "Assert cannot be called on cascade"); | 6877 static final ParserErrorCode ASSERT_DOES_NOT_TAKE_CASCADE = new ParserErrorCod
e.con3('ASSERT_DOES_NOT_TAKE_CASCADE', 6, "Assert cannot be called on cascade"); |
| 6878 |
| 6742 static final ParserErrorCode ASSERT_DOES_NOT_TAKE_THROW = new ParserErrorCode.
con3('ASSERT_DOES_NOT_TAKE_THROW', 7, "Assert cannot be called on throws"); | 6879 static final ParserErrorCode ASSERT_DOES_NOT_TAKE_THROW = new ParserErrorCode.
con3('ASSERT_DOES_NOT_TAKE_THROW', 7, "Assert cannot be called on throws"); |
| 6880 |
| 6743 static final ParserErrorCode ASSERT_DOES_NOT_TAKE_RETHROW = new ParserErrorCod
e.con3('ASSERT_DOES_NOT_TAKE_RETHROW', 8, "Assert cannot be called on rethrows")
; | 6881 static final ParserErrorCode ASSERT_DOES_NOT_TAKE_RETHROW = new ParserErrorCod
e.con3('ASSERT_DOES_NOT_TAKE_RETHROW', 8, "Assert cannot be called on rethrows")
; |
| 6882 |
| 6744 static final ParserErrorCode BREAK_OUTSIDE_OF_LOOP = new ParserErrorCode.con3(
'BREAK_OUTSIDE_OF_LOOP', 9, "A break statement cannot be used outside of a loop
or switch statement"); | 6883 static final ParserErrorCode BREAK_OUTSIDE_OF_LOOP = new ParserErrorCode.con3(
'BREAK_OUTSIDE_OF_LOOP', 9, "A break statement cannot be used outside of a loop
or switch statement"); |
| 6884 |
| 6745 static final ParserErrorCode CONST_AND_FINAL = new ParserErrorCode.con3('CONST
_AND_FINAL', 10, "Members cannot be declared to be both 'const' and 'final'"); | 6885 static final ParserErrorCode CONST_AND_FINAL = new ParserErrorCode.con3('CONST
_AND_FINAL', 10, "Members cannot be declared to be both 'const' and 'final'"); |
| 6886 |
| 6746 static final ParserErrorCode CONST_AND_VAR = new ParserErrorCode.con3('CONST_A
ND_VAR', 11, "Members cannot be declared to be both 'const' and 'var'"); | 6887 static final ParserErrorCode CONST_AND_VAR = new ParserErrorCode.con3('CONST_A
ND_VAR', 11, "Members cannot be declared to be both 'const' and 'var'"); |
| 6888 |
| 6747 static final ParserErrorCode CONST_CLASS = new ParserErrorCode.con3('CONST_CLA
SS', 12, "Classes cannot be declared to be 'const'"); | 6889 static final ParserErrorCode CONST_CLASS = new ParserErrorCode.con3('CONST_CLA
SS', 12, "Classes cannot be declared to be 'const'"); |
| 6890 |
| 6748 static final ParserErrorCode CONST_CONSTRUCTOR_WITH_BODY = new ParserErrorCode
.con3('CONST_CONSTRUCTOR_WITH_BODY', 13, "'const' constructors cannot have a bod
y"); | 6891 static final ParserErrorCode CONST_CONSTRUCTOR_WITH_BODY = new ParserErrorCode
.con3('CONST_CONSTRUCTOR_WITH_BODY', 13, "'const' constructors cannot have a bod
y"); |
| 6892 |
| 6749 static final ParserErrorCode CONST_FACTORY = new ParserErrorCode.con3('CONST_F
ACTORY', 14, "Only redirecting factory constructors can be declared to be 'const
'"); | 6893 static final ParserErrorCode CONST_FACTORY = new ParserErrorCode.con3('CONST_F
ACTORY', 14, "Only redirecting factory constructors can be declared to be 'const
'"); |
| 6894 |
| 6750 static final ParserErrorCode CONST_METHOD = new ParserErrorCode.con3('CONST_ME
THOD', 15, "Getters, setters and methods cannot be declared to be 'const'"); | 6895 static final ParserErrorCode CONST_METHOD = new ParserErrorCode.con3('CONST_ME
THOD', 15, "Getters, setters and methods cannot be declared to be 'const'"); |
| 6896 |
| 6751 static final ParserErrorCode CONST_TYPEDEF = new ParserErrorCode.con3('CONST_T
YPEDEF', 16, "Type aliases cannot be declared to be 'const'"); | 6897 static final ParserErrorCode CONST_TYPEDEF = new ParserErrorCode.con3('CONST_T
YPEDEF', 16, "Type aliases cannot be declared to be 'const'"); |
| 6898 |
| 6752 static final ParserErrorCode CONSTRUCTOR_WITH_RETURN_TYPE = new ParserErrorCod
e.con3('CONSTRUCTOR_WITH_RETURN_TYPE', 17, "Constructors cannot have a return ty
pe"); | 6899 static final ParserErrorCode CONSTRUCTOR_WITH_RETURN_TYPE = new ParserErrorCod
e.con3('CONSTRUCTOR_WITH_RETURN_TYPE', 17, "Constructors cannot have a return ty
pe"); |
| 6900 |
| 6753 static final ParserErrorCode CONTINUE_OUTSIDE_OF_LOOP = new ParserErrorCode.co
n3('CONTINUE_OUTSIDE_OF_LOOP', 18, "A continue statement cannot be used outside
of a loop or switch statement"); | 6901 static final ParserErrorCode CONTINUE_OUTSIDE_OF_LOOP = new ParserErrorCode.co
n3('CONTINUE_OUTSIDE_OF_LOOP', 18, "A continue statement cannot be used outside
of a loop or switch statement"); |
| 6902 |
| 6754 static final ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE = new ParserErrorC
ode.con3('CONTINUE_WITHOUT_LABEL_IN_CASE', 19, "A continue statement in a switch
statement must have a label as a target"); | 6903 static final ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE = new ParserErrorC
ode.con3('CONTINUE_WITHOUT_LABEL_IN_CASE', 19, "A continue statement in a switch
statement must have a label as a target"); |
| 6904 |
| 6755 static final ParserErrorCode DEPRECATED_ARGUMENT_DEFINITION_TEST = new ParserE
rrorCode.con3('DEPRECATED_ARGUMENT_DEFINITION_TEST', 20, "The argument definitio
n test ('?' operator) has been deprecated"); | 6905 static final ParserErrorCode DEPRECATED_ARGUMENT_DEFINITION_TEST = new ParserE
rrorCode.con3('DEPRECATED_ARGUMENT_DEFINITION_TEST', 20, "The argument definitio
n test ('?' operator) has been deprecated"); |
| 6906 |
| 6756 static final ParserErrorCode DEPRECATED_CLASS_TYPE_ALIAS = new ParserErrorCode
.con3('DEPRECATED_CLASS_TYPE_ALIAS', 21, "The 'typedef' mixin application was re
placed with 'class'"); | 6907 static final ParserErrorCode DEPRECATED_CLASS_TYPE_ALIAS = new ParserErrorCode
.con3('DEPRECATED_CLASS_TYPE_ALIAS', 21, "The 'typedef' mixin application was re
placed with 'class'"); |
| 6908 |
| 6757 static final ParserErrorCode DIRECTIVE_AFTER_DECLARATION = new ParserErrorCode
.con3('DIRECTIVE_AFTER_DECLARATION', 22, "Directives must appear before any decl
arations"); | 6909 static final ParserErrorCode DIRECTIVE_AFTER_DECLARATION = new ParserErrorCode
.con3('DIRECTIVE_AFTER_DECLARATION', 22, "Directives must appear before any decl
arations"); |
| 6910 |
| 6758 static final ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT = new ParserE
rrorCode.con3('DUPLICATE_LABEL_IN_SWITCH_STATEMENT', 23, "The label %s was alrea
dy used in this switch statement"); | 6911 static final ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT = new ParserE
rrorCode.con3('DUPLICATE_LABEL_IN_SWITCH_STATEMENT', 23, "The label %s was alrea
dy used in this switch statement"); |
| 6912 |
| 6759 static final ParserErrorCode DUPLICATED_MODIFIER = new ParserErrorCode.con3('D
UPLICATED_MODIFIER', 24, "The modifier '%s' was already specified."); | 6913 static final ParserErrorCode DUPLICATED_MODIFIER = new ParserErrorCode.con3('D
UPLICATED_MODIFIER', 24, "The modifier '%s' was already specified."); |
| 6914 |
| 6760 static final ParserErrorCode EQUALITY_CANNOT_BE_EQUALITY_OPERAND = new ParserE
rrorCode.con3('EQUALITY_CANNOT_BE_EQUALITY_OPERAND', 25, "Equality expression ca
nnot be operand of another equality expression."); | 6915 static final ParserErrorCode EQUALITY_CANNOT_BE_EQUALITY_OPERAND = new ParserE
rrorCode.con3('EQUALITY_CANNOT_BE_EQUALITY_OPERAND', 25, "Equality expression ca
nnot be operand of another equality expression."); |
| 6916 |
| 6761 static final ParserErrorCode EXPECTED_CASE_OR_DEFAULT = new ParserErrorCode.co
n3('EXPECTED_CASE_OR_DEFAULT', 26, "Expected 'case' or 'default'"); | 6917 static final ParserErrorCode EXPECTED_CASE_OR_DEFAULT = new ParserErrorCode.co
n3('EXPECTED_CASE_OR_DEFAULT', 26, "Expected 'case' or 'default'"); |
| 6918 |
| 6762 static final ParserErrorCode EXPECTED_CLASS_MEMBER = new ParserErrorCode.con3(
'EXPECTED_CLASS_MEMBER', 27, "Expected a class member"); | 6919 static final ParserErrorCode EXPECTED_CLASS_MEMBER = new ParserErrorCode.con3(
'EXPECTED_CLASS_MEMBER', 27, "Expected a class member"); |
| 6920 |
| 6763 static final ParserErrorCode EXPECTED_EXECUTABLE = new ParserErrorCode.con3('E
XPECTED_EXECUTABLE', 28, "Expected a method, getter, setter or operator declarat
ion"); | 6921 static final ParserErrorCode EXPECTED_EXECUTABLE = new ParserErrorCode.con3('E
XPECTED_EXECUTABLE', 28, "Expected a method, getter, setter or operator declarat
ion"); |
| 6922 |
| 6764 static final ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL = new ParserErrorCod
e.con3('EXPECTED_LIST_OR_MAP_LITERAL', 29, "Expected a list or map literal"); | 6923 static final ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL = new ParserErrorCod
e.con3('EXPECTED_LIST_OR_MAP_LITERAL', 29, "Expected a list or map literal"); |
| 6924 |
| 6765 static final ParserErrorCode EXPECTED_STRING_LITERAL = new ParserErrorCode.con
3('EXPECTED_STRING_LITERAL', 30, "Expected a string literal"); | 6925 static final ParserErrorCode EXPECTED_STRING_LITERAL = new ParserErrorCode.con
3('EXPECTED_STRING_LITERAL', 30, "Expected a string literal"); |
| 6926 |
| 6766 static final ParserErrorCode EXPECTED_TOKEN = new ParserErrorCode.con3('EXPECT
ED_TOKEN', 31, "Expected to find '%s'"); | 6927 static final ParserErrorCode EXPECTED_TOKEN = new ParserErrorCode.con3('EXPECT
ED_TOKEN', 31, "Expected to find '%s'"); |
| 6928 |
| 6767 static final ParserErrorCode EXPECTED_TYPE_NAME = new ParserErrorCode.con3('EX
PECTED_TYPE_NAME', 32, "Expected a type name"); | 6929 static final ParserErrorCode EXPECTED_TYPE_NAME = new ParserErrorCode.con3('EX
PECTED_TYPE_NAME', 32, "Expected a type name"); |
| 6930 |
| 6768 static final ParserErrorCode EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new Parse
rErrorCode.con3('EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 33, "Export directives
must preceed part directives"); | 6931 static final ParserErrorCode EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new Parse
rErrorCode.con3('EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 33, "Export directives
must preceed part directives"); |
| 6932 |
| 6769 static final ParserErrorCode EXTERNAL_AFTER_CONST = new ParserErrorCode.con3('
EXTERNAL_AFTER_CONST', 34, "The modifier 'external' should be before the modifie
r 'const'"); | 6933 static final ParserErrorCode EXTERNAL_AFTER_CONST = new ParserErrorCode.con3('
EXTERNAL_AFTER_CONST', 34, "The modifier 'external' should be before the modifie
r 'const'"); |
| 6934 |
| 6770 static final ParserErrorCode EXTERNAL_AFTER_FACTORY = new ParserErrorCode.con3
('EXTERNAL_AFTER_FACTORY', 35, "The modifier 'external' should be before the mod
ifier 'factory'"); | 6935 static final ParserErrorCode EXTERNAL_AFTER_FACTORY = new ParserErrorCode.con3
('EXTERNAL_AFTER_FACTORY', 35, "The modifier 'external' should be before the mod
ifier 'factory'"); |
| 6936 |
| 6771 static final ParserErrorCode EXTERNAL_AFTER_STATIC = new ParserErrorCode.con3(
'EXTERNAL_AFTER_STATIC', 36, "The modifier 'external' should be before the modif
ier 'static'"); | 6937 static final ParserErrorCode EXTERNAL_AFTER_STATIC = new ParserErrorCode.con3(
'EXTERNAL_AFTER_STATIC', 36, "The modifier 'external' should be before the modif
ier 'static'"); |
| 6938 |
| 6772 static final ParserErrorCode EXTERNAL_CLASS = new ParserErrorCode.con3('EXTERN
AL_CLASS', 37, "Classes cannot be declared to be 'external'"); | 6939 static final ParserErrorCode EXTERNAL_CLASS = new ParserErrorCode.con3('EXTERN
AL_CLASS', 37, "Classes cannot be declared to be 'external'"); |
| 6940 |
| 6773 static final ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_BODY = new ParserErrorC
ode.con3('EXTERNAL_CONSTRUCTOR_WITH_BODY', 38, "External constructors cannot hav
e a body"); | 6941 static final ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_BODY = new ParserErrorC
ode.con3('EXTERNAL_CONSTRUCTOR_WITH_BODY', 38, "External constructors cannot hav
e a body"); |
| 6942 |
| 6774 static final ParserErrorCode EXTERNAL_FIELD = new ParserErrorCode.con3('EXTERN
AL_FIELD', 39, "Fields cannot be declared to be 'external'"); | 6943 static final ParserErrorCode EXTERNAL_FIELD = new ParserErrorCode.con3('EXTERN
AL_FIELD', 39, "Fields cannot be declared to be 'external'"); |
| 6944 |
| 6775 static final ParserErrorCode EXTERNAL_GETTER_WITH_BODY = new ParserErrorCode.c
on3('EXTERNAL_GETTER_WITH_BODY', 40, "External getters cannot have a body"); | 6945 static final ParserErrorCode EXTERNAL_GETTER_WITH_BODY = new ParserErrorCode.c
on3('EXTERNAL_GETTER_WITH_BODY', 40, "External getters cannot have a body"); |
| 6946 |
| 6776 static final ParserErrorCode EXTERNAL_METHOD_WITH_BODY = new ParserErrorCode.c
on3('EXTERNAL_METHOD_WITH_BODY', 41, "External methods cannot have a body"); | 6947 static final ParserErrorCode EXTERNAL_METHOD_WITH_BODY = new ParserErrorCode.c
on3('EXTERNAL_METHOD_WITH_BODY', 41, "External methods cannot have a body"); |
| 6948 |
| 6777 static final ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY = new ParserErrorCode
.con3('EXTERNAL_OPERATOR_WITH_BODY', 42, "External operators cannot have a body"
); | 6949 static final ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY = new ParserErrorCode
.con3('EXTERNAL_OPERATOR_WITH_BODY', 42, "External operators cannot have a body"
); |
| 6950 |
| 6778 static final ParserErrorCode EXTERNAL_SETTER_WITH_BODY = new ParserErrorCode.c
on3('EXTERNAL_SETTER_WITH_BODY', 43, "External setters cannot have a body"); | 6951 static final ParserErrorCode EXTERNAL_SETTER_WITH_BODY = new ParserErrorCode.c
on3('EXTERNAL_SETTER_WITH_BODY', 43, "External setters cannot have a body"); |
| 6952 |
| 6779 static final ParserErrorCode EXTERNAL_TYPEDEF = new ParserErrorCode.con3('EXTE
RNAL_TYPEDEF', 44, "Type aliases cannot be declared to be 'external'"); | 6953 static final ParserErrorCode EXTERNAL_TYPEDEF = new ParserErrorCode.con3('EXTE
RNAL_TYPEDEF', 44, "Type aliases cannot be declared to be 'external'"); |
| 6954 |
| 6780 static final ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION = new ParserErrorCo
de.con3('FACTORY_TOP_LEVEL_DECLARATION', 45, "Top-level declarations cannot be d
eclared to be 'factory'"); | 6955 static final ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION = new ParserErrorCo
de.con3('FACTORY_TOP_LEVEL_DECLARATION', 45, "Top-level declarations cannot be d
eclared to be 'factory'"); |
| 6956 |
| 6781 static final ParserErrorCode FACTORY_WITHOUT_BODY = new ParserErrorCode.con3('
FACTORY_WITHOUT_BODY', 46, "A non-redirecting 'factory' constructor must have a
body"); | 6957 static final ParserErrorCode FACTORY_WITHOUT_BODY = new ParserErrorCode.con3('
FACTORY_WITHOUT_BODY', 46, "A non-redirecting 'factory' constructor must have a
body"); |
| 6958 |
| 6782 static final ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new Parse
rErrorCode.con3('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 47, "Field initializers
can only be used in a constructor"); | 6959 static final ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new Parse
rErrorCode.con3('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 47, "Field initializers
can only be used in a constructor"); |
| 6960 |
| 6783 static final ParserErrorCode FINAL_AND_VAR = new ParserErrorCode.con3('FINAL_A
ND_VAR', 48, "Members cannot be declared to be both 'final' and 'var'"); | 6961 static final ParserErrorCode FINAL_AND_VAR = new ParserErrorCode.con3('FINAL_A
ND_VAR', 48, "Members cannot be declared to be both 'final' and 'var'"); |
| 6962 |
| 6784 static final ParserErrorCode FINAL_CLASS = new ParserErrorCode.con3('FINAL_CLA
SS', 49, "Classes cannot be declared to be 'final'"); | 6963 static final ParserErrorCode FINAL_CLASS = new ParserErrorCode.con3('FINAL_CLA
SS', 49, "Classes cannot be declared to be 'final'"); |
| 6964 |
| 6785 static final ParserErrorCode FINAL_CONSTRUCTOR = new ParserErrorCode.con3('FIN
AL_CONSTRUCTOR', 50, "A constructor cannot be declared to be 'final'"); | 6965 static final ParserErrorCode FINAL_CONSTRUCTOR = new ParserErrorCode.con3('FIN
AL_CONSTRUCTOR', 50, "A constructor cannot be declared to be 'final'"); |
| 6966 |
| 6786 static final ParserErrorCode FINAL_METHOD = new ParserErrorCode.con3('FINAL_ME
THOD', 51, "Getters, setters and methods cannot be declared to be 'final'"); | 6967 static final ParserErrorCode FINAL_METHOD = new ParserErrorCode.con3('FINAL_ME
THOD', 51, "Getters, setters and methods cannot be declared to be 'final'"); |
| 6968 |
| 6787 static final ParserErrorCode FINAL_TYPEDEF = new ParserErrorCode.con3('FINAL_T
YPEDEF', 52, "Type aliases cannot be declared to be 'final'"); | 6969 static final ParserErrorCode FINAL_TYPEDEF = new ParserErrorCode.con3('FINAL_T
YPEDEF', 52, "Type aliases cannot be declared to be 'final'"); |
| 6970 |
| 6788 static final ParserErrorCode FUNCTION_TYPED_PARAMETER_VAR = new ParserErrorCod
e.con3('FUNCTION_TYPED_PARAMETER_VAR', 53, "Function typed parameters cannot spe
cify 'const', 'final' or 'var' instead of return type"); | 6971 static final ParserErrorCode FUNCTION_TYPED_PARAMETER_VAR = new ParserErrorCod
e.con3('FUNCTION_TYPED_PARAMETER_VAR', 53, "Function typed parameters cannot spe
cify 'const', 'final' or 'var' instead of return type"); |
| 6972 |
| 6789 static final ParserErrorCode GETTER_IN_FUNCTION = new ParserErrorCode.con3('GE
TTER_IN_FUNCTION', 54, "Getters cannot be defined within methods or functions"); | 6973 static final ParserErrorCode GETTER_IN_FUNCTION = new ParserErrorCode.con3('GE
TTER_IN_FUNCTION', 54, "Getters cannot be defined within methods or functions"); |
| 6974 |
| 6790 static final ParserErrorCode GETTER_WITH_PARAMETERS = new ParserErrorCode.con3
('GETTER_WITH_PARAMETERS', 55, "Getter should be declared without a parameter li
st"); | 6975 static final ParserErrorCode GETTER_WITH_PARAMETERS = new ParserErrorCode.con3
('GETTER_WITH_PARAMETERS', 55, "Getter should be declared without a parameter li
st"); |
| 6976 |
| 6791 static final ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE = new Parser
ErrorCode.con3('ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', 56, "Illegal assignment t
o non-assignable expression"); | 6977 static final ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE = new Parser
ErrorCode.con3('ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', 56, "Illegal assignment t
o non-assignable expression"); |
| 6978 |
| 6792 static final ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS = new ParserErrorCode.c
on3('IMPLEMENTS_BEFORE_EXTENDS', 57, "The extends clause must be before the impl
ements clause"); | 6979 static final ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS = new ParserErrorCode.c
on3('IMPLEMENTS_BEFORE_EXTENDS', 57, "The extends clause must be before the impl
ements clause"); |
| 6980 |
| 6793 static final ParserErrorCode IMPLEMENTS_BEFORE_WITH = new ParserErrorCode.con3
('IMPLEMENTS_BEFORE_WITH', 58, "The with clause must be before the implements cl
ause"); | 6981 static final ParserErrorCode IMPLEMENTS_BEFORE_WITH = new ParserErrorCode.con3
('IMPLEMENTS_BEFORE_WITH', 58, "The with clause must be before the implements cl
ause"); |
| 6982 |
| 6794 static final ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new Parse
rErrorCode.con3('IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 59, "Import directives
must preceed part directives"); | 6983 static final ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new Parse
rErrorCode.con3('IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 59, "Import directives
must preceed part directives"); |
| 6984 |
| 6795 static final ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH = new ParserErro
rCode.con3('INITIALIZED_VARIABLE_IN_FOR_EACH', 60, "The loop variable in a for-e
ach loop cannot be initialized"); | 6985 static final ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH = new ParserErro
rCode.con3('INITIALIZED_VARIABLE_IN_FOR_EACH', 60, "The loop variable in a for-e
ach loop cannot be initialized"); |
| 6986 |
| 6796 static final ParserErrorCode INVALID_CODE_POINT = new ParserErrorCode.con3('IN
VALID_CODE_POINT', 61, "The escape sequence '%s' is not a valid code point"); | 6987 static final ParserErrorCode INVALID_CODE_POINT = new ParserErrorCode.con3('IN
VALID_CODE_POINT', 61, "The escape sequence '%s' is not a valid code point"); |
| 6988 |
| 6797 static final ParserErrorCode INVALID_COMMENT_REFERENCE = new ParserErrorCode.c
on3('INVALID_COMMENT_REFERENCE', 62, "Comment references should contain a possib
ly prefixed identifier and can start with 'new', but should not contain anything
else"); | 6989 static final ParserErrorCode INVALID_COMMENT_REFERENCE = new ParserErrorCode.c
on3('INVALID_COMMENT_REFERENCE', 62, "Comment references should contain a possib
ly prefixed identifier and can start with 'new', but should not contain anything
else"); |
| 6990 |
| 6798 static final ParserErrorCode INVALID_HEX_ESCAPE = new ParserErrorCode.con3('IN
VALID_HEX_ESCAPE', 63, "An escape sequence starting with '\\x' must be followed
by 2 hexidecimal digits"); | 6991 static final ParserErrorCode INVALID_HEX_ESCAPE = new ParserErrorCode.con3('IN
VALID_HEX_ESCAPE', 63, "An escape sequence starting with '\\x' must be followed
by 2 hexidecimal digits"); |
| 6992 |
| 6799 static final ParserErrorCode INVALID_OPERATOR = new ParserErrorCode.con3('INVA
LID_OPERATOR', 64, "The string '%s' is not a valid operator"); | 6993 static final ParserErrorCode INVALID_OPERATOR = new ParserErrorCode.con3('INVA
LID_OPERATOR', 64, "The string '%s' is not a valid operator"); |
| 6994 |
| 6800 static final ParserErrorCode INVALID_OPERATOR_FOR_SUPER = new ParserErrorCode.
con3('INVALID_OPERATOR_FOR_SUPER', 65, "The operator '%s' cannot be used with 's
uper'"); | 6995 static final ParserErrorCode INVALID_OPERATOR_FOR_SUPER = new ParserErrorCode.
con3('INVALID_OPERATOR_FOR_SUPER', 65, "The operator '%s' cannot be used with 's
uper'"); |
| 6996 |
| 6801 static final ParserErrorCode INVALID_UNICODE_ESCAPE = new ParserErrorCode.con3
('INVALID_UNICODE_ESCAPE', 66, "An escape sequence starting with '\\u' must be f
ollowed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'"); | 6997 static final ParserErrorCode INVALID_UNICODE_ESCAPE = new ParserErrorCode.con3
('INVALID_UNICODE_ESCAPE', 66, "An escape sequence starting with '\\u' must be f
ollowed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'"); |
| 6998 |
| 6802 static final ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST = new ParserErrorCode
.con3('LIBRARY_DIRECTIVE_NOT_FIRST', 67, "The library directive must appear befo
re all other directives"); | 6999 static final ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST = new ParserErrorCode
.con3('LIBRARY_DIRECTIVE_NOT_FIRST', 67, "The library directive must appear befo
re all other directives"); |
| 7000 |
| 6803 static final ParserErrorCode LOCAL_FUNCTION_DECLARATION_MODIFIER = new ParserE
rrorCode.con3('LOCAL_FUNCTION_DECLARATION_MODIFIER', 68, "Local function declara
tions cannot specify any modifier"); | 7001 static final ParserErrorCode LOCAL_FUNCTION_DECLARATION_MODIFIER = new ParserE
rrorCode.con3('LOCAL_FUNCTION_DECLARATION_MODIFIER', 68, "Local function declara
tions cannot specify any modifier"); |
| 7002 |
| 6804 static final ParserErrorCode MISSING_ASSIGNABLE_SELECTOR = new ParserErrorCode
.con3('MISSING_ASSIGNABLE_SELECTOR', 69, "Missing selector such as \".<identifie
r>\" or \"[0]\""); | 7003 static final ParserErrorCode MISSING_ASSIGNABLE_SELECTOR = new ParserErrorCode
.con3('MISSING_ASSIGNABLE_SELECTOR', 69, "Missing selector such as \".<identifie
r>\" or \"[0]\""); |
| 7004 |
| 6805 static final ParserErrorCode MISSING_CATCH_OR_FINALLY = new ParserErrorCode.co
n3('MISSING_CATCH_OR_FINALLY', 70, "A try statement must have either a catch or
finally clause"); | 7005 static final ParserErrorCode MISSING_CATCH_OR_FINALLY = new ParserErrorCode.co
n3('MISSING_CATCH_OR_FINALLY', 70, "A try statement must have either a catch or
finally clause"); |
| 7006 |
| 6806 static final ParserErrorCode MISSING_CLASS_BODY = new ParserErrorCode.con3('MI
SSING_CLASS_BODY', 71, "A class definition must have a body, even if it is empty
"); | 7007 static final ParserErrorCode MISSING_CLASS_BODY = new ParserErrorCode.con3('MI
SSING_CLASS_BODY', 71, "A class definition must have a body, even if it is empty
"); |
| 7008 |
| 6807 static final ParserErrorCode MISSING_CLOSING_PARENTHESIS = new ParserErrorCode
.con3('MISSING_CLOSING_PARENTHESIS', 72, "The closing parenthesis is missing"); | 7009 static final ParserErrorCode MISSING_CLOSING_PARENTHESIS = new ParserErrorCode
.con3('MISSING_CLOSING_PARENTHESIS', 72, "The closing parenthesis is missing"); |
| 7010 |
| 6808 static final ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE = new ParserError
Code.con3('MISSING_CONST_FINAL_VAR_OR_TYPE', 73, "Variables must be declared usi
ng the keywords 'const', 'final', 'var' or a type name"); | 7011 static final ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE = new ParserError
Code.con3('MISSING_CONST_FINAL_VAR_OR_TYPE', 73, "Variables must be declared usi
ng the keywords 'const', 'final', 'var' or a type name"); |
| 7012 |
| 6809 static final ParserErrorCode MISSING_EXPRESSION_IN_THROW = new ParserErrorCode
.con3('MISSING_EXPRESSION_IN_THROW', 74, "Throw expressions must compute the obj
ect to be thrown"); | 7013 static final ParserErrorCode MISSING_EXPRESSION_IN_THROW = new ParserErrorCode
.con3('MISSING_EXPRESSION_IN_THROW', 74, "Throw expressions must compute the obj
ect to be thrown"); |
| 7014 |
| 6810 static final ParserErrorCode MISSING_FUNCTION_BODY = new ParserErrorCode.con3(
'MISSING_FUNCTION_BODY', 75, "A function body must be provided"); | 7015 static final ParserErrorCode MISSING_FUNCTION_BODY = new ParserErrorCode.con3(
'MISSING_FUNCTION_BODY', 75, "A function body must be provided"); |
| 7016 |
| 6811 static final ParserErrorCode MISSING_FUNCTION_PARAMETERS = new ParserErrorCode
.con3('MISSING_FUNCTION_PARAMETERS', 76, "Functions must have an explicit list o
f parameters"); | 7017 static final ParserErrorCode MISSING_FUNCTION_PARAMETERS = new ParserErrorCode
.con3('MISSING_FUNCTION_PARAMETERS', 76, "Functions must have an explicit list o
f parameters"); |
| 7018 |
| 6812 static final ParserErrorCode MISSING_IDENTIFIER = new ParserErrorCode.con3('MI
SSING_IDENTIFIER', 77, "Expected an identifier"); | 7019 static final ParserErrorCode MISSING_IDENTIFIER = new ParserErrorCode.con3('MI
SSING_IDENTIFIER', 77, "Expected an identifier"); |
| 7020 |
| 6813 static final ParserErrorCode MISSING_KEYWORD_OPERATOR = new ParserErrorCode.co
n3('MISSING_KEYWORD_OPERATOR', 78, "Operator declarations must be preceeded by t
he keyword 'operator'"); | 7021 static final ParserErrorCode MISSING_KEYWORD_OPERATOR = new ParserErrorCode.co
n3('MISSING_KEYWORD_OPERATOR', 78, "Operator declarations must be preceeded by t
he keyword 'operator'"); |
| 7022 |
| 6814 static final ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE = new ParserErr
orCode.con3('MISSING_NAME_IN_LIBRARY_DIRECTIVE', 79, "Library directives must in
clude a library name"); | 7023 static final ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE = new ParserErr
orCode.con3('MISSING_NAME_IN_LIBRARY_DIRECTIVE', 79, "Library directives must in
clude a library name"); |
| 7024 |
| 6815 static final ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE = new ParserErr
orCode.con3('MISSING_NAME_IN_PART_OF_DIRECTIVE', 80, "Library directives must in
clude a library name"); | 7025 static final ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE = new ParserErr
orCode.con3('MISSING_NAME_IN_PART_OF_DIRECTIVE', 80, "Library directives must in
clude a library name"); |
| 7026 |
| 6816 static final ParserErrorCode MISSING_STATEMENT = new ParserErrorCode.con3('MIS
SING_STATEMENT', 81, "Expected a statement"); | 7027 static final ParserErrorCode MISSING_STATEMENT = new ParserErrorCode.con3('MIS
SING_STATEMENT', 81, "Expected a statement"); |
| 7028 |
| 6817 static final ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP = new Pars
erErrorCode.con3('MISSING_TERMINATOR_FOR_PARAMETER_GROUP', 82, "There is no '%s'
to close the parameter group"); | 7029 static final ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP = new Pars
erErrorCode.con3('MISSING_TERMINATOR_FOR_PARAMETER_GROUP', 82, "There is no '%s'
to close the parameter group"); |
| 7030 |
| 6818 static final ParserErrorCode MISSING_TYPEDEF_PARAMETERS = new ParserErrorCode.
con3('MISSING_TYPEDEF_PARAMETERS', 83, "Type aliases for functions must have an
explicit list of parameters"); | 7031 static final ParserErrorCode MISSING_TYPEDEF_PARAMETERS = new ParserErrorCode.
con3('MISSING_TYPEDEF_PARAMETERS', 83, "Type aliases for functions must have an
explicit list of parameters"); |
| 7032 |
| 6819 static final ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = new ParserErrorCod
e.con3('MISSING_VARIABLE_IN_FOR_EACH', 84, "A loop variable must be declared in
a for-each loop before the 'in', but none were found"); | 7033 static final ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = new ParserErrorCod
e.con3('MISSING_VARIABLE_IN_FOR_EACH', 84, "A loop variable must be declared in
a for-each loop before the 'in', but none were found"); |
| 7034 |
| 6820 static final ParserErrorCode MIXED_PARAMETER_GROUPS = new ParserErrorCode.con3
('MIXED_PARAMETER_GROUPS', 85, "Cannot have both positional and named parameters
in a single parameter list"); | 7035 static final ParserErrorCode MIXED_PARAMETER_GROUPS = new ParserErrorCode.con3
('MIXED_PARAMETER_GROUPS', 85, "Cannot have both positional and named parameters
in a single parameter list"); |
| 7036 |
| 6821 static final ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = new ParserErrorCode.co
n3('MULTIPLE_EXTENDS_CLAUSES', 86, "Each class definition can have at most one e
xtends clause"); | 7037 static final ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = new ParserErrorCode.co
n3('MULTIPLE_EXTENDS_CLAUSES', 86, "Each class definition can have at most one e
xtends clause"); |
| 7038 |
| 6822 static final ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = new ParserErrorCode
.con3('MULTIPLE_IMPLEMENTS_CLAUSES', 87, "Each class definition can have at most
one implements clause"); | 7039 static final ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = new ParserErrorCode
.con3('MULTIPLE_IMPLEMENTS_CLAUSES', 87, "Each class definition can have at most
one implements clause"); |
| 7040 |
| 6823 static final ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES = new ParserErrorCode
.con3('MULTIPLE_LIBRARY_DIRECTIVES', 88, "Only one library directive may be decl
ared in a file"); | 7041 static final ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES = new ParserErrorCode
.con3('MULTIPLE_LIBRARY_DIRECTIVES', 88, "Only one library directive may be decl
ared in a file"); |
| 7042 |
| 6824 static final ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS = new ParserError
Code.con3('MULTIPLE_NAMED_PARAMETER_GROUPS', 89, "Cannot have multiple groups of
named parameters in a single parameter list"); | 7043 static final ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS = new ParserError
Code.con3('MULTIPLE_NAMED_PARAMETER_GROUPS', 89, "Cannot have multiple groups of
named parameters in a single parameter list"); |
| 7044 |
| 6825 static final ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES = new ParserErrorCode
.con3('MULTIPLE_PART_OF_DIRECTIVES', 90, "Only one part-of directive may be decl
ared in a file"); | 7045 static final ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES = new ParserErrorCode
.con3('MULTIPLE_PART_OF_DIRECTIVES', 90, "Only one part-of directive may be decl
ared in a file"); |
| 7046 |
| 6826 static final ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS = new Parser
ErrorCode.con3('MULTIPLE_POSITIONAL_PARAMETER_GROUPS', 91, "Cannot have multiple
groups of positional parameters in a single parameter list"); | 7047 static final ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS = new Parser
ErrorCode.con3('MULTIPLE_POSITIONAL_PARAMETER_GROUPS', 91, "Cannot have multiple
groups of positional parameters in a single parameter list"); |
| 7048 |
| 6827 static final ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH = new ParserErrorC
ode.con3('MULTIPLE_VARIABLES_IN_FOR_EACH', 92, "A single loop variable must be d
eclared in a for-each loop before the 'in', but %s were found"); | 7049 static final ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH = new ParserErrorC
ode.con3('MULTIPLE_VARIABLES_IN_FOR_EACH', 92, "A single loop variable must be d
eclared in a for-each loop before the 'in', but %s were found"); |
| 7050 |
| 6828 static final ParserErrorCode MULTIPLE_WITH_CLAUSES = new ParserErrorCode.con3(
'MULTIPLE_WITH_CLAUSES', 93, "Each class definition can have at most one with cl
ause"); | 7051 static final ParserErrorCode MULTIPLE_WITH_CLAUSES = new ParserErrorCode.con3(
'MULTIPLE_WITH_CLAUSES', 93, "Each class definition can have at most one with cl
ause"); |
| 7052 |
| 6829 static final ParserErrorCode NAMED_FUNCTION_EXPRESSION = new ParserErrorCode.c
on3('NAMED_FUNCTION_EXPRESSION', 94, "Function expressions cannot be named"); | 7053 static final ParserErrorCode NAMED_FUNCTION_EXPRESSION = new ParserErrorCode.c
on3('NAMED_FUNCTION_EXPRESSION', 94, "Function expressions cannot be named"); |
| 7054 |
| 6830 static final ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = new ParserErrorCo
de.con3('NAMED_PARAMETER_OUTSIDE_GROUP', 95, "Named parameters must be enclosed
in curly braces ('{' and '}')"); | 7055 static final ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = new ParserErrorCo
de.con3('NAMED_PARAMETER_OUTSIDE_GROUP', 95, "Named parameters must be enclosed
in curly braces ('{' and '}')"); |
| 7056 |
| 6831 static final ParserErrorCode NATIVE_CLAUSE_IN_NON_SDK_CODE = new ParserErrorCo
de.con3('NATIVE_CLAUSE_IN_NON_SDK_CODE', 96, "Native clause can only be used in
the SDK and code that is loaded through native extensions"); | 7057 static final ParserErrorCode NATIVE_CLAUSE_IN_NON_SDK_CODE = new ParserErrorCo
de.con3('NATIVE_CLAUSE_IN_NON_SDK_CODE', 96, "Native clause can only be used in
the SDK and code that is loaded through native extensions"); |
| 7058 |
| 6832 static final ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = new Parser
ErrorCode.con3('NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', 97, "Native functions can
only be declared in the SDK and code that is loaded through native extensions")
; | 7059 static final ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = new Parser
ErrorCode.con3('NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', 97, "Native functions can
only be declared in the SDK and code that is loaded through native extensions")
; |
| 7060 |
| 6833 static final ParserErrorCode NON_CONSTRUCTOR_FACTORY = new ParserErrorCode.con
3('NON_CONSTRUCTOR_FACTORY', 98, "Only constructors can be declared to be a 'fac
tory'"); | 7061 static final ParserErrorCode NON_CONSTRUCTOR_FACTORY = new ParserErrorCode.con
3('NON_CONSTRUCTOR_FACTORY', 98, "Only constructors can be declared to be a 'fac
tory'"); |
| 7062 |
| 6834 static final ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = new ParserErrorCode
.con3('NON_IDENTIFIER_LIBRARY_NAME', 99, "The name of a library must be an ident
ifier"); | 7063 static final ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = new ParserErrorCode
.con3('NON_IDENTIFIER_LIBRARY_NAME', 99, "The name of a library must be an ident
ifier"); |
| 7064 |
| 6835 static final ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = new ParserErrorCo
de.con3('NON_PART_OF_DIRECTIVE_IN_PART', 100, "The part-of directive must be the
only directive in a part"); | 7065 static final ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = new ParserErrorCo
de.con3('NON_PART_OF_DIRECTIVE_IN_PART', 100, "The part-of directive must be the
only directive in a part"); |
| 7066 |
| 6836 static final ParserErrorCode NON_USER_DEFINABLE_OPERATOR = new ParserErrorCode
.con3('NON_USER_DEFINABLE_OPERATOR', 101, "The operator '%s' is not user definab
le"); | 7067 static final ParserErrorCode NON_USER_DEFINABLE_OPERATOR = new ParserErrorCode
.con3('NON_USER_DEFINABLE_OPERATOR', 101, "The operator '%s' is not user definab
le"); |
| 7068 |
| 6837 static final ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS = new ParserErr
orCode.con3('NORMAL_BEFORE_OPTIONAL_PARAMETERS', 102, "Normal parameters must oc
cur before optional parameters"); | 7069 static final ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS = new ParserErr
orCode.con3('NORMAL_BEFORE_OPTIONAL_PARAMETERS', 102, "Normal parameters must oc
cur before optional parameters"); |
| 7070 |
| 6838 static final ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = new ParserError
Code.con3('POSITIONAL_AFTER_NAMED_ARGUMENT', 103, "Positional arguments must occ
ur before named arguments"); | 7071 static final ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = new ParserError
Code.con3('POSITIONAL_AFTER_NAMED_ARGUMENT', 103, "Positional arguments must occ
ur before named arguments"); |
| 7072 |
| 6839 static final ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = new ParserEr
rorCode.con3('POSITIONAL_PARAMETER_OUTSIDE_GROUP', 104, "Positional parameters m
ust be enclosed in square brackets ('[' and ']')"); | 7073 static final ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = new ParserEr
rorCode.con3('POSITIONAL_PARAMETER_OUTSIDE_GROUP', 104, "Positional parameters m
ust be enclosed in square brackets ('[' and ']')"); |
| 7074 |
| 6840 static final ParserErrorCode REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR = new Pars
erErrorCode.con3('REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR', 105, "Only factory co
nstructor can specify '=' redirection."); | 7075 static final ParserErrorCode REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR = new Pars
erErrorCode.con3('REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR', 105, "Only factory co
nstructor can specify '=' redirection."); |
| 7076 |
| 6841 static final ParserErrorCode SETTER_IN_FUNCTION = new ParserErrorCode.con3('SE
TTER_IN_FUNCTION', 106, "Setters cannot be defined within methods or functions")
; | 7077 static final ParserErrorCode SETTER_IN_FUNCTION = new ParserErrorCode.con3('SE
TTER_IN_FUNCTION', 106, "Setters cannot be defined within methods or functions")
; |
| 7078 |
| 6842 static final ParserErrorCode STATIC_AFTER_CONST = new ParserErrorCode.con3('ST
ATIC_AFTER_CONST', 107, "The modifier 'static' should be before the modifier 'co
nst'"); | 7079 static final ParserErrorCode STATIC_AFTER_CONST = new ParserErrorCode.con3('ST
ATIC_AFTER_CONST', 107, "The modifier 'static' should be before the modifier 'co
nst'"); |
| 7080 |
| 6843 static final ParserErrorCode STATIC_AFTER_FINAL = new ParserErrorCode.con3('ST
ATIC_AFTER_FINAL', 108, "The modifier 'static' should be before the modifier 'fi
nal'"); | 7081 static final ParserErrorCode STATIC_AFTER_FINAL = new ParserErrorCode.con3('ST
ATIC_AFTER_FINAL', 108, "The modifier 'static' should be before the modifier 'fi
nal'"); |
| 7082 |
| 6844 static final ParserErrorCode STATIC_AFTER_VAR = new ParserErrorCode.con3('STAT
IC_AFTER_VAR', 109, "The modifier 'static' should be before the modifier 'var'")
; | 7083 static final ParserErrorCode STATIC_AFTER_VAR = new ParserErrorCode.con3('STAT
IC_AFTER_VAR', 109, "The modifier 'static' should be before the modifier 'var'")
; |
| 7084 |
| 6845 static final ParserErrorCode STATIC_CONSTRUCTOR = new ParserErrorCode.con3('ST
ATIC_CONSTRUCTOR', 110, "Constructors cannot be static"); | 7085 static final ParserErrorCode STATIC_CONSTRUCTOR = new ParserErrorCode.con3('ST
ATIC_CONSTRUCTOR', 110, "Constructors cannot be static"); |
| 7086 |
| 6846 static final ParserErrorCode STATIC_GETTER_WITHOUT_BODY = new ParserErrorCode.
con3('STATIC_GETTER_WITHOUT_BODY', 111, "A 'static' getter must have a body"); | 7087 static final ParserErrorCode STATIC_GETTER_WITHOUT_BODY = new ParserErrorCode.
con3('STATIC_GETTER_WITHOUT_BODY', 111, "A 'static' getter must have a body"); |
| 7088 |
| 6847 static final ParserErrorCode STATIC_OPERATOR = new ParserErrorCode.con3('STATI
C_OPERATOR', 112, "Operators cannot be static"); | 7089 static final ParserErrorCode STATIC_OPERATOR = new ParserErrorCode.con3('STATI
C_OPERATOR', 112, "Operators cannot be static"); |
| 7090 |
| 6848 static final ParserErrorCode STATIC_SETTER_WITHOUT_BODY = new ParserErrorCode.
con3('STATIC_SETTER_WITHOUT_BODY', 113, "A 'static' setter must have a body"); | 7091 static final ParserErrorCode STATIC_SETTER_WITHOUT_BODY = new ParserErrorCode.
con3('STATIC_SETTER_WITHOUT_BODY', 113, "A 'static' setter must have a body"); |
| 7092 |
| 6849 static final ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = new ParserErrorCod
e.con3('STATIC_TOP_LEVEL_DECLARATION', 114, "Top-level declarations cannot be de
clared to be 'static'"); | 7093 static final ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = new ParserErrorCod
e.con3('STATIC_TOP_LEVEL_DECLARATION', 114, "Top-level declarations cannot be de
clared to be 'static'"); |
| 7094 |
| 6850 static final ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE = new ParserEr
rorCode.con3('SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', 115, "The 'default' case shou
ld be the last case in a switch statement"); | 7095 static final ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE = new ParserEr
rorCode.con3('SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', 115, "The 'default' case shou
ld be the last case in a switch statement"); |
| 7096 |
| 6851 static final ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES = new ParserErr
orCode.con3('SWITCH_HAS_MULTIPLE_DEFAULT_CASES', 116, "The 'default' case can on
ly be declared once"); | 7097 static final ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES = new ParserErr
orCode.con3('SWITCH_HAS_MULTIPLE_DEFAULT_CASES', 116, "The 'default' case can on
ly be declared once"); |
| 7098 |
| 6852 static final ParserErrorCode TOP_LEVEL_OPERATOR = new ParserErrorCode.con3('TO
P_LEVEL_OPERATOR', 117, "Operators must be declared within a class"); | 7099 static final ParserErrorCode TOP_LEVEL_OPERATOR = new ParserErrorCode.con3('TO
P_LEVEL_OPERATOR', 117, "Operators must be declared within a class"); |
| 7100 |
| 6853 static final ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = new P
arserErrorCode.con3('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', 118, "There is
no '%s' to open a parameter group"); | 7101 static final ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = new P
arserErrorCode.con3('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', 118, "There is
no '%s' to open a parameter group"); |
| 7102 |
| 6854 static final ParserErrorCode UNEXPECTED_TOKEN = new ParserErrorCode.con3('UNEX
PECTED_TOKEN', 119, "Unexpected token '%s'"); | 7103 static final ParserErrorCode UNEXPECTED_TOKEN = new ParserErrorCode.con3('UNEX
PECTED_TOKEN', 119, "Unexpected token '%s'"); |
| 7104 |
| 6855 static final ParserErrorCode WITH_BEFORE_EXTENDS = new ParserErrorCode.con3('W
ITH_BEFORE_EXTENDS', 120, "The extends clause must be before the with clause"); | 7105 static final ParserErrorCode WITH_BEFORE_EXTENDS = new ParserErrorCode.con3('W
ITH_BEFORE_EXTENDS', 120, "The extends clause must be before the with clause"); |
| 7106 |
| 6856 static final ParserErrorCode WITH_WITHOUT_EXTENDS = new ParserErrorCode.con3('
WITH_WITHOUT_EXTENDS', 121, "The with clause cannot be used without an extends c
lause"); | 7107 static final ParserErrorCode WITH_WITHOUT_EXTENDS = new ParserErrorCode.con3('
WITH_WITHOUT_EXTENDS', 121, "The with clause cannot be used without an extends c
lause"); |
| 7108 |
| 6857 static final ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = new ParserE
rrorCode.con3('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', 122, "The default value of
a named parameter should be preceeded by ':'"); | 7109 static final ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = new ParserE
rrorCode.con3('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', 122, "The default value of
a named parameter should be preceeded by ':'"); |
| 7110 |
| 6858 static final ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = new Pa
rserErrorCode.con3('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', 123, "The default
value of a positional parameter should be preceeded by '='"); | 7111 static final ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = new Pa
rserErrorCode.con3('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', 123, "The default
value of a positional parameter should be preceeded by '='"); |
| 7112 |
| 6859 static final ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = new Parser
ErrorCode.con3('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', 124, "Expected '%s' to cl
ose parameter group"); | 7113 static final ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = new Parser
ErrorCode.con3('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', 124, "Expected '%s' to cl
ose parameter group"); |
| 7114 |
| 6860 static final ParserErrorCode VAR_AND_TYPE = new ParserErrorCode.con3('VAR_AND_
TYPE', 125, "Variables cannot be declared using both 'var' and a type name; remo
ve the 'var'"); | 7115 static final ParserErrorCode VAR_AND_TYPE = new ParserErrorCode.con3('VAR_AND_
TYPE', 125, "Variables cannot be declared using both 'var' and a type name; remo
ve the 'var'"); |
| 7116 |
| 6861 static final ParserErrorCode VAR_AS_TYPE_NAME = new ParserErrorCode.con3('VAR_
AS_TYPE_NAME', 126, "The keyword 'var' cannot be used as a type name"); | 7117 static final ParserErrorCode VAR_AS_TYPE_NAME = new ParserErrorCode.con3('VAR_
AS_TYPE_NAME', 126, "The keyword 'var' cannot be used as a type name"); |
| 7118 |
| 6862 static final ParserErrorCode VAR_CLASS = new ParserErrorCode.con3('VAR_CLASS',
127, "Classes cannot be declared to be 'var'"); | 7119 static final ParserErrorCode VAR_CLASS = new ParserErrorCode.con3('VAR_CLASS',
127, "Classes cannot be declared to be 'var'"); |
| 7120 |
| 6863 static final ParserErrorCode VAR_RETURN_TYPE = new ParserErrorCode.con3('VAR_R
ETURN_TYPE', 128, "The return type cannot be 'var'"); | 7121 static final ParserErrorCode VAR_RETURN_TYPE = new ParserErrorCode.con3('VAR_R
ETURN_TYPE', 128, "The return type cannot be 'var'"); |
| 7122 |
| 6864 static final ParserErrorCode VAR_TYPEDEF = new ParserErrorCode.con3('VAR_TYPED
EF', 129, "Type aliases cannot be declared to be 'var'"); | 7123 static final ParserErrorCode VAR_TYPEDEF = new ParserErrorCode.con3('VAR_TYPED
EF', 129, "Type aliases cannot be declared to be 'var'"); |
| 7124 |
| 6865 static final ParserErrorCode VOID_PARAMETER = new ParserErrorCode.con3('VOID_P
ARAMETER', 130, "Parameters cannot have a type of 'void'"); | 7125 static final ParserErrorCode VOID_PARAMETER = new ParserErrorCode.con3('VOID_P
ARAMETER', 130, "Parameters cannot have a type of 'void'"); |
| 7126 |
| 6866 static final ParserErrorCode VOID_VARIABLE = new ParserErrorCode.con3('VOID_VA
RIABLE', 131, "Variables cannot have a type of 'void'"); | 7127 static final ParserErrorCode VOID_VARIABLE = new ParserErrorCode.con3('VOID_VA
RIABLE', 131, "Variables cannot have a type of 'void'"); |
| 7128 |
| 6867 static final List<ParserErrorCode> values = [ | 7129 static final List<ParserErrorCode> values = [ |
| 6868 ABSTRACT_CLASS_MEMBER, | 7130 ABSTRACT_CLASS_MEMBER, |
| 6869 ABSTRACT_STATIC_METHOD, | 7131 ABSTRACT_STATIC_METHOD, |
| 6870 ABSTRACT_TOP_LEVEL_FUNCTION, | 7132 ABSTRACT_TOP_LEVEL_FUNCTION, |
| 6871 ABSTRACT_TOP_LEVEL_VARIABLE, | 7133 ABSTRACT_TOP_LEVEL_VARIABLE, |
| 6872 ABSTRACT_TYPEDEF, | 7134 ABSTRACT_TYPEDEF, |
| 6873 ASSERT_DOES_NOT_TAKE_ASSIGNMENT, | 7135 ASSERT_DOES_NOT_TAKE_ASSIGNMENT, |
| 6874 ASSERT_DOES_NOT_TAKE_CASCADE, | 7136 ASSERT_DOES_NOT_TAKE_CASCADE, |
| 6875 ASSERT_DOES_NOT_TAKE_THROW, | 7137 ASSERT_DOES_NOT_TAKE_THROW, |
| 6876 ASSERT_DOES_NOT_TAKE_RETHROW, | 7138 ASSERT_DOES_NOT_TAKE_RETHROW, |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7037 this._message = message; | 7299 this._message = message; |
| 7038 this.correction8 = correction; | 7300 this.correction8 = correction; |
| 7039 } | 7301 } |
| 7040 | 7302 |
| 7041 /** | 7303 /** |
| 7042 * Initialize a newly created error code to have the given message and a sever
ity of ERROR. | 7304 * Initialize a newly created error code to have the given message and a sever
ity of ERROR. |
| 7043 * | 7305 * |
| 7044 * @param message the message template used to create the message to be displa
yed for the error | 7306 * @param message the message template used to create the message to be displa
yed for the error |
| 7045 */ | 7307 */ |
| 7046 ParserErrorCode.con3(String name, int ordinal, String message) : this.con1(nam
e, ordinal, ErrorSeverity.ERROR, message); | 7308 ParserErrorCode.con3(String name, int ordinal, String message) : this.con1(nam
e, ordinal, ErrorSeverity.ERROR, message); |
| 7309 |
| 7047 String get correction => correction8; | 7310 String get correction => correction8; |
| 7311 |
| 7048 ErrorSeverity get errorSeverity => _severity; | 7312 ErrorSeverity get errorSeverity => _severity; |
| 7313 |
| 7049 String get message => _message; | 7314 String get message => _message; |
| 7315 |
| 7050 ErrorType get type => ErrorType.SYNTACTIC_ERROR; | 7316 ErrorType get type => ErrorType.SYNTACTIC_ERROR; |
| 7051 } | 7317 } |
| 7318 |
| 7052 /** | 7319 /** |
| 7053 * Instances of the class `ResolutionCopier` copies resolution information from
one AST | 7320 * Instances of the class `ResolutionCopier` copies resolution information from
one AST |
| 7054 * structure to another as long as the structures of the corresponding children
of a pair of nodes | 7321 * structure to another as long as the structures of the corresponding children
of a pair of nodes |
| 7055 * are the same. | 7322 * are the same. |
| 7056 */ | 7323 */ |
| 7057 class ResolutionCopier implements ASTVisitor<bool> { | 7324 class ResolutionCopier implements ASTVisitor<bool> { |
| 7058 | |
| 7059 /** | 7325 /** |
| 7060 * Copy resolution data from one node to another. | 7326 * Copy resolution data from one node to another. |
| 7061 * | 7327 * |
| 7062 * @param fromNode the node from which resolution information will be copied | 7328 * @param fromNode the node from which resolution information will be copied |
| 7063 * @param toNode the node to which resolution information will be copied | 7329 * @param toNode the node to which resolution information will be copied |
| 7064 */ | 7330 */ |
| 7065 static void copyResolutionData(ASTNode fromNode, ASTNode toNode) { | 7331 static void copyResolutionData(ASTNode fromNode, ASTNode toNode) { |
| 7066 ResolutionCopier copier = new ResolutionCopier(); | 7332 ResolutionCopier copier = new ResolutionCopier(); |
| 7067 copier.isEqual(fromNode, toNode); | 7333 copier.isEqual(fromNode, toNode); |
| 7068 } | 7334 } |
| 7069 | 7335 |
| 7070 /** | 7336 /** |
| 7071 * The AST node with which the node being visited is to be compared. This is o
nly valid at the | 7337 * The AST node with which the node being visited is to be compared. This is o
nly valid at the |
| 7072 * beginning of each visit method (until [isEqual] is invoked). | 7338 * beginning of each visit method (until [isEqual] is invoked). |
| 7073 */ | 7339 */ |
| 7074 ASTNode _toNode; | 7340 ASTNode _toNode; |
| 7341 |
| 7075 bool visitAdjacentStrings(AdjacentStrings node) { | 7342 bool visitAdjacentStrings(AdjacentStrings node) { |
| 7076 AdjacentStrings toNode = this._toNode as AdjacentStrings; | 7343 AdjacentStrings toNode = this._toNode as AdjacentStrings; |
| 7077 return isEqual2(node.strings, toNode.strings); | 7344 return isEqual2(node.strings, toNode.strings); |
| 7078 } | 7345 } |
| 7346 |
| 7079 bool visitAnnotation(Annotation node) { | 7347 bool visitAnnotation(Annotation node) { |
| 7080 Annotation toNode = this._toNode as Annotation; | 7348 Annotation toNode = this._toNode as Annotation; |
| 7081 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(nod
e.atSign, toNode.atSign), isEqual(node.name, toNode.name)), isEqual3(node.period
, toNode.period)), isEqual(node.constructorName, toNode.constructorName)), isEqu
al(node.arguments, toNode.arguments))) { | 7349 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(nod
e.atSign, toNode.atSign), isEqual(node.name, toNode.name)), isEqual3(node.period
, toNode.period)), isEqual(node.constructorName, toNode.constructorName)), isEqu
al(node.arguments, toNode.arguments))) { |
| 7082 toNode.element = node.element; | 7350 toNode.element = node.element; |
| 7083 return true; | 7351 return true; |
| 7084 } | 7352 } |
| 7085 return false; | 7353 return false; |
| 7086 } | 7354 } |
| 7355 |
| 7087 bool visitArgumentDefinitionTest(ArgumentDefinitionTest node) { | 7356 bool visitArgumentDefinitionTest(ArgumentDefinitionTest node) { |
| 7088 ArgumentDefinitionTest toNode = this._toNode as ArgumentDefinitionTest; | 7357 ArgumentDefinitionTest toNode = this._toNode as ArgumentDefinitionTest; |
| 7089 if (javaBooleanAnd(isEqual3(node.question, toNode.question), isEqual(node.id
entifier, toNode.identifier))) { | 7358 if (javaBooleanAnd(isEqual3(node.question, toNode.question), isEqual(node.id
entifier, toNode.identifier))) { |
| 7090 toNode.propagatedType = node.propagatedType; | 7359 toNode.propagatedType = node.propagatedType; |
| 7091 toNode.staticType = node.staticType; | 7360 toNode.staticType = node.staticType; |
| 7092 return true; | 7361 return true; |
| 7093 } | 7362 } |
| 7094 return false; | 7363 return false; |
| 7095 } | 7364 } |
| 7365 |
| 7096 bool visitArgumentList(ArgumentList node) { | 7366 bool visitArgumentList(ArgumentList node) { |
| 7097 ArgumentList toNode = this._toNode as ArgumentList; | 7367 ArgumentList toNode = this._toNode as ArgumentList; |
| 7098 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.leftParenthesis, toNode.l
eftParenthesis), isEqual2(node.arguments, toNode.arguments)), isEqual3(node.righ
tParenthesis, toNode.rightParenthesis)); | 7368 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.leftParenthesis, toNode.l
eftParenthesis), isEqual2(node.arguments, toNode.arguments)), isEqual3(node.righ
tParenthesis, toNode.rightParenthesis)); |
| 7099 } | 7369 } |
| 7370 |
| 7100 bool visitAsExpression(AsExpression node) { | 7371 bool visitAsExpression(AsExpression node) { |
| 7101 AsExpression toNode = this._toNode as AsExpression; | 7372 AsExpression toNode = this._toNode as AsExpression; |
| 7102 if (javaBooleanAnd(javaBooleanAnd(isEqual(node.expression, toNode.expression
), isEqual3(node.asOperator, toNode.asOperator)), isEqual(node.type, toNode.type
))) { | 7373 if (javaBooleanAnd(javaBooleanAnd(isEqual(node.expression, toNode.expression
), isEqual3(node.asOperator, toNode.asOperator)), isEqual(node.type, toNode.type
))) { |
| 7103 toNode.propagatedType = node.propagatedType; | 7374 toNode.propagatedType = node.propagatedType; |
| 7104 toNode.staticType = node.staticType; | 7375 toNode.staticType = node.staticType; |
| 7105 return true; | 7376 return true; |
| 7106 } | 7377 } |
| 7107 return false; | 7378 return false; |
| 7108 } | 7379 } |
| 7380 |
| 7109 bool visitAssertStatement(AssertStatement node) { | 7381 bool visitAssertStatement(AssertStatement node) { |
| 7110 AssertStatement toNode = this._toNode as AssertStatement; | 7382 AssertStatement toNode = this._toNode as AssertStatement; |
| 7111 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(
node.keyword, toNode.keyword), isEqual3(node.leftParenthesis, toNode.leftParenth
esis)), isEqual(node.condition, toNode.condition)), isEqual3(node.rightParenthes
is, toNode.rightParenthesis)), isEqual3(node.semicolon, toNode.semicolon)); | 7383 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(
node.keyword, toNode.keyword), isEqual3(node.leftParenthesis, toNode.leftParenth
esis)), isEqual(node.condition, toNode.condition)), isEqual3(node.rightParenthes
is, toNode.rightParenthesis)), isEqual3(node.semicolon, toNode.semicolon)); |
| 7112 } | 7384 } |
| 7385 |
| 7113 bool visitAssignmentExpression(AssignmentExpression node) { | 7386 bool visitAssignmentExpression(AssignmentExpression node) { |
| 7114 AssignmentExpression toNode = this._toNode as AssignmentExpression; | 7387 AssignmentExpression toNode = this._toNode as AssignmentExpression; |
| 7115 if (javaBooleanAnd(javaBooleanAnd(isEqual(node.leftHandSide, toNode.leftHand
Side), isEqual3(node.operator, toNode.operator)), isEqual(node.rightHandSide, to
Node.rightHandSide))) { | 7388 if (javaBooleanAnd(javaBooleanAnd(isEqual(node.leftHandSide, toNode.leftHand
Side), isEqual3(node.operator, toNode.operator)), isEqual(node.rightHandSide, to
Node.rightHandSide))) { |
| 7116 toNode.propagatedElement = node.propagatedElement; | 7389 toNode.propagatedElement = node.propagatedElement; |
| 7117 toNode.propagatedType = node.propagatedType; | 7390 toNode.propagatedType = node.propagatedType; |
| 7118 toNode.staticElement = node.staticElement; | 7391 toNode.staticElement = node.staticElement; |
| 7119 toNode.staticType = node.staticType; | 7392 toNode.staticType = node.staticType; |
| 7120 return true; | 7393 return true; |
| 7121 } | 7394 } |
| 7122 return false; | 7395 return false; |
| 7123 } | 7396 } |
| 7397 |
| 7124 bool visitBinaryExpression(BinaryExpression node) { | 7398 bool visitBinaryExpression(BinaryExpression node) { |
| 7125 BinaryExpression toNode = this._toNode as BinaryExpression; | 7399 BinaryExpression toNode = this._toNode as BinaryExpression; |
| 7126 if (javaBooleanAnd(javaBooleanAnd(isEqual(node.leftOperand, toNode.leftOpera
nd), isEqual3(node.operator, toNode.operator)), isEqual(node.rightOperand, toNod
e.rightOperand))) { | 7400 if (javaBooleanAnd(javaBooleanAnd(isEqual(node.leftOperand, toNode.leftOpera
nd), isEqual3(node.operator, toNode.operator)), isEqual(node.rightOperand, toNod
e.rightOperand))) { |
| 7127 toNode.propagatedElement = node.propagatedElement; | 7401 toNode.propagatedElement = node.propagatedElement; |
| 7128 toNode.propagatedType = node.propagatedType; | 7402 toNode.propagatedType = node.propagatedType; |
| 7129 toNode.staticElement = node.staticElement; | 7403 toNode.staticElement = node.staticElement; |
| 7130 toNode.staticType = node.staticType; | 7404 toNode.staticType = node.staticType; |
| 7131 return true; | 7405 return true; |
| 7132 } | 7406 } |
| 7133 return false; | 7407 return false; |
| 7134 } | 7408 } |
| 7409 |
| 7135 bool visitBlock(Block node) { | 7410 bool visitBlock(Block node) { |
| 7136 Block toNode = this._toNode as Block; | 7411 Block toNode = this._toNode as Block; |
| 7137 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.leftBracket, toNode.leftB
racket), isEqual2(node.statements, toNode.statements)), isEqual3(node.rightBrack
et, toNode.rightBracket)); | 7412 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.leftBracket, toNode.leftB
racket), isEqual2(node.statements, toNode.statements)), isEqual3(node.rightBrack
et, toNode.rightBracket)); |
| 7138 } | 7413 } |
| 7414 |
| 7139 bool visitBlockFunctionBody(BlockFunctionBody node) { | 7415 bool visitBlockFunctionBody(BlockFunctionBody node) { |
| 7140 BlockFunctionBody toNode = this._toNode as BlockFunctionBody; | 7416 BlockFunctionBody toNode = this._toNode as BlockFunctionBody; |
| 7141 return isEqual(node.block, toNode.block); | 7417 return isEqual(node.block, toNode.block); |
| 7142 } | 7418 } |
| 7419 |
| 7143 bool visitBooleanLiteral(BooleanLiteral node) { | 7420 bool visitBooleanLiteral(BooleanLiteral node) { |
| 7144 BooleanLiteral toNode = this._toNode as BooleanLiteral; | 7421 BooleanLiteral toNode = this._toNode as BooleanLiteral; |
| 7145 if (javaBooleanAnd(isEqual3(node.literal, toNode.literal), identical(node.va
lue, toNode.value))) { | 7422 if (javaBooleanAnd(isEqual3(node.literal, toNode.literal), identical(node.va
lue, toNode.value))) { |
| 7146 toNode.propagatedType = node.propagatedType; | 7423 toNode.propagatedType = node.propagatedType; |
| 7147 toNode.staticType = node.staticType; | 7424 toNode.staticType = node.staticType; |
| 7148 return true; | 7425 return true; |
| 7149 } | 7426 } |
| 7150 return false; | 7427 return false; |
| 7151 } | 7428 } |
| 7429 |
| 7152 bool visitBreakStatement(BreakStatement node) { | 7430 bool visitBreakStatement(BreakStatement node) { |
| 7153 BreakStatement toNode = this._toNode as BreakStatement; | 7431 BreakStatement toNode = this._toNode as BreakStatement; |
| 7154 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.keyword, toNode.keyword),
isEqual(node.label, toNode.label)), isEqual3(node.semicolon, toNode.semicolon))
; | 7432 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.keyword, toNode.keyword),
isEqual(node.label, toNode.label)), isEqual3(node.semicolon, toNode.semicolon))
; |
| 7155 } | 7433 } |
| 7434 |
| 7156 bool visitCascadeExpression(CascadeExpression node) { | 7435 bool visitCascadeExpression(CascadeExpression node) { |
| 7157 CascadeExpression toNode = this._toNode as CascadeExpression; | 7436 CascadeExpression toNode = this._toNode as CascadeExpression; |
| 7158 if (javaBooleanAnd(isEqual(node.target, toNode.target), isEqual2(node.cascad
eSections, toNode.cascadeSections))) { | 7437 if (javaBooleanAnd(isEqual(node.target, toNode.target), isEqual2(node.cascad
eSections, toNode.cascadeSections))) { |
| 7159 toNode.propagatedType = node.propagatedType; | 7438 toNode.propagatedType = node.propagatedType; |
| 7160 toNode.staticType = node.staticType; | 7439 toNode.staticType = node.staticType; |
| 7161 return true; | 7440 return true; |
| 7162 } | 7441 } |
| 7163 return false; | 7442 return false; |
| 7164 } | 7443 } |
| 7444 |
| 7165 bool visitCatchClause(CatchClause node) { | 7445 bool visitCatchClause(CatchClause node) { |
| 7166 CatchClause toNode = this._toNode as CatchClause; | 7446 CatchClause toNode = this._toNode as CatchClause; |
| 7167 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(node.onKeyword, toNo
de.onKeyword), isEqual(node.exceptionType, toNode.exceptionType)), isEqual3(node
.catchKeyword, toNode.catchKeyword)), isEqual3(node.leftParenthesis, toNode.left
Parenthesis)), isEqual(node.exceptionParameter, toNode.exceptionParameter)), isE
qual3(node.comma, toNode.comma)), isEqual(node.stackTraceParameter, toNode.stack
TraceParameter)), isEqual3(node.rightParenthesis, toNode.rightParenthesis)), isE
qual(node.body, toNode.body)); | 7447 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(node.onKeyword, toNo
de.onKeyword), isEqual(node.exceptionType, toNode.exceptionType)), isEqual3(node
.catchKeyword, toNode.catchKeyword)), isEqual3(node.leftParenthesis, toNode.left
Parenthesis)), isEqual(node.exceptionParameter, toNode.exceptionParameter)), isE
qual3(node.comma, toNode.comma)), isEqual(node.stackTraceParameter, toNode.stack
TraceParameter)), isEqual3(node.rightParenthesis, toNode.rightParenthesis)), isE
qual(node.body, toNode.body)); |
| 7168 } | 7448 } |
| 7449 |
| 7169 bool visitClassDeclaration(ClassDeclaration node) { | 7450 bool visitClassDeclaration(ClassDeclaration node) { |
| 7170 ClassDeclaration toNode = this._toNode as ClassDeclaration; | 7451 ClassDeclaration toNode = this._toNode as ClassDeclaration; |
| 7171 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd
(javaBooleanAnd(isEqual(node.documentationComment, toNode.documentationComment),
isEqual2(node.metadata, toNode.metadata)), isEqual3(node.abstractKeyword, toNod
e.abstractKeyword)), isEqual3(node.classKeyword, toNode.classKeyword)), isEqual(
node.name, toNode.name)), isEqual(node.typeParameters, toNode.typeParameters)),
isEqual(node.extendsClause, toNode.extendsClause)), isEqual(node.withClause, toN
ode.withClause)), isEqual(node.implementsClause, toNode.implementsClause)), isEq
ual3(node.leftBracket, toNode.leftBracket)), isEqual2(node.members, toNode.membe
rs)), isEqual3(node.rightBracket, toNode.rightBracket)); | 7452 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd
(javaBooleanAnd(isEqual(node.documentationComment, toNode.documentationComment),
isEqual2(node.metadata, toNode.metadata)), isEqual3(node.abstractKeyword, toNod
e.abstractKeyword)), isEqual3(node.classKeyword, toNode.classKeyword)), isEqual(
node.name, toNode.name)), isEqual(node.typeParameters, toNode.typeParameters)),
isEqual(node.extendsClause, toNode.extendsClause)), isEqual(node.withClause, toN
ode.withClause)), isEqual(node.implementsClause, toNode.implementsClause)), isEq
ual3(node.leftBracket, toNode.leftBracket)), isEqual2(node.members, toNode.membe
rs)), isEqual3(node.rightBracket, toNode.rightBracket)); |
| 7172 } | 7453 } |
| 7454 |
| 7173 bool visitClassTypeAlias(ClassTypeAlias node) { | 7455 bool visitClassTypeAlias(ClassTypeAlias node) { |
| 7174 ClassTypeAlias toNode = this._toNode as ClassTypeAlias; | 7456 ClassTypeAlias toNode = this._toNode as ClassTypeAlias; |
| 7175 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd
(isEqual(node.documentationComment, toNode.documentationComment), isEqual2(node.
metadata, toNode.metadata)), isEqual3(node.keyword, toNode.keyword)), isEqual(no
de.name, toNode.name)), isEqual(node.typeParameters, toNode.typeParameters)), is
Equal3(node.equals, toNode.equals)), isEqual3(node.abstractKeyword, toNode.abstr
actKeyword)), isEqual(node.superclass, toNode.superclass)), isEqual(node.withCla
use, toNode.withClause)), isEqual(node.implementsClause, toNode.implementsClause
)), isEqual3(node.semicolon, toNode.semicolon)); | 7457 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd
(isEqual(node.documentationComment, toNode.documentationComment), isEqual2(node.
metadata, toNode.metadata)), isEqual3(node.keyword, toNode.keyword)), isEqual(no
de.name, toNode.name)), isEqual(node.typeParameters, toNode.typeParameters)), is
Equal3(node.equals, toNode.equals)), isEqual3(node.abstractKeyword, toNode.abstr
actKeyword)), isEqual(node.superclass, toNode.superclass)), isEqual(node.withCla
use, toNode.withClause)), isEqual(node.implementsClause, toNode.implementsClause
)), isEqual3(node.semicolon, toNode.semicolon)); |
| 7176 } | 7458 } |
| 7459 |
| 7177 bool visitComment(Comment node) { | 7460 bool visitComment(Comment node) { |
| 7178 Comment toNode = this._toNode as Comment; | 7461 Comment toNode = this._toNode as Comment; |
| 7179 return isEqual2(node.references, toNode.references); | 7462 return isEqual2(node.references, toNode.references); |
| 7180 } | 7463 } |
| 7464 |
| 7181 bool visitCommentReference(CommentReference node) { | 7465 bool visitCommentReference(CommentReference node) { |
| 7182 CommentReference toNode = this._toNode as CommentReference; | 7466 CommentReference toNode = this._toNode as CommentReference; |
| 7183 return javaBooleanAnd(isEqual3(node.newKeyword, toNode.newKeyword), isEqual(
node.identifier, toNode.identifier)); | 7467 return javaBooleanAnd(isEqual3(node.newKeyword, toNode.newKeyword), isEqual(
node.identifier, toNode.identifier)); |
| 7184 } | 7468 } |
| 7469 |
| 7185 bool visitCompilationUnit(CompilationUnit node) { | 7470 bool visitCompilationUnit(CompilationUnit node) { |
| 7186 CompilationUnit toNode = this._toNode as CompilationUnit; | 7471 CompilationUnit toNode = this._toNode as CompilationUnit; |
| 7187 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(nod
e.beginToken, toNode.beginToken), isEqual(node.scriptTag, toNode.scriptTag)), is
Equal2(node.directives, toNode.directives)), isEqual2(node.declarations, toNode.
declarations)), isEqual3(node.endToken, toNode.endToken))) { | 7472 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(nod
e.beginToken, toNode.beginToken), isEqual(node.scriptTag, toNode.scriptTag)), is
Equal2(node.directives, toNode.directives)), isEqual2(node.declarations, toNode.
declarations)), isEqual3(node.endToken, toNode.endToken))) { |
| 7188 toNode.element = node.element; | 7473 toNode.element = node.element; |
| 7189 return true; | 7474 return true; |
| 7190 } | 7475 } |
| 7191 return false; | 7476 return false; |
| 7192 } | 7477 } |
| 7478 |
| 7193 bool visitConditionalExpression(ConditionalExpression node) { | 7479 bool visitConditionalExpression(ConditionalExpression node) { |
| 7194 ConditionalExpression toNode = this._toNode as ConditionalExpression; | 7480 ConditionalExpression toNode = this._toNode as ConditionalExpression; |
| 7195 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node
.condition, toNode.condition), isEqual3(node.question, toNode.question)), isEqua
l(node.thenExpression, toNode.thenExpression)), isEqual3(node.colon, toNode.colo
n)), isEqual(node.elseExpression, toNode.elseExpression))) { | 7481 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node
.condition, toNode.condition), isEqual3(node.question, toNode.question)), isEqua
l(node.thenExpression, toNode.thenExpression)), isEqual3(node.colon, toNode.colo
n)), isEqual(node.elseExpression, toNode.elseExpression))) { |
| 7196 toNode.propagatedType = node.propagatedType; | 7482 toNode.propagatedType = node.propagatedType; |
| 7197 toNode.staticType = node.staticType; | 7483 toNode.staticType = node.staticType; |
| 7198 return true; | 7484 return true; |
| 7199 } | 7485 } |
| 7200 return false; | 7486 return false; |
| 7201 } | 7487 } |
| 7488 |
| 7202 bool visitConstructorDeclaration(ConstructorDeclaration node) { | 7489 bool visitConstructorDeclaration(ConstructorDeclaration node) { |
| 7203 ConstructorDeclaration toNode = this._toNode as ConstructorDeclaration; | 7490 ConstructorDeclaration toNode = this._toNode as ConstructorDeclaration; |
| 7204 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanA
nd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(ja
vaBooleanAnd(javaBooleanAnd(isEqual(node.documentationComment, toNode.documentat
ionComment), isEqual2(node.metadata, toNode.metadata)), isEqual3(node.externalKe
yword, toNode.externalKeyword)), isEqual3(node.constKeyword, toNode.constKeyword
)), isEqual3(node.factoryKeyword, toNode.factoryKeyword)), isEqual(node.returnTy
pe, toNode.returnType)), isEqual3(node.period, toNode.period)), isEqual(node.nam
e, toNode.name)), isEqual(node.parameters, toNode.parameters)), isEqual3(node.se
parator, toNode.separator)), isEqual2(node.initializers, toNode.initializers)),
isEqual(node.redirectedConstructor, toNode.redirectedConstructor)), isEqual(node
.body, toNode.body))) { | 7491 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanA
nd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(ja
vaBooleanAnd(javaBooleanAnd(isEqual(node.documentationComment, toNode.documentat
ionComment), isEqual2(node.metadata, toNode.metadata)), isEqual3(node.externalKe
yword, toNode.externalKeyword)), isEqual3(node.constKeyword, toNode.constKeyword
)), isEqual3(node.factoryKeyword, toNode.factoryKeyword)), isEqual(node.returnTy
pe, toNode.returnType)), isEqual3(node.period, toNode.period)), isEqual(node.nam
e, toNode.name)), isEqual(node.parameters, toNode.parameters)), isEqual3(node.se
parator, toNode.separator)), isEqual2(node.initializers, toNode.initializers)),
isEqual(node.redirectedConstructor, toNode.redirectedConstructor)), isEqual(node
.body, toNode.body))) { |
| 7205 toNode.element = node.element; | 7492 toNode.element = node.element; |
| 7206 return true; | 7493 return true; |
| 7207 } | 7494 } |
| 7208 return false; | 7495 return false; |
| 7209 } | 7496 } |
| 7497 |
| 7210 bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) { | 7498 bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) { |
| 7211 ConstructorFieldInitializer toNode = this._toNode as ConstructorFieldInitial
izer; | 7499 ConstructorFieldInitializer toNode = this._toNode as ConstructorFieldInitial
izer; |
| 7212 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(
node.keyword, toNode.keyword), isEqual3(node.period, toNode.period)), isEqual(no
de.fieldName, toNode.fieldName)), isEqual3(node.equals, toNode.equals)), isEqual
(node.expression, toNode.expression)); | 7500 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(
node.keyword, toNode.keyword), isEqual3(node.period, toNode.period)), isEqual(no
de.fieldName, toNode.fieldName)), isEqual3(node.equals, toNode.equals)), isEqual
(node.expression, toNode.expression)); |
| 7213 } | 7501 } |
| 7502 |
| 7214 bool visitConstructorName(ConstructorName node) { | 7503 bool visitConstructorName(ConstructorName node) { |
| 7215 ConstructorName toNode = this._toNode as ConstructorName; | 7504 ConstructorName toNode = this._toNode as ConstructorName; |
| 7216 if (javaBooleanAnd(javaBooleanAnd(isEqual(node.type, toNode.type), isEqual3(
node.period, toNode.period)), isEqual(node.name, toNode.name))) { | 7505 if (javaBooleanAnd(javaBooleanAnd(isEqual(node.type, toNode.type), isEqual3(
node.period, toNode.period)), isEqual(node.name, toNode.name))) { |
| 7217 toNode.staticElement = node.staticElement; | 7506 toNode.staticElement = node.staticElement; |
| 7218 return true; | 7507 return true; |
| 7219 } | 7508 } |
| 7220 return false; | 7509 return false; |
| 7221 } | 7510 } |
| 7511 |
| 7222 bool visitContinueStatement(ContinueStatement node) { | 7512 bool visitContinueStatement(ContinueStatement node) { |
| 7223 ContinueStatement toNode = this._toNode as ContinueStatement; | 7513 ContinueStatement toNode = this._toNode as ContinueStatement; |
| 7224 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.keyword, toNode.keyword),
isEqual(node.label, toNode.label)), isEqual3(node.semicolon, toNode.semicolon))
; | 7514 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.keyword, toNode.keyword),
isEqual(node.label, toNode.label)), isEqual3(node.semicolon, toNode.semicolon))
; |
| 7225 } | 7515 } |
| 7516 |
| 7226 bool visitDeclaredIdentifier(DeclaredIdentifier node) { | 7517 bool visitDeclaredIdentifier(DeclaredIdentifier node) { |
| 7227 DeclaredIdentifier toNode = this._toNode as DeclaredIdentifier; | 7518 DeclaredIdentifier toNode = this._toNode as DeclaredIdentifier; |
| 7228 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual3(node.keyword, toNode.keyword)), isEqual(node.type, t
oNode.type)), isEqual(node.identifier, toNode.identifier)); | 7519 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual3(node.keyword, toNode.keyword)), isEqual(node.type, t
oNode.type)), isEqual(node.identifier, toNode.identifier)); |
| 7229 } | 7520 } |
| 7521 |
| 7230 bool visitDefaultFormalParameter(DefaultFormalParameter node) { | 7522 bool visitDefaultFormalParameter(DefaultFormalParameter node) { |
| 7231 DefaultFormalParameter toNode = this._toNode as DefaultFormalParameter; | 7523 DefaultFormalParameter toNode = this._toNode as DefaultFormalParameter; |
| 7232 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.parameter,
toNode.parameter), identical(node.kind, toNode.kind)), isEqual3(node.separator,
toNode.separator)), isEqual(node.defaultValue, toNode.defaultValue)); | 7524 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.parameter,
toNode.parameter), identical(node.kind, toNode.kind)), isEqual3(node.separator,
toNode.separator)), isEqual(node.defaultValue, toNode.defaultValue)); |
| 7233 } | 7525 } |
| 7526 |
| 7234 bool visitDoStatement(DoStatement node) { | 7527 bool visitDoStatement(DoStatement node) { |
| 7235 DoStatement toNode = this._toNode as DoStatement; | 7528 DoStatement toNode = this._toNode as DoStatement; |
| 7236 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(isEqual3(node.doKeyword, toNode.doKeyword), isEqual(node.bo
dy, toNode.body)), isEqual3(node.whileKeyword, toNode.whileKeyword)), isEqual3(n
ode.leftParenthesis, toNode.leftParenthesis)), isEqual(node.condition, toNode.co
ndition)), isEqual3(node.rightParenthesis, toNode.rightParenthesis)), isEqual3(n
ode.semicolon, toNode.semicolon)); | 7529 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(isEqual3(node.doKeyword, toNode.doKeyword), isEqual(node.bo
dy, toNode.body)), isEqual3(node.whileKeyword, toNode.whileKeyword)), isEqual3(n
ode.leftParenthesis, toNode.leftParenthesis)), isEqual(node.condition, toNode.co
ndition)), isEqual3(node.rightParenthesis, toNode.rightParenthesis)), isEqual3(n
ode.semicolon, toNode.semicolon)); |
| 7237 } | 7530 } |
| 7531 |
| 7238 bool visitDoubleLiteral(DoubleLiteral node) { | 7532 bool visitDoubleLiteral(DoubleLiteral node) { |
| 7239 DoubleLiteral toNode = this._toNode as DoubleLiteral; | 7533 DoubleLiteral toNode = this._toNode as DoubleLiteral; |
| 7240 if (javaBooleanAnd(isEqual3(node.literal, toNode.literal), node.value == toN
ode.value)) { | 7534 if (javaBooleanAnd(isEqual3(node.literal, toNode.literal), node.value == toN
ode.value)) { |
| 7241 toNode.propagatedType = node.propagatedType; | 7535 toNode.propagatedType = node.propagatedType; |
| 7242 toNode.staticType = node.staticType; | 7536 toNode.staticType = node.staticType; |
| 7243 return true; | 7537 return true; |
| 7244 } | 7538 } |
| 7245 return false; | 7539 return false; |
| 7246 } | 7540 } |
| 7541 |
| 7247 bool visitEmptyFunctionBody(EmptyFunctionBody node) { | 7542 bool visitEmptyFunctionBody(EmptyFunctionBody node) { |
| 7248 EmptyFunctionBody toNode = this._toNode as EmptyFunctionBody; | 7543 EmptyFunctionBody toNode = this._toNode as EmptyFunctionBody; |
| 7249 return isEqual3(node.semicolon, toNode.semicolon); | 7544 return isEqual3(node.semicolon, toNode.semicolon); |
| 7250 } | 7545 } |
| 7546 |
| 7251 bool visitEmptyStatement(EmptyStatement node) { | 7547 bool visitEmptyStatement(EmptyStatement node) { |
| 7252 EmptyStatement toNode = this._toNode as EmptyStatement; | 7548 EmptyStatement toNode = this._toNode as EmptyStatement; |
| 7253 return isEqual3(node.semicolon, toNode.semicolon); | 7549 return isEqual3(node.semicolon, toNode.semicolon); |
| 7254 } | 7550 } |
| 7551 |
| 7255 bool visitExportDirective(ExportDirective node) { | 7552 bool visitExportDirective(ExportDirective node) { |
| 7256 ExportDirective toNode = this._toNode as ExportDirective; | 7553 ExportDirective toNode = this._toNode as ExportDirective; |
| 7257 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanA
nd(isEqual(node.documentationComment, toNode.documentationComment), isEqual2(nod
e.metadata, toNode.metadata)), isEqual3(node.keyword, toNode.keyword)), isEqual(
node.uri, toNode.uri)), isEqual2(node.combinators, toNode.combinators)), isEqual
3(node.semicolon, toNode.semicolon))) { | 7554 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanA
nd(isEqual(node.documentationComment, toNode.documentationComment), isEqual2(nod
e.metadata, toNode.metadata)), isEqual3(node.keyword, toNode.keyword)), isEqual(
node.uri, toNode.uri)), isEqual2(node.combinators, toNode.combinators)), isEqual
3(node.semicolon, toNode.semicolon))) { |
| 7258 toNode.element = node.element; | 7555 toNode.element = node.element; |
| 7259 return true; | 7556 return true; |
| 7260 } | 7557 } |
| 7261 return false; | 7558 return false; |
| 7262 } | 7559 } |
| 7560 |
| 7263 bool visitExpressionFunctionBody(ExpressionFunctionBody node) { | 7561 bool visitExpressionFunctionBody(ExpressionFunctionBody node) { |
| 7264 ExpressionFunctionBody toNode = this._toNode as ExpressionFunctionBody; | 7562 ExpressionFunctionBody toNode = this._toNode as ExpressionFunctionBody; |
| 7265 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.functionDefinition, toNod
e.functionDefinition), isEqual(node.expression, toNode.expression)), isEqual3(no
de.semicolon, toNode.semicolon)); | 7563 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.functionDefinition, toNod
e.functionDefinition), isEqual(node.expression, toNode.expression)), isEqual3(no
de.semicolon, toNode.semicolon)); |
| 7266 } | 7564 } |
| 7565 |
| 7267 bool visitExpressionStatement(ExpressionStatement node) { | 7566 bool visitExpressionStatement(ExpressionStatement node) { |
| 7268 ExpressionStatement toNode = this._toNode as ExpressionStatement; | 7567 ExpressionStatement toNode = this._toNode as ExpressionStatement; |
| 7269 return javaBooleanAnd(isEqual(node.expression, toNode.expression), isEqual3(
node.semicolon, toNode.semicolon)); | 7568 return javaBooleanAnd(isEqual(node.expression, toNode.expression), isEqual3(
node.semicolon, toNode.semicolon)); |
| 7270 } | 7569 } |
| 7570 |
| 7271 bool visitExtendsClause(ExtendsClause node) { | 7571 bool visitExtendsClause(ExtendsClause node) { |
| 7272 ExtendsClause toNode = this._toNode as ExtendsClause; | 7572 ExtendsClause toNode = this._toNode as ExtendsClause; |
| 7273 return javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual(node.s
uperclass, toNode.superclass)); | 7573 return javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual(node.s
uperclass, toNode.superclass)); |
| 7274 } | 7574 } |
| 7575 |
| 7275 bool visitFieldDeclaration(FieldDeclaration node) { | 7576 bool visitFieldDeclaration(FieldDeclaration node) { |
| 7276 FieldDeclaration toNode = this._toNode as FieldDeclaration; | 7577 FieldDeclaration toNode = this._toNode as FieldDeclaration; |
| 7277 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual3(node.staticKeyword, toNode.staticKeyword)), isEqual(
node.fields, toNode.fields)), isEqual3(node.semicolon, toNode.semicolon)); | 7578 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual3(node.staticKeyword, toNode.staticKeyword)), isEqual(
node.fields, toNode.fields)), isEqual3(node.semicolon, toNode.semicolon)); |
| 7278 } | 7579 } |
| 7580 |
| 7279 bool visitFieldFormalParameter(FieldFormalParameter node) { | 7581 bool visitFieldFormalParameter(FieldFormalParameter node) { |
| 7280 FieldFormalParameter toNode = this._toNode as FieldFormalParameter; | 7582 FieldFormalParameter toNode = this._toNode as FieldFormalParameter; |
| 7281 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(isEqual(node.documentationComment, toNode.documentationComm
ent), isEqual2(node.metadata, toNode.metadata)), isEqual3(node.keyword, toNode.k
eyword)), isEqual(node.type, toNode.type)), isEqual3(node.thisToken, toNode.this
Token)), isEqual3(node.period, toNode.period)), isEqual(node.identifier, toNode.
identifier)); | 7583 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(isEqual(node.documentationComment, toNode.documentationComm
ent), isEqual2(node.metadata, toNode.metadata)), isEqual3(node.keyword, toNode.k
eyword)), isEqual(node.type, toNode.type)), isEqual3(node.thisToken, toNode.this
Token)), isEqual3(node.period, toNode.period)), isEqual(node.identifier, toNode.
identifier)); |
| 7282 } | 7584 } |
| 7585 |
| 7283 bool visitForEachStatement(ForEachStatement node) { | 7586 bool visitForEachStatement(ForEachStatement node) { |
| 7284 ForEachStatement toNode = this._toNode as ForEachStatement; | 7587 ForEachStatement toNode = this._toNode as ForEachStatement; |
| 7285 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(isEqual3(node.forKeyword, toNode.forKeyword), isEqual3(node
.leftParenthesis, toNode.leftParenthesis)), isEqual(node.loopVariable, toNode.lo
opVariable)), isEqual3(node.inKeyword, toNode.inKeyword)), isEqual(node.iterator
, toNode.iterator)), isEqual3(node.rightParenthesis, toNode.rightParenthesis)),
isEqual(node.body, toNode.body)); | 7588 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(isEqual3(node.forKeyword, toNode.forKeyword), isEqual3(node
.leftParenthesis, toNode.leftParenthesis)), isEqual(node.loopVariable, toNode.lo
opVariable)), isEqual3(node.inKeyword, toNode.inKeyword)), isEqual(node.iterator
, toNode.iterator)), isEqual3(node.rightParenthesis, toNode.rightParenthesis)),
isEqual(node.body, toNode.body)); |
| 7286 } | 7589 } |
| 7590 |
| 7287 bool visitFormalParameterList(FormalParameterList node) { | 7591 bool visitFormalParameterList(FormalParameterList node) { |
| 7288 FormalParameterList toNode = this._toNode as FormalParameterList; | 7592 FormalParameterList toNode = this._toNode as FormalParameterList; |
| 7289 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(
node.leftParenthesis, toNode.leftParenthesis), isEqual2(node.parameters, toNode.
parameters)), isEqual3(node.leftDelimiter, toNode.leftDelimiter)), isEqual3(node
.rightDelimiter, toNode.rightDelimiter)), isEqual3(node.rightParenthesis, toNode
.rightParenthesis)); | 7593 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(
node.leftParenthesis, toNode.leftParenthesis), isEqual2(node.parameters, toNode.
parameters)), isEqual3(node.leftDelimiter, toNode.leftDelimiter)), isEqual3(node
.rightDelimiter, toNode.rightDelimiter)), isEqual3(node.rightParenthesis, toNode
.rightParenthesis)); |
| 7290 } | 7594 } |
| 7595 |
| 7291 bool visitForStatement(ForStatement node) { | 7596 bool visitForStatement(ForStatement node) { |
| 7292 ForStatement toNode = this._toNode as ForStatement; | 7597 ForStatement toNode = this._toNode as ForStatement; |
| 7293 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(node.
forKeyword, toNode.forKeyword), isEqual3(node.leftParenthesis, toNode.leftParent
hesis)), isEqual(node.variables, toNode.variables)), isEqual(node.initialization
, toNode.initialization)), isEqual3(node.leftSeparator, toNode.leftSeparator)),
isEqual(node.condition, toNode.condition)), isEqual3(node.rightSeparator, toNode
.rightSeparator)), isEqual2(node.updaters, toNode.updaters)), isEqual3(node.righ
tParenthesis, toNode.rightParenthesis)), isEqual(node.body, toNode.body)); | 7598 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(node.
forKeyword, toNode.forKeyword), isEqual3(node.leftParenthesis, toNode.leftParent
hesis)), isEqual(node.variables, toNode.variables)), isEqual(node.initialization
, toNode.initialization)), isEqual3(node.leftSeparator, toNode.leftSeparator)),
isEqual(node.condition, toNode.condition)), isEqual3(node.rightSeparator, toNode
.rightSeparator)), isEqual2(node.updaters, toNode.updaters)), isEqual3(node.righ
tParenthesis, toNode.rightParenthesis)), isEqual(node.body, toNode.body)); |
| 7294 } | 7599 } |
| 7600 |
| 7295 bool visitFunctionDeclaration(FunctionDeclaration node) { | 7601 bool visitFunctionDeclaration(FunctionDeclaration node) { |
| 7296 FunctionDeclaration toNode = this._toNode as FunctionDeclaration; | 7602 FunctionDeclaration toNode = this._toNode as FunctionDeclaration; |
| 7297 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(isEqual(node.documentationComment, toNode.documentationComm
ent), isEqual2(node.metadata, toNode.metadata)), isEqual3(node.externalKeyword,
toNode.externalKeyword)), isEqual(node.returnType, toNode.returnType)), isEqual3
(node.propertyKeyword, toNode.propertyKeyword)), isEqual(node.name, toNode.name)
), isEqual(node.functionExpression, toNode.functionExpression)); | 7603 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(isEqual(node.documentationComment, toNode.documentationComm
ent), isEqual2(node.metadata, toNode.metadata)), isEqual3(node.externalKeyword,
toNode.externalKeyword)), isEqual(node.returnType, toNode.returnType)), isEqual3
(node.propertyKeyword, toNode.propertyKeyword)), isEqual(node.name, toNode.name)
), isEqual(node.functionExpression, toNode.functionExpression)); |
| 7298 } | 7604 } |
| 7605 |
| 7299 bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { | 7606 bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { |
| 7300 FunctionDeclarationStatement toNode = this._toNode as FunctionDeclarationSta
tement; | 7607 FunctionDeclarationStatement toNode = this._toNode as FunctionDeclarationSta
tement; |
| 7301 return isEqual(node.functionDeclaration, toNode.functionDeclaration); | 7608 return isEqual(node.functionDeclaration, toNode.functionDeclaration); |
| 7302 } | 7609 } |
| 7610 |
| 7303 bool visitFunctionExpression(FunctionExpression node) { | 7611 bool visitFunctionExpression(FunctionExpression node) { |
| 7304 FunctionExpression toNode = this._toNode as FunctionExpression; | 7612 FunctionExpression toNode = this._toNode as FunctionExpression; |
| 7305 if (javaBooleanAnd(isEqual(node.parameters, toNode.parameters), isEqual(node
.body, toNode.body))) { | 7613 if (javaBooleanAnd(isEqual(node.parameters, toNode.parameters), isEqual(node
.body, toNode.body))) { |
| 7306 toNode.element = node.element; | 7614 toNode.element = node.element; |
| 7307 toNode.propagatedType = node.propagatedType; | 7615 toNode.propagatedType = node.propagatedType; |
| 7308 toNode.staticType = node.staticType; | 7616 toNode.staticType = node.staticType; |
| 7309 return true; | 7617 return true; |
| 7310 } | 7618 } |
| 7311 return false; | 7619 return false; |
| 7312 } | 7620 } |
| 7621 |
| 7313 bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { | 7622 bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { |
| 7314 FunctionExpressionInvocation toNode = this._toNode as FunctionExpressionInvo
cation; | 7623 FunctionExpressionInvocation toNode = this._toNode as FunctionExpressionInvo
cation; |
| 7315 if (javaBooleanAnd(isEqual(node.function, toNode.function), isEqual(node.arg
umentList, toNode.argumentList))) { | 7624 if (javaBooleanAnd(isEqual(node.function, toNode.function), isEqual(node.arg
umentList, toNode.argumentList))) { |
| 7316 toNode.propagatedElement = node.propagatedElement; | 7625 toNode.propagatedElement = node.propagatedElement; |
| 7317 toNode.propagatedType = node.propagatedType; | 7626 toNode.propagatedType = node.propagatedType; |
| 7318 toNode.staticElement = node.staticElement; | 7627 toNode.staticElement = node.staticElement; |
| 7319 toNode.staticType = node.staticType; | 7628 toNode.staticType = node.staticType; |
| 7320 return true; | 7629 return true; |
| 7321 } | 7630 } |
| 7322 return false; | 7631 return false; |
| 7323 } | 7632 } |
| 7633 |
| 7324 bool visitFunctionTypeAlias(FunctionTypeAlias node) { | 7634 bool visitFunctionTypeAlias(FunctionTypeAlias node) { |
| 7325 FunctionTypeAlias toNode = this._toNode as FunctionTypeAlias; | 7635 FunctionTypeAlias toNode = this._toNode as FunctionTypeAlias; |
| 7326 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.documentationComment, toNode.do
cumentationComment), isEqual2(node.metadata, toNode.metadata)), isEqual3(node.ke
yword, toNode.keyword)), isEqual(node.returnType, toNode.returnType)), isEqual(n
ode.name, toNode.name)), isEqual(node.typeParameters, toNode.typeParameters)), i
sEqual(node.parameters, toNode.parameters)), isEqual3(node.semicolon, toNode.sem
icolon)); | 7636 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.documentationComment, toNode.do
cumentationComment), isEqual2(node.metadata, toNode.metadata)), isEqual3(node.ke
yword, toNode.keyword)), isEqual(node.returnType, toNode.returnType)), isEqual(n
ode.name, toNode.name)), isEqual(node.typeParameters, toNode.typeParameters)), i
sEqual(node.parameters, toNode.parameters)), isEqual3(node.semicolon, toNode.sem
icolon)); |
| 7327 } | 7637 } |
| 7638 |
| 7328 bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { | 7639 bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { |
| 7329 FunctionTypedFormalParameter toNode = this._toNode as FunctionTypedFormalPar
ameter; | 7640 FunctionTypedFormalParameter toNode = this._toNode as FunctionTypedFormalPar
ameter; |
| 7330 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual(node.returnType, toNode.returnType)), isEqual(node.id
entifier, toNode.identifier)), isEqual(node.parameters, toNode.parameters)); | 7641 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual(node.returnType, toNode.returnType)), isEqual(node.id
entifier, toNode.identifier)), isEqual(node.parameters, toNode.parameters)); |
| 7331 } | 7642 } |
| 7643 |
| 7332 bool visitHideCombinator(HideCombinator node) { | 7644 bool visitHideCombinator(HideCombinator node) { |
| 7333 HideCombinator toNode = this._toNode as HideCombinator; | 7645 HideCombinator toNode = this._toNode as HideCombinator; |
| 7334 return javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual2(node.
hiddenNames, toNode.hiddenNames)); | 7646 return javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual2(node.
hiddenNames, toNode.hiddenNames)); |
| 7335 } | 7647 } |
| 7648 |
| 7336 bool visitIfStatement(IfStatement node) { | 7649 bool visitIfStatement(IfStatement node) { |
| 7337 IfStatement toNode = this._toNode as IfStatement; | 7650 IfStatement toNode = this._toNode as IfStatement; |
| 7338 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(isEqual3(node.ifKeyword, toNode.ifKeyword), isEqual3(node.l
eftParenthesis, toNode.leftParenthesis)), isEqual(node.condition, toNode.conditi
on)), isEqual3(node.rightParenthesis, toNode.rightParenthesis)), isEqual(node.th
enStatement, toNode.thenStatement)), isEqual3(node.elseKeyword, toNode.elseKeywo
rd)), isEqual(node.elseStatement, toNode.elseStatement)); | 7651 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(isEqual3(node.ifKeyword, toNode.ifKeyword), isEqual3(node.l
eftParenthesis, toNode.leftParenthesis)), isEqual(node.condition, toNode.conditi
on)), isEqual3(node.rightParenthesis, toNode.rightParenthesis)), isEqual(node.th
enStatement, toNode.thenStatement)), isEqual3(node.elseKeyword, toNode.elseKeywo
rd)), isEqual(node.elseStatement, toNode.elseStatement)); |
| 7339 } | 7652 } |
| 7653 |
| 7340 bool visitImplementsClause(ImplementsClause node) { | 7654 bool visitImplementsClause(ImplementsClause node) { |
| 7341 ImplementsClause toNode = this._toNode as ImplementsClause; | 7655 ImplementsClause toNode = this._toNode as ImplementsClause; |
| 7342 return javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual2(node.
interfaces, toNode.interfaces)); | 7656 return javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual2(node.
interfaces, toNode.interfaces)); |
| 7343 } | 7657 } |
| 7658 |
| 7344 bool visitImportDirective(ImportDirective node) { | 7659 bool visitImportDirective(ImportDirective node) { |
| 7345 ImportDirective toNode = this._toNode as ImportDirective; | 7660 ImportDirective toNode = this._toNode as ImportDirective; |
| 7346 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanA
nd(javaBooleanAnd(javaBooleanAnd(isEqual(node.documentationComment, toNode.docum
entationComment), isEqual2(node.metadata, toNode.metadata)), isEqual3(node.keywo
rd, toNode.keyword)), isEqual(node.uri, toNode.uri)), isEqual3(node.asToken, toN
ode.asToken)), isEqual(node.prefix, toNode.prefix)), isEqual2(node.combinators,
toNode.combinators)), isEqual3(node.semicolon, toNode.semicolon))) { | 7661 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanA
nd(javaBooleanAnd(javaBooleanAnd(isEqual(node.documentationComment, toNode.docum
entationComment), isEqual2(node.metadata, toNode.metadata)), isEqual3(node.keywo
rd, toNode.keyword)), isEqual(node.uri, toNode.uri)), isEqual3(node.asToken, toN
ode.asToken)), isEqual(node.prefix, toNode.prefix)), isEqual2(node.combinators,
toNode.combinators)), isEqual3(node.semicolon, toNode.semicolon))) { |
| 7347 toNode.element = node.element; | 7662 toNode.element = node.element; |
| 7348 return true; | 7663 return true; |
| 7349 } | 7664 } |
| 7350 return false; | 7665 return false; |
| 7351 } | 7666 } |
| 7667 |
| 7352 bool visitIndexExpression(IndexExpression node) { | 7668 bool visitIndexExpression(IndexExpression node) { |
| 7353 IndexExpression toNode = this._toNode as IndexExpression; | 7669 IndexExpression toNode = this._toNode as IndexExpression; |
| 7354 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.target, toNode
.target), isEqual3(node.leftBracket, toNode.leftBracket)), isEqual(node.index, t
oNode.index)), isEqual3(node.rightBracket, toNode.rightBracket))) { | 7670 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.target, toNode
.target), isEqual3(node.leftBracket, toNode.leftBracket)), isEqual(node.index, t
oNode.index)), isEqual3(node.rightBracket, toNode.rightBracket))) { |
| 7355 toNode.auxiliaryElements = node.auxiliaryElements; | 7671 toNode.auxiliaryElements = node.auxiliaryElements; |
| 7356 toNode.propagatedElement = node.propagatedElement; | 7672 toNode.propagatedElement = node.propagatedElement; |
| 7357 toNode.propagatedType = node.propagatedType; | 7673 toNode.propagatedType = node.propagatedType; |
| 7358 toNode.staticElement = node.staticElement; | 7674 toNode.staticElement = node.staticElement; |
| 7359 toNode.staticType = node.staticType; | 7675 toNode.staticType = node.staticType; |
| 7360 return true; | 7676 return true; |
| 7361 } | 7677 } |
| 7362 return false; | 7678 return false; |
| 7363 } | 7679 } |
| 7680 |
| 7364 bool visitInstanceCreationExpression(InstanceCreationExpression node) { | 7681 bool visitInstanceCreationExpression(InstanceCreationExpression node) { |
| 7365 InstanceCreationExpression toNode = this._toNode as InstanceCreationExpressi
on; | 7682 InstanceCreationExpression toNode = this._toNode as InstanceCreationExpressi
on; |
| 7366 if (javaBooleanAnd(javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), is
Equal(node.constructorName, toNode.constructorName)), isEqual(node.argumentList,
toNode.argumentList))) { | 7683 if (javaBooleanAnd(javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), is
Equal(node.constructorName, toNode.constructorName)), isEqual(node.argumentList,
toNode.argumentList))) { |
| 7367 toNode.propagatedType = node.propagatedType; | 7684 toNode.propagatedType = node.propagatedType; |
| 7368 toNode.staticElement = node.staticElement; | 7685 toNode.staticElement = node.staticElement; |
| 7369 toNode.staticType = node.staticType; | 7686 toNode.staticType = node.staticType; |
| 7370 return true; | 7687 return true; |
| 7371 } | 7688 } |
| 7372 return false; | 7689 return false; |
| 7373 } | 7690 } |
| 7691 |
| 7374 bool visitIntegerLiteral(IntegerLiteral node) { | 7692 bool visitIntegerLiteral(IntegerLiteral node) { |
| 7375 IntegerLiteral toNode = this._toNode as IntegerLiteral; | 7693 IntegerLiteral toNode = this._toNode as IntegerLiteral; |
| 7376 if (javaBooleanAnd(isEqual3(node.literal, toNode.literal), identical(node.va
lue, toNode.value))) { | 7694 if (javaBooleanAnd(isEqual3(node.literal, toNode.literal), identical(node.va
lue, toNode.value))) { |
| 7377 toNode.propagatedType = node.propagatedType; | 7695 toNode.propagatedType = node.propagatedType; |
| 7378 toNode.staticType = node.staticType; | 7696 toNode.staticType = node.staticType; |
| 7379 return true; | 7697 return true; |
| 7380 } | 7698 } |
| 7381 return false; | 7699 return false; |
| 7382 } | 7700 } |
| 7701 |
| 7383 bool visitInterpolationExpression(InterpolationExpression node) { | 7702 bool visitInterpolationExpression(InterpolationExpression node) { |
| 7384 InterpolationExpression toNode = this._toNode as InterpolationExpression; | 7703 InterpolationExpression toNode = this._toNode as InterpolationExpression; |
| 7385 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.leftBracket, toNode.leftB
racket), isEqual(node.expression, toNode.expression)), isEqual3(node.rightBracke
t, toNode.rightBracket)); | 7704 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.leftBracket, toNode.leftB
racket), isEqual(node.expression, toNode.expression)), isEqual3(node.rightBracke
t, toNode.rightBracket)); |
| 7386 } | 7705 } |
| 7706 |
| 7387 bool visitInterpolationString(InterpolationString node) { | 7707 bool visitInterpolationString(InterpolationString node) { |
| 7388 InterpolationString toNode = this._toNode as InterpolationString; | 7708 InterpolationString toNode = this._toNode as InterpolationString; |
| 7389 return javaBooleanAnd(isEqual3(node.contents, toNode.contents), node.value =
= toNode.value); | 7709 return javaBooleanAnd(isEqual3(node.contents, toNode.contents), node.value =
= toNode.value); |
| 7390 } | 7710 } |
| 7711 |
| 7391 bool visitIsExpression(IsExpression node) { | 7712 bool visitIsExpression(IsExpression node) { |
| 7392 IsExpression toNode = this._toNode as IsExpression; | 7713 IsExpression toNode = this._toNode as IsExpression; |
| 7393 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.expression, to
Node.expression), isEqual3(node.isOperator, toNode.isOperator)), isEqual3(node.n
otOperator, toNode.notOperator)), isEqual(node.type, toNode.type))) { | 7714 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.expression, to
Node.expression), isEqual3(node.isOperator, toNode.isOperator)), isEqual3(node.n
otOperator, toNode.notOperator)), isEqual(node.type, toNode.type))) { |
| 7394 toNode.propagatedType = node.propagatedType; | 7715 toNode.propagatedType = node.propagatedType; |
| 7395 toNode.staticType = node.staticType; | 7716 toNode.staticType = node.staticType; |
| 7396 return true; | 7717 return true; |
| 7397 } | 7718 } |
| 7398 return false; | 7719 return false; |
| 7399 } | 7720 } |
| 7721 |
| 7400 bool visitLabel(Label node) { | 7722 bool visitLabel(Label node) { |
| 7401 Label toNode = this._toNode as Label; | 7723 Label toNode = this._toNode as Label; |
| 7402 return javaBooleanAnd(isEqual(node.label, toNode.label), isEqual3(node.colon
, toNode.colon)); | 7724 return javaBooleanAnd(isEqual(node.label, toNode.label), isEqual3(node.colon
, toNode.colon)); |
| 7403 } | 7725 } |
| 7726 |
| 7404 bool visitLabeledStatement(LabeledStatement node) { | 7727 bool visitLabeledStatement(LabeledStatement node) { |
| 7405 LabeledStatement toNode = this._toNode as LabeledStatement; | 7728 LabeledStatement toNode = this._toNode as LabeledStatement; |
| 7406 return javaBooleanAnd(isEqual2(node.labels, toNode.labels), isEqual(node.sta
tement, toNode.statement)); | 7729 return javaBooleanAnd(isEqual2(node.labels, toNode.labels), isEqual(node.sta
tement, toNode.statement)); |
| 7407 } | 7730 } |
| 7731 |
| 7408 bool visitLibraryDirective(LibraryDirective node) { | 7732 bool visitLibraryDirective(LibraryDirective node) { |
| 7409 LibraryDirective toNode = this._toNode as LibraryDirective; | 7733 LibraryDirective toNode = this._toNode as LibraryDirective; |
| 7410 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual3(node.libraryToken, toNode.libraryToken)), isEqual(no
de.name, toNode.name)), isEqual3(node.semicolon, toNode.semicolon)); | 7734 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual3(node.libraryToken, toNode.libraryToken)), isEqual(no
de.name, toNode.name)), isEqual3(node.semicolon, toNode.semicolon)); |
| 7411 } | 7735 } |
| 7736 |
| 7412 bool visitLibraryIdentifier(LibraryIdentifier node) { | 7737 bool visitLibraryIdentifier(LibraryIdentifier node) { |
| 7413 LibraryIdentifier toNode = this._toNode as LibraryIdentifier; | 7738 LibraryIdentifier toNode = this._toNode as LibraryIdentifier; |
| 7414 if (isEqual2(node.components, toNode.components)) { | 7739 if (isEqual2(node.components, toNode.components)) { |
| 7415 toNode.propagatedType = node.propagatedType; | 7740 toNode.propagatedType = node.propagatedType; |
| 7416 toNode.staticType = node.staticType; | 7741 toNode.staticType = node.staticType; |
| 7417 return true; | 7742 return true; |
| 7418 } | 7743 } |
| 7419 return false; | 7744 return false; |
| 7420 } | 7745 } |
| 7746 |
| 7421 bool visitListLiteral(ListLiteral node) { | 7747 bool visitListLiteral(ListLiteral node) { |
| 7422 ListLiteral toNode = this._toNode as ListLiteral; | 7748 ListLiteral toNode = this._toNode as ListLiteral; |
| 7423 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(nod
e.constKeyword, toNode.constKeyword), isEqual(node.typeArguments, toNode.typeArg
uments)), isEqual3(node.leftBracket, toNode.leftBracket)), isEqual2(node.element
s, toNode.elements)), isEqual3(node.rightBracket, toNode.rightBracket))) { | 7749 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(nod
e.constKeyword, toNode.constKeyword), isEqual(node.typeArguments, toNode.typeArg
uments)), isEqual3(node.leftBracket, toNode.leftBracket)), isEqual2(node.element
s, toNode.elements)), isEqual3(node.rightBracket, toNode.rightBracket))) { |
| 7424 toNode.propagatedType = node.propagatedType; | 7750 toNode.propagatedType = node.propagatedType; |
| 7425 toNode.staticType = node.staticType; | 7751 toNode.staticType = node.staticType; |
| 7426 return true; | 7752 return true; |
| 7427 } | 7753 } |
| 7428 return false; | 7754 return false; |
| 7429 } | 7755 } |
| 7756 |
| 7430 bool visitMapLiteral(MapLiteral node) { | 7757 bool visitMapLiteral(MapLiteral node) { |
| 7431 MapLiteral toNode = this._toNode as MapLiteral; | 7758 MapLiteral toNode = this._toNode as MapLiteral; |
| 7432 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(nod
e.constKeyword, toNode.constKeyword), isEqual(node.typeArguments, toNode.typeArg
uments)), isEqual3(node.leftBracket, toNode.leftBracket)), isEqual2(node.entries
, toNode.entries)), isEqual3(node.rightBracket, toNode.rightBracket))) { | 7759 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(nod
e.constKeyword, toNode.constKeyword), isEqual(node.typeArguments, toNode.typeArg
uments)), isEqual3(node.leftBracket, toNode.leftBracket)), isEqual2(node.entries
, toNode.entries)), isEqual3(node.rightBracket, toNode.rightBracket))) { |
| 7433 toNode.propagatedType = node.propagatedType; | 7760 toNode.propagatedType = node.propagatedType; |
| 7434 toNode.staticType = node.staticType; | 7761 toNode.staticType = node.staticType; |
| 7435 return true; | 7762 return true; |
| 7436 } | 7763 } |
| 7437 return false; | 7764 return false; |
| 7438 } | 7765 } |
| 7766 |
| 7439 bool visitMapLiteralEntry(MapLiteralEntry node) { | 7767 bool visitMapLiteralEntry(MapLiteralEntry node) { |
| 7440 MapLiteralEntry toNode = this._toNode as MapLiteralEntry; | 7768 MapLiteralEntry toNode = this._toNode as MapLiteralEntry; |
| 7441 return javaBooleanAnd(javaBooleanAnd(isEqual(node.key, toNode.key), isEqual3
(node.separator, toNode.separator)), isEqual(node.value, toNode.value)); | 7769 return javaBooleanAnd(javaBooleanAnd(isEqual(node.key, toNode.key), isEqual3
(node.separator, toNode.separator)), isEqual(node.value, toNode.value)); |
| 7442 } | 7770 } |
| 7771 |
| 7443 bool visitMethodDeclaration(MethodDeclaration node) { | 7772 bool visitMethodDeclaration(MethodDeclaration node) { |
| 7444 MethodDeclaration toNode = this._toNode as MethodDeclaration; | 7773 MethodDeclaration toNode = this._toNode as MethodDeclaration; |
| 7445 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.d
ocumentationComment, toNode.documentationComment), isEqual2(node.metadata, toNod
e.metadata)), isEqual3(node.externalKeyword, toNode.externalKeyword)), isEqual3(
node.modifierKeyword, toNode.modifierKeyword)), isEqual(node.returnType, toNode.
returnType)), isEqual3(node.propertyKeyword, toNode.propertyKeyword)), isEqual3(
node.propertyKeyword, toNode.propertyKeyword)), isEqual(node.name, toNode.name))
, isEqual(node.parameters, toNode.parameters)), isEqual(node.body, toNode.body))
; | 7774 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.d
ocumentationComment, toNode.documentationComment), isEqual2(node.metadata, toNod
e.metadata)), isEqual3(node.externalKeyword, toNode.externalKeyword)), isEqual3(
node.modifierKeyword, toNode.modifierKeyword)), isEqual(node.returnType, toNode.
returnType)), isEqual3(node.propertyKeyword, toNode.propertyKeyword)), isEqual3(
node.propertyKeyword, toNode.propertyKeyword)), isEqual(node.name, toNode.name))
, isEqual(node.parameters, toNode.parameters)), isEqual(node.body, toNode.body))
; |
| 7446 } | 7775 } |
| 7776 |
| 7447 bool visitMethodInvocation(MethodInvocation node) { | 7777 bool visitMethodInvocation(MethodInvocation node) { |
| 7448 MethodInvocation toNode = this._toNode as MethodInvocation; | 7778 MethodInvocation toNode = this._toNode as MethodInvocation; |
| 7449 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.target, toNode
.target), isEqual3(node.period, toNode.period)), isEqual(node.methodName, toNode
.methodName)), isEqual(node.argumentList, toNode.argumentList))) { | 7779 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.target, toNode
.target), isEqual3(node.period, toNode.period)), isEqual(node.methodName, toNode
.methodName)), isEqual(node.argumentList, toNode.argumentList))) { |
| 7450 toNode.propagatedType = node.propagatedType; | 7780 toNode.propagatedType = node.propagatedType; |
| 7451 toNode.staticType = node.staticType; | 7781 toNode.staticType = node.staticType; |
| 7452 return true; | 7782 return true; |
| 7453 } | 7783 } |
| 7454 return false; | 7784 return false; |
| 7455 } | 7785 } |
| 7786 |
| 7456 bool visitNamedExpression(NamedExpression node) { | 7787 bool visitNamedExpression(NamedExpression node) { |
| 7457 NamedExpression toNode = this._toNode as NamedExpression; | 7788 NamedExpression toNode = this._toNode as NamedExpression; |
| 7458 if (javaBooleanAnd(isEqual(node.name, toNode.name), isEqual(node.expression,
toNode.expression))) { | 7789 if (javaBooleanAnd(isEqual(node.name, toNode.name), isEqual(node.expression,
toNode.expression))) { |
| 7459 toNode.propagatedType = node.propagatedType; | 7790 toNode.propagatedType = node.propagatedType; |
| 7460 toNode.staticType = node.staticType; | 7791 toNode.staticType = node.staticType; |
| 7461 return true; | 7792 return true; |
| 7462 } | 7793 } |
| 7463 return false; | 7794 return false; |
| 7464 } | 7795 } |
| 7796 |
| 7465 bool visitNativeClause(NativeClause node) { | 7797 bool visitNativeClause(NativeClause node) { |
| 7466 NativeClause toNode = this._toNode as NativeClause; | 7798 NativeClause toNode = this._toNode as NativeClause; |
| 7467 return javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual(node.n
ame, toNode.name)); | 7799 return javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual(node.n
ame, toNode.name)); |
| 7468 } | 7800 } |
| 7801 |
| 7469 bool visitNativeFunctionBody(NativeFunctionBody node) { | 7802 bool visitNativeFunctionBody(NativeFunctionBody node) { |
| 7470 NativeFunctionBody toNode = this._toNode as NativeFunctionBody; | 7803 NativeFunctionBody toNode = this._toNode as NativeFunctionBody; |
| 7471 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.nativeToken, toNode.nativ
eToken), isEqual(node.stringLiteral, toNode.stringLiteral)), isEqual3(node.semic
olon, toNode.semicolon)); | 7804 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.nativeToken, toNode.nativ
eToken), isEqual(node.stringLiteral, toNode.stringLiteral)), isEqual3(node.semic
olon, toNode.semicolon)); |
| 7472 } | 7805 } |
| 7806 |
| 7473 bool visitNullLiteral(NullLiteral node) { | 7807 bool visitNullLiteral(NullLiteral node) { |
| 7474 NullLiteral toNode = this._toNode as NullLiteral; | 7808 NullLiteral toNode = this._toNode as NullLiteral; |
| 7475 if (isEqual3(node.literal, toNode.literal)) { | 7809 if (isEqual3(node.literal, toNode.literal)) { |
| 7476 toNode.propagatedType = node.propagatedType; | 7810 toNode.propagatedType = node.propagatedType; |
| 7477 toNode.staticType = node.staticType; | 7811 toNode.staticType = node.staticType; |
| 7478 return true; | 7812 return true; |
| 7479 } | 7813 } |
| 7480 return false; | 7814 return false; |
| 7481 } | 7815 } |
| 7816 |
| 7482 bool visitParenthesizedExpression(ParenthesizedExpression node) { | 7817 bool visitParenthesizedExpression(ParenthesizedExpression node) { |
| 7483 ParenthesizedExpression toNode = this._toNode as ParenthesizedExpression; | 7818 ParenthesizedExpression toNode = this._toNode as ParenthesizedExpression; |
| 7484 if (javaBooleanAnd(javaBooleanAnd(isEqual3(node.leftParenthesis, toNode.left
Parenthesis), isEqual(node.expression, toNode.expression)), isEqual3(node.rightP
arenthesis, toNode.rightParenthesis))) { | 7819 if (javaBooleanAnd(javaBooleanAnd(isEqual3(node.leftParenthesis, toNode.left
Parenthesis), isEqual(node.expression, toNode.expression)), isEqual3(node.rightP
arenthesis, toNode.rightParenthesis))) { |
| 7485 toNode.propagatedType = node.propagatedType; | 7820 toNode.propagatedType = node.propagatedType; |
| 7486 toNode.staticType = node.staticType; | 7821 toNode.staticType = node.staticType; |
| 7487 return true; | 7822 return true; |
| 7488 } | 7823 } |
| 7489 return false; | 7824 return false; |
| 7490 } | 7825 } |
| 7826 |
| 7491 bool visitPartDirective(PartDirective node) { | 7827 bool visitPartDirective(PartDirective node) { |
| 7492 PartDirective toNode = this._toNode as PartDirective; | 7828 PartDirective toNode = this._toNode as PartDirective; |
| 7493 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node
.documentationComment, toNode.documentationComment), isEqual2(node.metadata, toN
ode.metadata)), isEqual3(node.partToken, toNode.partToken)), isEqual(node.uri, t
oNode.uri)), isEqual3(node.semicolon, toNode.semicolon))) { | 7829 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node
.documentationComment, toNode.documentationComment), isEqual2(node.metadata, toN
ode.metadata)), isEqual3(node.partToken, toNode.partToken)), isEqual(node.uri, t
oNode.uri)), isEqual3(node.semicolon, toNode.semicolon))) { |
| 7494 toNode.element = node.element; | 7830 toNode.element = node.element; |
| 7495 return true; | 7831 return true; |
| 7496 } | 7832 } |
| 7497 return false; | 7833 return false; |
| 7498 } | 7834 } |
| 7835 |
| 7499 bool visitPartOfDirective(PartOfDirective node) { | 7836 bool visitPartOfDirective(PartOfDirective node) { |
| 7500 PartOfDirective toNode = this._toNode as PartOfDirective; | 7837 PartOfDirective toNode = this._toNode as PartOfDirective; |
| 7501 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanA
nd(isEqual(node.documentationComment, toNode.documentationComment), isEqual2(nod
e.metadata, toNode.metadata)), isEqual3(node.partToken, toNode.partToken)), isEq
ual3(node.ofToken, toNode.ofToken)), isEqual(node.libraryName, toNode.libraryNam
e)), isEqual3(node.semicolon, toNode.semicolon))) { | 7838 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanA
nd(isEqual(node.documentationComment, toNode.documentationComment), isEqual2(nod
e.metadata, toNode.metadata)), isEqual3(node.partToken, toNode.partToken)), isEq
ual3(node.ofToken, toNode.ofToken)), isEqual(node.libraryName, toNode.libraryNam
e)), isEqual3(node.semicolon, toNode.semicolon))) { |
| 7502 toNode.element = node.element; | 7839 toNode.element = node.element; |
| 7503 return true; | 7840 return true; |
| 7504 } | 7841 } |
| 7505 return false; | 7842 return false; |
| 7506 } | 7843 } |
| 7844 |
| 7507 bool visitPostfixExpression(PostfixExpression node) { | 7845 bool visitPostfixExpression(PostfixExpression node) { |
| 7508 PostfixExpression toNode = this._toNode as PostfixExpression; | 7846 PostfixExpression toNode = this._toNode as PostfixExpression; |
| 7509 if (javaBooleanAnd(isEqual(node.operand, toNode.operand), isEqual3(node.oper
ator, toNode.operator))) { | 7847 if (javaBooleanAnd(isEqual(node.operand, toNode.operand), isEqual3(node.oper
ator, toNode.operator))) { |
| 7510 toNode.propagatedElement = node.propagatedElement; | 7848 toNode.propagatedElement = node.propagatedElement; |
| 7511 toNode.propagatedType = node.propagatedType; | 7849 toNode.propagatedType = node.propagatedType; |
| 7512 toNode.staticElement = node.staticElement; | 7850 toNode.staticElement = node.staticElement; |
| 7513 toNode.staticType = node.staticType; | 7851 toNode.staticType = node.staticType; |
| 7514 return true; | 7852 return true; |
| 7515 } | 7853 } |
| 7516 return false; | 7854 return false; |
| 7517 } | 7855 } |
| 7856 |
| 7518 bool visitPrefixedIdentifier(PrefixedIdentifier node) { | 7857 bool visitPrefixedIdentifier(PrefixedIdentifier node) { |
| 7519 PrefixedIdentifier toNode = this._toNode as PrefixedIdentifier; | 7858 PrefixedIdentifier toNode = this._toNode as PrefixedIdentifier; |
| 7520 if (javaBooleanAnd(javaBooleanAnd(isEqual(node.prefix, toNode.prefix), isEqu
al3(node.period, toNode.period)), isEqual(node.identifier, toNode.identifier)))
{ | 7859 if (javaBooleanAnd(javaBooleanAnd(isEqual(node.prefix, toNode.prefix), isEqu
al3(node.period, toNode.period)), isEqual(node.identifier, toNode.identifier)))
{ |
| 7521 toNode.propagatedType = node.propagatedType; | 7860 toNode.propagatedType = node.propagatedType; |
| 7522 toNode.staticType = node.staticType; | 7861 toNode.staticType = node.staticType; |
| 7523 return true; | 7862 return true; |
| 7524 } | 7863 } |
| 7525 return false; | 7864 return false; |
| 7526 } | 7865 } |
| 7866 |
| 7527 bool visitPrefixExpression(PrefixExpression node) { | 7867 bool visitPrefixExpression(PrefixExpression node) { |
| 7528 PrefixExpression toNode = this._toNode as PrefixExpression; | 7868 PrefixExpression toNode = this._toNode as PrefixExpression; |
| 7529 if (javaBooleanAnd(isEqual3(node.operator, toNode.operator), isEqual(node.op
erand, toNode.operand))) { | 7869 if (javaBooleanAnd(isEqual3(node.operator, toNode.operator), isEqual(node.op
erand, toNode.operand))) { |
| 7530 toNode.propagatedElement = node.propagatedElement; | 7870 toNode.propagatedElement = node.propagatedElement; |
| 7531 toNode.propagatedType = node.propagatedType; | 7871 toNode.propagatedType = node.propagatedType; |
| 7532 toNode.staticElement = node.staticElement; | 7872 toNode.staticElement = node.staticElement; |
| 7533 toNode.staticType = node.staticType; | 7873 toNode.staticType = node.staticType; |
| 7534 return true; | 7874 return true; |
| 7535 } | 7875 } |
| 7536 return false; | 7876 return false; |
| 7537 } | 7877 } |
| 7878 |
| 7538 bool visitPropertyAccess(PropertyAccess node) { | 7879 bool visitPropertyAccess(PropertyAccess node) { |
| 7539 PropertyAccess toNode = this._toNode as PropertyAccess; | 7880 PropertyAccess toNode = this._toNode as PropertyAccess; |
| 7540 if (javaBooleanAnd(javaBooleanAnd(isEqual(node.target, toNode.target), isEqu
al3(node.operator, toNode.operator)), isEqual(node.propertyName, toNode.property
Name))) { | 7881 if (javaBooleanAnd(javaBooleanAnd(isEqual(node.target, toNode.target), isEqu
al3(node.operator, toNode.operator)), isEqual(node.propertyName, toNode.property
Name))) { |
| 7541 toNode.propagatedType = node.propagatedType; | 7882 toNode.propagatedType = node.propagatedType; |
| 7542 toNode.staticType = node.staticType; | 7883 toNode.staticType = node.staticType; |
| 7543 return true; | 7884 return true; |
| 7544 } | 7885 } |
| 7545 return false; | 7886 return false; |
| 7546 } | 7887 } |
| 7888 |
| 7547 bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation no
de) { | 7889 bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation no
de) { |
| 7548 RedirectingConstructorInvocation toNode = this._toNode as RedirectingConstru
ctorInvocation; | 7890 RedirectingConstructorInvocation toNode = this._toNode as RedirectingConstru
ctorInvocation; |
| 7549 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(node.keyword, toNo
de.keyword), isEqual3(node.period, toNode.period)), isEqual(node.constructorName
, toNode.constructorName)), isEqual(node.argumentList, toNode.argumentList))) { | 7891 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(node.keyword, toNo
de.keyword), isEqual3(node.period, toNode.period)), isEqual(node.constructorName
, toNode.constructorName)), isEqual(node.argumentList, toNode.argumentList))) { |
| 7550 toNode.staticElement = node.staticElement; | 7892 toNode.staticElement = node.staticElement; |
| 7551 return true; | 7893 return true; |
| 7552 } | 7894 } |
| 7553 return false; | 7895 return false; |
| 7554 } | 7896 } |
| 7897 |
| 7555 bool visitRethrowExpression(RethrowExpression node) { | 7898 bool visitRethrowExpression(RethrowExpression node) { |
| 7556 RethrowExpression toNode = this._toNode as RethrowExpression; | 7899 RethrowExpression toNode = this._toNode as RethrowExpression; |
| 7557 if (isEqual3(node.keyword, toNode.keyword)) { | 7900 if (isEqual3(node.keyword, toNode.keyword)) { |
| 7558 toNode.propagatedType = node.propagatedType; | 7901 toNode.propagatedType = node.propagatedType; |
| 7559 toNode.staticType = node.staticType; | 7902 toNode.staticType = node.staticType; |
| 7560 return true; | 7903 return true; |
| 7561 } | 7904 } |
| 7562 return false; | 7905 return false; |
| 7563 } | 7906 } |
| 7907 |
| 7564 bool visitReturnStatement(ReturnStatement node) { | 7908 bool visitReturnStatement(ReturnStatement node) { |
| 7565 ReturnStatement toNode = this._toNode as ReturnStatement; | 7909 ReturnStatement toNode = this._toNode as ReturnStatement; |
| 7566 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.keyword, toNode.keyword),
isEqual(node.expression, toNode.expression)), isEqual3(node.semicolon, toNode.s
emicolon)); | 7910 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.keyword, toNode.keyword),
isEqual(node.expression, toNode.expression)), isEqual3(node.semicolon, toNode.s
emicolon)); |
| 7567 } | 7911 } |
| 7912 |
| 7568 bool visitScriptTag(ScriptTag node) { | 7913 bool visitScriptTag(ScriptTag node) { |
| 7569 ScriptTag toNode = this._toNode as ScriptTag; | 7914 ScriptTag toNode = this._toNode as ScriptTag; |
| 7570 return isEqual3(node.scriptTag, toNode.scriptTag); | 7915 return isEqual3(node.scriptTag, toNode.scriptTag); |
| 7571 } | 7916 } |
| 7917 |
| 7572 bool visitShowCombinator(ShowCombinator node) { | 7918 bool visitShowCombinator(ShowCombinator node) { |
| 7573 ShowCombinator toNode = this._toNode as ShowCombinator; | 7919 ShowCombinator toNode = this._toNode as ShowCombinator; |
| 7574 return javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual2(node.
shownNames, toNode.shownNames)); | 7920 return javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual2(node.
shownNames, toNode.shownNames)); |
| 7575 } | 7921 } |
| 7922 |
| 7576 bool visitSimpleFormalParameter(SimpleFormalParameter node) { | 7923 bool visitSimpleFormalParameter(SimpleFormalParameter node) { |
| 7577 SimpleFormalParameter toNode = this._toNode as SimpleFormalParameter; | 7924 SimpleFormalParameter toNode = this._toNode as SimpleFormalParameter; |
| 7578 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual3(node.keyword, toNode.keyword)), isEqual(node.type, t
oNode.type)), isEqual(node.identifier, toNode.identifier)); | 7925 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual3(node.keyword, toNode.keyword)), isEqual(node.type, t
oNode.type)), isEqual(node.identifier, toNode.identifier)); |
| 7579 } | 7926 } |
| 7927 |
| 7580 bool visitSimpleIdentifier(SimpleIdentifier node) { | 7928 bool visitSimpleIdentifier(SimpleIdentifier node) { |
| 7581 SimpleIdentifier toNode = this._toNode as SimpleIdentifier; | 7929 SimpleIdentifier toNode = this._toNode as SimpleIdentifier; |
| 7582 if (isEqual3(node.token, toNode.token)) { | 7930 if (isEqual3(node.token, toNode.token)) { |
| 7583 toNode.staticElement = node.staticElement; | 7931 toNode.staticElement = node.staticElement; |
| 7584 toNode.staticType = node.staticType; | 7932 toNode.staticType = node.staticType; |
| 7585 toNode.propagatedElement = node.propagatedElement; | 7933 toNode.propagatedElement = node.propagatedElement; |
| 7586 toNode.propagatedType = node.propagatedType; | 7934 toNode.propagatedType = node.propagatedType; |
| 7587 toNode.auxiliaryElements = node.auxiliaryElements; | 7935 toNode.auxiliaryElements = node.auxiliaryElements; |
| 7588 return true; | 7936 return true; |
| 7589 } | 7937 } |
| 7590 return false; | 7938 return false; |
| 7591 } | 7939 } |
| 7940 |
| 7592 bool visitSimpleStringLiteral(SimpleStringLiteral node) { | 7941 bool visitSimpleStringLiteral(SimpleStringLiteral node) { |
| 7593 SimpleStringLiteral toNode = this._toNode as SimpleStringLiteral; | 7942 SimpleStringLiteral toNode = this._toNode as SimpleStringLiteral; |
| 7594 if (javaBooleanAnd(isEqual3(node.literal, toNode.literal), identical(node.va
lue, toNode.value))) { | 7943 if (javaBooleanAnd(isEqual3(node.literal, toNode.literal), identical(node.va
lue, toNode.value))) { |
| 7595 toNode.propagatedType = node.propagatedType; | 7944 toNode.propagatedType = node.propagatedType; |
| 7596 toNode.staticType = node.staticType; | 7945 toNode.staticType = node.staticType; |
| 7597 return true; | 7946 return true; |
| 7598 } | 7947 } |
| 7599 return false; | 7948 return false; |
| 7600 } | 7949 } |
| 7950 |
| 7601 bool visitStringInterpolation(StringInterpolation node) { | 7951 bool visitStringInterpolation(StringInterpolation node) { |
| 7602 StringInterpolation toNode = this._toNode as StringInterpolation; | 7952 StringInterpolation toNode = this._toNode as StringInterpolation; |
| 7603 if (isEqual2(node.elements, toNode.elements)) { | 7953 if (isEqual2(node.elements, toNode.elements)) { |
| 7604 toNode.propagatedType = node.propagatedType; | 7954 toNode.propagatedType = node.propagatedType; |
| 7605 toNode.staticType = node.staticType; | 7955 toNode.staticType = node.staticType; |
| 7606 return true; | 7956 return true; |
| 7607 } | 7957 } |
| 7608 return false; | 7958 return false; |
| 7609 } | 7959 } |
| 7960 |
| 7610 bool visitSuperConstructorInvocation(SuperConstructorInvocation node) { | 7961 bool visitSuperConstructorInvocation(SuperConstructorInvocation node) { |
| 7611 SuperConstructorInvocation toNode = this._toNode as SuperConstructorInvocati
on; | 7962 SuperConstructorInvocation toNode = this._toNode as SuperConstructorInvocati
on; |
| 7612 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(node.keyword, toNo
de.keyword), isEqual3(node.period, toNode.period)), isEqual(node.constructorName
, toNode.constructorName)), isEqual(node.argumentList, toNode.argumentList))) { | 7963 if (javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(node.keyword, toNo
de.keyword), isEqual3(node.period, toNode.period)), isEqual(node.constructorName
, toNode.constructorName)), isEqual(node.argumentList, toNode.argumentList))) { |
| 7613 toNode.staticElement = node.staticElement; | 7964 toNode.staticElement = node.staticElement; |
| 7614 return true; | 7965 return true; |
| 7615 } | 7966 } |
| 7616 return false; | 7967 return false; |
| 7617 } | 7968 } |
| 7969 |
| 7618 bool visitSuperExpression(SuperExpression node) { | 7970 bool visitSuperExpression(SuperExpression node) { |
| 7619 SuperExpression toNode = this._toNode as SuperExpression; | 7971 SuperExpression toNode = this._toNode as SuperExpression; |
| 7620 if (isEqual3(node.keyword, toNode.keyword)) { | 7972 if (isEqual3(node.keyword, toNode.keyword)) { |
| 7621 toNode.propagatedType = node.propagatedType; | 7973 toNode.propagatedType = node.propagatedType; |
| 7622 toNode.staticType = node.staticType; | 7974 toNode.staticType = node.staticType; |
| 7623 return true; | 7975 return true; |
| 7624 } | 7976 } |
| 7625 return false; | 7977 return false; |
| 7626 } | 7978 } |
| 7979 |
| 7627 bool visitSwitchCase(SwitchCase node) { | 7980 bool visitSwitchCase(SwitchCase node) { |
| 7628 SwitchCase toNode = this._toNode as SwitchCase; | 7981 SwitchCase toNode = this._toNode as SwitchCase; |
| 7629 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual2(
node.labels, toNode.labels), isEqual3(node.keyword, toNode.keyword)), isEqual(no
de.expression, toNode.expression)), isEqual3(node.colon, toNode.colon)), isEqual
2(node.statements, toNode.statements)); | 7982 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual2(
node.labels, toNode.labels), isEqual3(node.keyword, toNode.keyword)), isEqual(no
de.expression, toNode.expression)), isEqual3(node.colon, toNode.colon)), isEqual
2(node.statements, toNode.statements)); |
| 7630 } | 7983 } |
| 7984 |
| 7631 bool visitSwitchDefault(SwitchDefault node) { | 7985 bool visitSwitchDefault(SwitchDefault node) { |
| 7632 SwitchDefault toNode = this._toNode as SwitchDefault; | 7986 SwitchDefault toNode = this._toNode as SwitchDefault; |
| 7633 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual2(node.labels, to
Node.labels), isEqual3(node.keyword, toNode.keyword)), isEqual3(node.colon, toNo
de.colon)), isEqual2(node.statements, toNode.statements)); | 7987 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual2(node.labels, to
Node.labels), isEqual3(node.keyword, toNode.keyword)), isEqual3(node.colon, toNo
de.colon)), isEqual2(node.statements, toNode.statements)); |
| 7634 } | 7988 } |
| 7989 |
| 7635 bool visitSwitchStatement(SwitchStatement node) { | 7990 bool visitSwitchStatement(SwitchStatement node) { |
| 7636 SwitchStatement toNode = this._toNode as SwitchStatement; | 7991 SwitchStatement toNode = this._toNode as SwitchStatement; |
| 7637 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual3(node.leftP
arenthesis, toNode.leftParenthesis)), isEqual(node.expression, toNode.expression
)), isEqual3(node.rightParenthesis, toNode.rightParenthesis)), isEqual3(node.lef
tBracket, toNode.leftBracket)), isEqual2(node.members, toNode.members)), isEqual
3(node.rightBracket, toNode.rightBracket)); | 7992 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBoole
anAnd(javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual3(node.leftP
arenthesis, toNode.leftParenthesis)), isEqual(node.expression, toNode.expression
)), isEqual3(node.rightParenthesis, toNode.rightParenthesis)), isEqual3(node.lef
tBracket, toNode.leftBracket)), isEqual2(node.members, toNode.members)), isEqual
3(node.rightBracket, toNode.rightBracket)); |
| 7638 } | 7993 } |
| 7994 |
| 7639 bool visitSymbolLiteral(SymbolLiteral node) { | 7995 bool visitSymbolLiteral(SymbolLiteral node) { |
| 7640 SymbolLiteral toNode = this._toNode as SymbolLiteral; | 7996 SymbolLiteral toNode = this._toNode as SymbolLiteral; |
| 7641 if (javaBooleanAnd(isEqual3(node.poundSign, toNode.poundSign), isEqual4(node
.components, toNode.components))) { | 7997 if (javaBooleanAnd(isEqual3(node.poundSign, toNode.poundSign), isEqual4(node
.components, toNode.components))) { |
| 7642 toNode.propagatedType = node.propagatedType; | 7998 toNode.propagatedType = node.propagatedType; |
| 7643 toNode.staticType = node.staticType; | 7999 toNode.staticType = node.staticType; |
| 7644 return true; | 8000 return true; |
| 7645 } | 8001 } |
| 7646 return false; | 8002 return false; |
| 7647 } | 8003 } |
| 8004 |
| 7648 bool visitThisExpression(ThisExpression node) { | 8005 bool visitThisExpression(ThisExpression node) { |
| 7649 ThisExpression toNode = this._toNode as ThisExpression; | 8006 ThisExpression toNode = this._toNode as ThisExpression; |
| 7650 if (isEqual3(node.keyword, toNode.keyword)) { | 8007 if (isEqual3(node.keyword, toNode.keyword)) { |
| 7651 toNode.propagatedType = node.propagatedType; | 8008 toNode.propagatedType = node.propagatedType; |
| 7652 toNode.staticType = node.staticType; | 8009 toNode.staticType = node.staticType; |
| 7653 return true; | 8010 return true; |
| 7654 } | 8011 } |
| 7655 return false; | 8012 return false; |
| 7656 } | 8013 } |
| 8014 |
| 7657 bool visitThrowExpression(ThrowExpression node) { | 8015 bool visitThrowExpression(ThrowExpression node) { |
| 7658 ThrowExpression toNode = this._toNode as ThrowExpression; | 8016 ThrowExpression toNode = this._toNode as ThrowExpression; |
| 7659 if (javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual(node.expr
ession, toNode.expression))) { | 8017 if (javaBooleanAnd(isEqual3(node.keyword, toNode.keyword), isEqual(node.expr
ession, toNode.expression))) { |
| 7660 toNode.propagatedType = node.propagatedType; | 8018 toNode.propagatedType = node.propagatedType; |
| 7661 toNode.staticType = node.staticType; | 8019 toNode.staticType = node.staticType; |
| 7662 return true; | 8020 return true; |
| 7663 } | 8021 } |
| 7664 return false; | 8022 return false; |
| 7665 } | 8023 } |
| 8024 |
| 7666 bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { | 8025 bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { |
| 7667 TopLevelVariableDeclaration toNode = this._toNode as TopLevelVariableDeclara
tion; | 8026 TopLevelVariableDeclaration toNode = this._toNode as TopLevelVariableDeclara
tion; |
| 7668 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.documentati
onComment, toNode.documentationComment), isEqual2(node.metadata, toNode.metadata
)), isEqual(node.variables, toNode.variables)), isEqual3(node.semicolon, toNode.
semicolon)); | 8027 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(node.documentati
onComment, toNode.documentationComment), isEqual2(node.metadata, toNode.metadata
)), isEqual(node.variables, toNode.variables)), isEqual3(node.semicolon, toNode.
semicolon)); |
| 7669 } | 8028 } |
| 8029 |
| 7670 bool visitTryStatement(TryStatement node) { | 8030 bool visitTryStatement(TryStatement node) { |
| 7671 TryStatement toNode = this._toNode as TryStatement; | 8031 TryStatement toNode = this._toNode as TryStatement; |
| 7672 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(
node.tryKeyword, toNode.tryKeyword), isEqual(node.body, toNode.body)), isEqual2(
node.catchClauses, toNode.catchClauses)), isEqual3(node.finallyKeyword, toNode.f
inallyKeyword)), isEqual(node.finallyBlock, toNode.finallyBlock)); | 8032 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(
node.tryKeyword, toNode.tryKeyword), isEqual(node.body, toNode.body)), isEqual2(
node.catchClauses, toNode.catchClauses)), isEqual3(node.finallyKeyword, toNode.f
inallyKeyword)), isEqual(node.finallyBlock, toNode.finallyBlock)); |
| 7673 } | 8033 } |
| 8034 |
| 7674 bool visitTypeArgumentList(TypeArgumentList node) { | 8035 bool visitTypeArgumentList(TypeArgumentList node) { |
| 7675 TypeArgumentList toNode = this._toNode as TypeArgumentList; | 8036 TypeArgumentList toNode = this._toNode as TypeArgumentList; |
| 7676 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.leftBracket, toNode.leftB
racket), isEqual2(node.arguments, toNode.arguments)), isEqual3(node.rightBracket
, toNode.rightBracket)); | 8037 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.leftBracket, toNode.leftB
racket), isEqual2(node.arguments, toNode.arguments)), isEqual3(node.rightBracket
, toNode.rightBracket)); |
| 7677 } | 8038 } |
| 8039 |
| 7678 bool visitTypeName(TypeName node) { | 8040 bool visitTypeName(TypeName node) { |
| 7679 TypeName toNode = this._toNode as TypeName; | 8041 TypeName toNode = this._toNode as TypeName; |
| 7680 if (javaBooleanAnd(isEqual(node.name, toNode.name), isEqual(node.typeArgumen
ts, toNode.typeArguments))) { | 8042 if (javaBooleanAnd(isEqual(node.name, toNode.name), isEqual(node.typeArgumen
ts, toNode.typeArguments))) { |
| 7681 toNode.type = node.type; | 8043 toNode.type = node.type; |
| 7682 return true; | 8044 return true; |
| 7683 } | 8045 } |
| 7684 return false; | 8046 return false; |
| 7685 } | 8047 } |
| 8048 |
| 7686 bool visitTypeParameter(TypeParameter node) { | 8049 bool visitTypeParameter(TypeParameter node) { |
| 7687 TypeParameter toNode = this._toNode as TypeParameter; | 8050 TypeParameter toNode = this._toNode as TypeParameter; |
| 7688 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual(node.name, toNode.name)), isEqual3(node.keyword, toNo
de.keyword)), isEqual(node.bound, toNode.bound)); | 8051 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual(node.name, toNode.name)), isEqual3(node.keyword, toNo
de.keyword)), isEqual(node.bound, toNode.bound)); |
| 7689 } | 8052 } |
| 8053 |
| 7690 bool visitTypeParameterList(TypeParameterList node) { | 8054 bool visitTypeParameterList(TypeParameterList node) { |
| 7691 TypeParameterList toNode = this._toNode as TypeParameterList; | 8055 TypeParameterList toNode = this._toNode as TypeParameterList; |
| 7692 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.leftBracket, toNode.leftB
racket), isEqual2(node.typeParameters, toNode.typeParameters)), isEqual3(node.ri
ghtBracket, toNode.rightBracket)); | 8056 return javaBooleanAnd(javaBooleanAnd(isEqual3(node.leftBracket, toNode.leftB
racket), isEqual2(node.typeParameters, toNode.typeParameters)), isEqual3(node.ri
ghtBracket, toNode.rightBracket)); |
| 7693 } | 8057 } |
| 8058 |
| 7694 bool visitVariableDeclaration(VariableDeclaration node) { | 8059 bool visitVariableDeclaration(VariableDeclaration node) { |
| 7695 VariableDeclaration toNode = this._toNode as VariableDeclaration; | 8060 VariableDeclaration toNode = this._toNode as VariableDeclaration; |
| 7696 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual(node.name, toNode.name)), isEqual3(node.equals, toNod
e.equals)), isEqual(node.initializer, toNode.initializer)); | 8061 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual(node.name, toNode.name)), isEqual3(node.equals, toNod
e.equals)), isEqual(node.initializer, toNode.initializer)); |
| 7697 } | 8062 } |
| 8063 |
| 7698 bool visitVariableDeclarationList(VariableDeclarationList node) { | 8064 bool visitVariableDeclarationList(VariableDeclarationList node) { |
| 7699 VariableDeclarationList toNode = this._toNode as VariableDeclarationList; | 8065 VariableDeclarationList toNode = this._toNode as VariableDeclarationList; |
| 7700 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual3(node.keyword, toNode.keyword)), isEqual(node.type, t
oNode.type)), isEqual2(node.variables, toNode.variables)); | 8066 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual(n
ode.documentationComment, toNode.documentationComment), isEqual2(node.metadata,
toNode.metadata)), isEqual3(node.keyword, toNode.keyword)), isEqual(node.type, t
oNode.type)), isEqual2(node.variables, toNode.variables)); |
| 7701 } | 8067 } |
| 8068 |
| 7702 bool visitVariableDeclarationStatement(VariableDeclarationStatement node) { | 8069 bool visitVariableDeclarationStatement(VariableDeclarationStatement node) { |
| 7703 VariableDeclarationStatement toNode = this._toNode as VariableDeclarationSta
tement; | 8070 VariableDeclarationStatement toNode = this._toNode as VariableDeclarationSta
tement; |
| 7704 return javaBooleanAnd(isEqual(node.variables, toNode.variables), isEqual3(no
de.semicolon, toNode.semicolon)); | 8071 return javaBooleanAnd(isEqual(node.variables, toNode.variables), isEqual3(no
de.semicolon, toNode.semicolon)); |
| 7705 } | 8072 } |
| 8073 |
| 7706 bool visitWhileStatement(WhileStatement node) { | 8074 bool visitWhileStatement(WhileStatement node) { |
| 7707 WhileStatement toNode = this._toNode as WhileStatement; | 8075 WhileStatement toNode = this._toNode as WhileStatement; |
| 7708 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(
node.keyword, toNode.keyword), isEqual3(node.leftParenthesis, toNode.leftParenth
esis)), isEqual(node.condition, toNode.condition)), isEqual3(node.rightParenthes
is, toNode.rightParenthesis)), isEqual(node.body, toNode.body)); | 8076 return javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(javaBooleanAnd(isEqual3(
node.keyword, toNode.keyword), isEqual3(node.leftParenthesis, toNode.leftParenth
esis)), isEqual(node.condition, toNode.condition)), isEqual3(node.rightParenthes
is, toNode.rightParenthesis)), isEqual(node.body, toNode.body)); |
| 7709 } | 8077 } |
| 8078 |
| 7710 bool visitWithClause(WithClause node) { | 8079 bool visitWithClause(WithClause node) { |
| 7711 WithClause toNode = this._toNode as WithClause; | 8080 WithClause toNode = this._toNode as WithClause; |
| 7712 return javaBooleanAnd(isEqual3(node.withKeyword, toNode.withKeyword), isEqua
l2(node.mixinTypes, toNode.mixinTypes)); | 8081 return javaBooleanAnd(isEqual3(node.withKeyword, toNode.withKeyword), isEqua
l2(node.mixinTypes, toNode.mixinTypes)); |
| 7713 } | 8082 } |
| 7714 | 8083 |
| 7715 /** | 8084 /** |
| 7716 * Return `true` if the given AST nodes have the same structure. As a side-eff
ect, if the | 8085 * Return `true` if the given AST nodes have the same structure. As a side-eff
ect, if the |
| 7717 * nodes do have the same structure, any resolution data from the first node w
ill be copied to the | 8086 * nodes do have the same structure, any resolution data from the first node w
ill be copied to the |
| 7718 * second node. | 8087 * second node. |
| 7719 * | 8088 * |
| 7720 * @param fromNode the node from which resolution information will be copied | 8089 * @param fromNode the node from which resolution information will be copied |
| 7721 * @param toNode the node to which resolution information will be copied | 8090 * @param toNode the node to which resolution information will be copied |
| 7722 * @return `true` if the given AST nodes have the same structure | 8091 * @return `true` if the given AST nodes have the same structure |
| 7723 */ | 8092 */ |
| 7724 bool isEqual(ASTNode fromNode, ASTNode toNode) { | 8093 bool isEqual(ASTNode fromNode, ASTNode toNode) { |
| 7725 if (fromNode == null) { | 8094 if (fromNode == null) { |
| 7726 return toNode == null; | 8095 return toNode == null; |
| 7727 } else if (toNode == null) { | 8096 } else if (toNode == null) { |
| 7728 return false; | 8097 return false; |
| 7729 } else if (fromNode.runtimeType == toNode.runtimeType) { | 8098 } else if (fromNode.runtimeType == toNode.runtimeType) { |
| 7730 this._toNode = toNode; | 8099 this._toNode = toNode; |
| 7731 return fromNode.accept(this); | 8100 return fromNode.accept(this); |
| 7732 } | 8101 } |
| 7733 if (toNode is PrefixedIdentifier) { | 8102 if (toNode is PrefixedIdentifier) { |
| 7734 SimpleIdentifier prefix = ((toNode as PrefixedIdentifier)).prefix; | 8103 SimpleIdentifier prefix = (toNode as PrefixedIdentifier).prefix; |
| 7735 if (fromNode.runtimeType == prefix.runtimeType) { | 8104 if (fromNode.runtimeType == prefix.runtimeType) { |
| 7736 this._toNode = prefix; | 8105 this._toNode = prefix; |
| 7737 return fromNode.accept(this); | 8106 return fromNode.accept(this); |
| 7738 } | 8107 } |
| 7739 } else if (toNode is PropertyAccess) { | 8108 } else if (toNode is PropertyAccess) { |
| 7740 Expression target = ((toNode as PropertyAccess)).target; | 8109 Expression target = (toNode as PropertyAccess).target; |
| 7741 if (fromNode.runtimeType == target.runtimeType) { | 8110 if (fromNode.runtimeType == target.runtimeType) { |
| 7742 this._toNode = target; | 8111 this._toNode = target; |
| 7743 return fromNode.accept(this); | 8112 return fromNode.accept(this); |
| 7744 } | 8113 } |
| 7745 } | 8114 } |
| 7746 return false; | 8115 return false; |
| 7747 } | 8116 } |
| 7748 | 8117 |
| 7749 /** | 8118 /** |
| 7750 * Return `true` if the given lists of AST nodes have the same size and corres
ponding | 8119 * Return `true` if the given lists of AST nodes have the same size and corres
ponding |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7805 return false; | 8174 return false; |
| 7806 } | 8175 } |
| 7807 for (int i = 0; i < length; i++) { | 8176 for (int i = 0; i < length; i++) { |
| 7808 if (!isEqual3(first[i], second[i])) { | 8177 if (!isEqual3(first[i], second[i])) { |
| 7809 return false; | 8178 return false; |
| 7810 } | 8179 } |
| 7811 } | 8180 } |
| 7812 return true; | 8181 return true; |
| 7813 } | 8182 } |
| 7814 } | 8183 } |
| 8184 |
| 7815 /** | 8185 /** |
| 7816 * Instances of the class {link ToFormattedSourceVisitor} write a source represe
ntation of a visited | 8186 * Instances of the class {link ToFormattedSourceVisitor} write a source represe
ntation of a visited |
| 7817 * AST node (and all of it's children) to a writer. | 8187 * AST node (and all of it's children) to a writer. |
| 7818 */ | 8188 */ |
| 7819 class ToFormattedSourceVisitor implements ASTVisitor<Object> { | 8189 class ToFormattedSourceVisitor implements ASTVisitor<Object> { |
| 7820 | |
| 7821 /** | 8190 /** |
| 7822 * The writer to which the source is to be written. | 8191 * The writer to which the source is to be written. |
| 7823 */ | 8192 */ |
| 7824 PrintWriter _writer; | 8193 PrintWriter _writer; |
| 8194 |
| 7825 int _indentLevel = 0; | 8195 int _indentLevel = 0; |
| 8196 |
| 7826 String _indentString = ""; | 8197 String _indentString = ""; |
| 7827 | 8198 |
| 7828 /** | 8199 /** |
| 7829 * Initialize a newly created visitor to write source code representing the vi
sited nodes to the | 8200 * Initialize a newly created visitor to write source code representing the vi
sited nodes to the |
| 7830 * given writer. | 8201 * given writer. |
| 7831 * | 8202 * |
| 7832 * @param writer the writer to which the source is to be written | 8203 * @param writer the writer to which the source is to be written |
| 7833 */ | 8204 */ |
| 7834 ToFormattedSourceVisitor(PrintWriter writer) { | 8205 ToFormattedSourceVisitor(PrintWriter writer) { |
| 7835 this._writer = writer; | 8206 this._writer = writer; |
| 7836 } | 8207 } |
| 8208 |
| 7837 Object visitAdjacentStrings(AdjacentStrings node) { | 8209 Object visitAdjacentStrings(AdjacentStrings node) { |
| 7838 visitList5(node.strings, " "); | 8210 visitList5(node.strings, " "); |
| 7839 return null; | 8211 return null; |
| 7840 } | 8212 } |
| 8213 |
| 7841 Object visitAnnotation(Annotation node) { | 8214 Object visitAnnotation(Annotation node) { |
| 7842 _writer.print('@'); | 8215 _writer.print('@'); |
| 7843 visit(node.name); | 8216 visit(node.name); |
| 7844 visit7(".", node.constructorName); | 8217 visit7(".", node.constructorName); |
| 7845 visit(node.arguments); | 8218 visit(node.arguments); |
| 7846 return null; | 8219 return null; |
| 7847 } | 8220 } |
| 8221 |
| 7848 Object visitArgumentDefinitionTest(ArgumentDefinitionTest node) { | 8222 Object visitArgumentDefinitionTest(ArgumentDefinitionTest node) { |
| 7849 _writer.print('?'); | 8223 _writer.print('?'); |
| 7850 visit(node.identifier); | 8224 visit(node.identifier); |
| 7851 return null; | 8225 return null; |
| 7852 } | 8226 } |
| 8227 |
| 7853 Object visitArgumentList(ArgumentList node) { | 8228 Object visitArgumentList(ArgumentList node) { |
| 7854 _writer.print('('); | 8229 _writer.print('('); |
| 7855 visitList5(node.arguments, ", "); | 8230 visitList5(node.arguments, ", "); |
| 7856 _writer.print(')'); | 8231 _writer.print(')'); |
| 7857 return null; | 8232 return null; |
| 7858 } | 8233 } |
| 8234 |
| 7859 Object visitAsExpression(AsExpression node) { | 8235 Object visitAsExpression(AsExpression node) { |
| 7860 visit(node.expression); | 8236 visit(node.expression); |
| 7861 _writer.print(" as "); | 8237 _writer.print(" as "); |
| 7862 visit(node.type); | 8238 visit(node.type); |
| 7863 return null; | 8239 return null; |
| 7864 } | 8240 } |
| 8241 |
| 7865 Object visitAssertStatement(AssertStatement node) { | 8242 Object visitAssertStatement(AssertStatement node) { |
| 7866 _writer.print("assert("); | 8243 _writer.print("assert("); |
| 7867 visit(node.condition); | 8244 visit(node.condition); |
| 7868 _writer.print(");"); | 8245 _writer.print(");"); |
| 7869 return null; | 8246 return null; |
| 7870 } | 8247 } |
| 8248 |
| 7871 Object visitAssignmentExpression(AssignmentExpression node) { | 8249 Object visitAssignmentExpression(AssignmentExpression node) { |
| 7872 visit(node.leftHandSide); | 8250 visit(node.leftHandSide); |
| 7873 _writer.print(' '); | 8251 _writer.print(' '); |
| 7874 _writer.print(node.operator.lexeme); | 8252 _writer.print(node.operator.lexeme); |
| 7875 _writer.print(' '); | 8253 _writer.print(' '); |
| 7876 visit(node.rightHandSide); | 8254 visit(node.rightHandSide); |
| 7877 return null; | 8255 return null; |
| 7878 } | 8256 } |
| 8257 |
| 7879 Object visitBinaryExpression(BinaryExpression node) { | 8258 Object visitBinaryExpression(BinaryExpression node) { |
| 7880 visit(node.leftOperand); | 8259 visit(node.leftOperand); |
| 7881 _writer.print(' '); | 8260 _writer.print(' '); |
| 7882 _writer.print(node.operator.lexeme); | 8261 _writer.print(node.operator.lexeme); |
| 7883 _writer.print(' '); | 8262 _writer.print(' '); |
| 7884 visit(node.rightOperand); | 8263 visit(node.rightOperand); |
| 7885 return null; | 8264 return null; |
| 7886 } | 8265 } |
| 8266 |
| 7887 Object visitBlock(Block node) { | 8267 Object visitBlock(Block node) { |
| 7888 _writer.print('{'); | 8268 _writer.print('{'); |
| 7889 { | 8269 { |
| 7890 indentInc(); | 8270 indentInc(); |
| 7891 visitList5(node.statements, "\n"); | 8271 visitList7("\n", node.statements, "\n"); |
| 7892 indentDec(); | 8272 indentDec(); |
| 7893 } | 8273 } |
| 7894 nl2(); | 8274 nl2(); |
| 7895 _writer.print('}'); | 8275 _writer.print('}'); |
| 7896 return null; | 8276 return null; |
| 7897 } | 8277 } |
| 8278 |
| 7898 Object visitBlockFunctionBody(BlockFunctionBody node) { | 8279 Object visitBlockFunctionBody(BlockFunctionBody node) { |
| 7899 visit(node.block); | 8280 visit(node.block); |
| 7900 return null; | 8281 return null; |
| 7901 } | 8282 } |
| 8283 |
| 7902 Object visitBooleanLiteral(BooleanLiteral node) { | 8284 Object visitBooleanLiteral(BooleanLiteral node) { |
| 7903 _writer.print(node.literal.lexeme); | 8285 _writer.print(node.literal.lexeme); |
| 7904 return null; | 8286 return null; |
| 7905 } | 8287 } |
| 8288 |
| 7906 Object visitBreakStatement(BreakStatement node) { | 8289 Object visitBreakStatement(BreakStatement node) { |
| 7907 _writer.print("break"); | 8290 _writer.print("break"); |
| 7908 visit7(" ", node.label); | 8291 visit7(" ", node.label); |
| 7909 _writer.print(";"); | 8292 _writer.print(";"); |
| 7910 return null; | 8293 return null; |
| 7911 } | 8294 } |
| 8295 |
| 7912 Object visitCascadeExpression(CascadeExpression node) { | 8296 Object visitCascadeExpression(CascadeExpression node) { |
| 7913 visit(node.target); | 8297 visit(node.target); |
| 7914 visitList(node.cascadeSections); | 8298 visitList(node.cascadeSections); |
| 7915 return null; | 8299 return null; |
| 7916 } | 8300 } |
| 8301 |
| 7917 Object visitCatchClause(CatchClause node) { | 8302 Object visitCatchClause(CatchClause node) { |
| 7918 visit7("on ", node.exceptionType); | 8303 visit7("on ", node.exceptionType); |
| 7919 if (node.catchKeyword != null) { | 8304 if (node.catchKeyword != null) { |
| 7920 if (node.exceptionType != null) { | 8305 if (node.exceptionType != null) { |
| 7921 _writer.print(' '); | 8306 _writer.print(' '); |
| 7922 } | 8307 } |
| 7923 _writer.print("catch ("); | 8308 _writer.print("catch ("); |
| 7924 visit(node.exceptionParameter); | 8309 visit(node.exceptionParameter); |
| 7925 visit7(", ", node.stackTraceParameter); | 8310 visit7(", ", node.stackTraceParameter); |
| 7926 _writer.print(") "); | 8311 _writer.print(") "); |
| 7927 } else { | 8312 } else { |
| 7928 _writer.print(" "); | 8313 _writer.print(" "); |
| 7929 } | 8314 } |
| 7930 visit(node.body); | 8315 visit(node.body); |
| 7931 return null; | 8316 return null; |
| 7932 } | 8317 } |
| 8318 |
| 7933 Object visitClassDeclaration(ClassDeclaration node) { | 8319 Object visitClassDeclaration(ClassDeclaration node) { |
| 7934 visit(node.documentationComment); | 8320 visit(node.documentationComment); |
| 7935 visit8(node.abstractKeyword, " "); | 8321 visit8(node.abstractKeyword, " "); |
| 7936 _writer.print("class "); | 8322 _writer.print("class "); |
| 7937 visit(node.name); | 8323 visit(node.name); |
| 7938 visit(node.typeParameters); | 8324 visit(node.typeParameters); |
| 7939 visit7(" ", node.extendsClause); | 8325 visit7(" ", node.extendsClause); |
| 7940 visit7(" ", node.withClause); | 8326 visit7(" ", node.withClause); |
| 7941 visit7(" ", node.implementsClause); | 8327 visit7(" ", node.implementsClause); |
| 7942 _writer.print(" {"); | 8328 _writer.print(" {"); |
| 7943 { | 8329 { |
| 7944 indentInc(); | 8330 indentInc(); |
| 7945 visitList5(node.members, "\n"); | 8331 visitList7("\n", node.members, "\n\n"); |
| 7946 indentDec(); | 8332 indentDec(); |
| 7947 } | 8333 } |
| 7948 nl2(); | 8334 nl2(); |
| 7949 _writer.print("}"); | 8335 _writer.print("}"); |
| 7950 return null; | 8336 return null; |
| 7951 } | 8337 } |
| 8338 |
| 7952 Object visitClassTypeAlias(ClassTypeAlias node) { | 8339 Object visitClassTypeAlias(ClassTypeAlias node) { |
| 7953 _writer.print("typedef "); | 8340 _writer.print("typedef "); |
| 7954 visit(node.name); | 8341 visit(node.name); |
| 7955 visit(node.typeParameters); | 8342 visit(node.typeParameters); |
| 7956 _writer.print(" = "); | 8343 _writer.print(" = "); |
| 7957 if (node.abstractKeyword != null) { | 8344 if (node.abstractKeyword != null) { |
| 7958 _writer.print("abstract "); | 8345 _writer.print("abstract "); |
| 7959 } | 8346 } |
| 7960 visit(node.superclass); | 8347 visit(node.superclass); |
| 7961 visit7(" ", node.withClause); | 8348 visit7(" ", node.withClause); |
| 7962 visit7(" ", node.implementsClause); | 8349 visit7(" ", node.implementsClause); |
| 7963 _writer.print(";"); | 8350 _writer.print(";"); |
| 7964 return null; | 8351 return null; |
| 7965 } | 8352 } |
| 8353 |
| 7966 Object visitComment(Comment node) { | 8354 Object visitComment(Comment node) { |
| 7967 Token token = node.beginToken; | 8355 Token token = node.beginToken; |
| 7968 while (token != null) { | 8356 while (token != null) { |
| 7969 bool firstLine = true; | 8357 bool firstLine = true; |
| 7970 for (String line in StringUtils.split(token.lexeme, "\n")) { | 8358 for (String line in StringUtils.split(token.lexeme, "\n")) { |
| 7971 if (firstLine) { | 8359 if (firstLine) { |
| 7972 firstLine = false; | 8360 firstLine = false; |
| 7973 if (node.isDocumentation) { | |
| 7974 nl2(); | |
| 7975 } | |
| 7976 } else { | 8361 } else { |
| 7977 line = " ${line.trim()}"; | 8362 line = " ${line.trim()}"; |
| 7978 line = StringUtils.replace(line, "/*", "/ *"); | 8363 line = StringUtils.replace(line, "/*", "/ *"); |
| 7979 } | 8364 } |
| 7980 _writer.print(line); | 8365 _writer.print(line); |
| 7981 nl2(); | 8366 nl2(); |
| 7982 } | 8367 } |
| 7983 if (identical(token, node.endToken)) { | 8368 if (identical(token, node.endToken)) { |
| 7984 break; | 8369 break; |
| 7985 } | 8370 } |
| 7986 } | 8371 } |
| 7987 return null; | 8372 return null; |
| 7988 } | 8373 } |
| 8374 |
| 7989 Object visitCommentReference(CommentReference node) => null; | 8375 Object visitCommentReference(CommentReference node) => null; |
| 8376 |
| 7990 Object visitCompilationUnit(CompilationUnit node) { | 8377 Object visitCompilationUnit(CompilationUnit node) { |
| 7991 ScriptTag scriptTag = node.scriptTag; | 8378 ScriptTag scriptTag = node.scriptTag; |
| 7992 NodeList<Directive> directives = node.directives; | 8379 NodeList<Directive> directives = node.directives; |
| 7993 visit(scriptTag); | 8380 visit(scriptTag); |
| 7994 String prefix = scriptTag == null ? "" : " "; | 8381 String prefix = scriptTag == null ? "" : " "; |
| 7995 visitList7(prefix, directives, "\n"); | 8382 visitList7(prefix, directives, "\n"); |
| 7996 prefix = scriptTag == null && directives.isEmpty ? "" : "\n\n"; | 8383 nl(); |
| 7997 visitList7(prefix, node.declarations, "\n"); | 8384 prefix = scriptTag == null && directives.isEmpty ? "" : "\n"; |
| 8385 visitList7(prefix, node.declarations, "\n\n"); |
| 7998 return null; | 8386 return null; |
| 7999 } | 8387 } |
| 8388 |
| 8000 Object visitConditionalExpression(ConditionalExpression node) { | 8389 Object visitConditionalExpression(ConditionalExpression node) { |
| 8001 visit(node.condition); | 8390 visit(node.condition); |
| 8002 _writer.print(" ? "); | 8391 _writer.print(" ? "); |
| 8003 visit(node.thenExpression); | 8392 visit(node.thenExpression); |
| 8004 _writer.print(" : "); | 8393 _writer.print(" : "); |
| 8005 visit(node.elseExpression); | 8394 visit(node.elseExpression); |
| 8006 return null; | 8395 return null; |
| 8007 } | 8396 } |
| 8397 |
| 8008 Object visitConstructorDeclaration(ConstructorDeclaration node) { | 8398 Object visitConstructorDeclaration(ConstructorDeclaration node) { |
| 8009 visit(node.documentationComment); | 8399 visit(node.documentationComment); |
| 8010 visit8(node.externalKeyword, " "); | 8400 visit8(node.externalKeyword, " "); |
| 8011 visit8(node.constKeyword, " "); | 8401 visit8(node.constKeyword, " "); |
| 8012 visit8(node.factoryKeyword, " "); | 8402 visit8(node.factoryKeyword, " "); |
| 8013 visit(node.returnType); | 8403 visit(node.returnType); |
| 8014 visit7(".", node.name); | 8404 visit7(".", node.name); |
| 8015 visit(node.parameters); | 8405 visit(node.parameters); |
| 8016 visitList7(" : ", node.initializers, ", "); | 8406 visitList7(" : ", node.initializers, ", "); |
| 8017 visit7(" = ", node.redirectedConstructor); | 8407 visit7(" = ", node.redirectedConstructor); |
| 8018 if (node.body is! EmptyFunctionBody) { | 8408 if (node.body is! EmptyFunctionBody) { |
| 8019 _writer.print(' '); | 8409 _writer.print(' '); |
| 8020 } | 8410 } |
| 8021 visit(node.body); | 8411 visit(node.body); |
| 8022 return null; | 8412 return null; |
| 8023 } | 8413 } |
| 8414 |
| 8024 Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) { | 8415 Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) { |
| 8025 visit8(node.keyword, "."); | 8416 visit8(node.keyword, "."); |
| 8026 visit(node.fieldName); | 8417 visit(node.fieldName); |
| 8027 _writer.print(" = "); | 8418 _writer.print(" = "); |
| 8028 visit(node.expression); | 8419 visit(node.expression); |
| 8029 return null; | 8420 return null; |
| 8030 } | 8421 } |
| 8422 |
| 8031 Object visitConstructorName(ConstructorName node) { | 8423 Object visitConstructorName(ConstructorName node) { |
| 8032 visit(node.type); | 8424 visit(node.type); |
| 8033 visit7(".", node.name); | 8425 visit7(".", node.name); |
| 8034 return null; | 8426 return null; |
| 8035 } | 8427 } |
| 8428 |
| 8036 Object visitContinueStatement(ContinueStatement node) { | 8429 Object visitContinueStatement(ContinueStatement node) { |
| 8037 _writer.print("continue"); | 8430 _writer.print("continue"); |
| 8038 visit7(" ", node.label); | 8431 visit7(" ", node.label); |
| 8039 _writer.print(";"); | 8432 _writer.print(";"); |
| 8040 return null; | 8433 return null; |
| 8041 } | 8434 } |
| 8435 |
| 8042 Object visitDeclaredIdentifier(DeclaredIdentifier node) { | 8436 Object visitDeclaredIdentifier(DeclaredIdentifier node) { |
| 8043 visit8(node.keyword, " "); | 8437 visit8(node.keyword, " "); |
| 8044 visit6(node.type, " "); | 8438 visit6(node.type, " "); |
| 8045 visit(node.identifier); | 8439 visit(node.identifier); |
| 8046 return null; | 8440 return null; |
| 8047 } | 8441 } |
| 8442 |
| 8048 Object visitDefaultFormalParameter(DefaultFormalParameter node) { | 8443 Object visitDefaultFormalParameter(DefaultFormalParameter node) { |
| 8049 visit(node.parameter); | 8444 visit(node.parameter); |
| 8050 if (node.separator != null) { | 8445 if (node.separator != null) { |
| 8051 _writer.print(" "); | 8446 _writer.print(" "); |
| 8052 _writer.print(node.separator.lexeme); | 8447 _writer.print(node.separator.lexeme); |
| 8053 visit7(" ", node.defaultValue); | 8448 visit7(" ", node.defaultValue); |
| 8054 } | 8449 } |
| 8055 return null; | 8450 return null; |
| 8056 } | 8451 } |
| 8452 |
| 8057 Object visitDoStatement(DoStatement node) { | 8453 Object visitDoStatement(DoStatement node) { |
| 8058 _writer.print("do "); | 8454 _writer.print("do "); |
| 8059 visit(node.body); | 8455 visit(node.body); |
| 8060 _writer.print(" while ("); | 8456 _writer.print(" while ("); |
| 8061 visit(node.condition); | 8457 visit(node.condition); |
| 8062 _writer.print(");"); | 8458 _writer.print(");"); |
| 8063 return null; | 8459 return null; |
| 8064 } | 8460 } |
| 8461 |
| 8065 Object visitDoubleLiteral(DoubleLiteral node) { | 8462 Object visitDoubleLiteral(DoubleLiteral node) { |
| 8066 _writer.print(node.literal.lexeme); | 8463 _writer.print(node.literal.lexeme); |
| 8067 return null; | 8464 return null; |
| 8068 } | 8465 } |
| 8466 |
| 8069 Object visitEmptyFunctionBody(EmptyFunctionBody node) { | 8467 Object visitEmptyFunctionBody(EmptyFunctionBody node) { |
| 8070 _writer.print(';'); | 8468 _writer.print(';'); |
| 8071 return null; | 8469 return null; |
| 8072 } | 8470 } |
| 8471 |
| 8073 Object visitEmptyStatement(EmptyStatement node) { | 8472 Object visitEmptyStatement(EmptyStatement node) { |
| 8074 _writer.print(';'); | 8473 _writer.print(';'); |
| 8075 return null; | 8474 return null; |
| 8076 } | 8475 } |
| 8476 |
| 8077 Object visitExportDirective(ExportDirective node) { | 8477 Object visitExportDirective(ExportDirective node) { |
| 8078 _writer.print("export "); | 8478 _writer.print("export "); |
| 8079 visit(node.uri); | 8479 visit(node.uri); |
| 8080 visitList7(" ", node.combinators, " "); | 8480 visitList7(" ", node.combinators, " "); |
| 8081 _writer.print(';'); | 8481 _writer.print(';'); |
| 8082 return null; | 8482 return null; |
| 8083 } | 8483 } |
| 8484 |
| 8084 Object visitExpressionFunctionBody(ExpressionFunctionBody node) { | 8485 Object visitExpressionFunctionBody(ExpressionFunctionBody node) { |
| 8085 _writer.print("=> "); | 8486 _writer.print("=> "); |
| 8086 visit(node.expression); | 8487 visit(node.expression); |
| 8087 if (node.semicolon != null) { | 8488 if (node.semicolon != null) { |
| 8088 _writer.print(';'); | 8489 _writer.print(';'); |
| 8089 } | 8490 } |
| 8090 return null; | 8491 return null; |
| 8091 } | 8492 } |
| 8493 |
| 8092 Object visitExpressionStatement(ExpressionStatement node) { | 8494 Object visitExpressionStatement(ExpressionStatement node) { |
| 8093 visit(node.expression); | 8495 visit(node.expression); |
| 8094 _writer.print(';'); | 8496 _writer.print(';'); |
| 8095 return null; | 8497 return null; |
| 8096 } | 8498 } |
| 8499 |
| 8097 Object visitExtendsClause(ExtendsClause node) { | 8500 Object visitExtendsClause(ExtendsClause node) { |
| 8098 _writer.print("extends "); | 8501 _writer.print("extends "); |
| 8099 visit(node.superclass); | 8502 visit(node.superclass); |
| 8100 return null; | 8503 return null; |
| 8101 } | 8504 } |
| 8505 |
| 8102 Object visitFieldDeclaration(FieldDeclaration node) { | 8506 Object visitFieldDeclaration(FieldDeclaration node) { |
| 8103 visit(node.documentationComment); | 8507 visit(node.documentationComment); |
| 8104 visit8(node.staticKeyword, " "); | 8508 visit8(node.staticKeyword, " "); |
| 8105 visit(node.fields); | 8509 visit(node.fields); |
| 8106 _writer.print(";"); | 8510 _writer.print(";"); |
| 8107 return null; | 8511 return null; |
| 8108 } | 8512 } |
| 8513 |
| 8109 Object visitFieldFormalParameter(FieldFormalParameter node) { | 8514 Object visitFieldFormalParameter(FieldFormalParameter node) { |
| 8110 visit8(node.keyword, " "); | 8515 visit8(node.keyword, " "); |
| 8111 visit6(node.type, " "); | 8516 visit6(node.type, " "); |
| 8112 _writer.print("this."); | 8517 _writer.print("this."); |
| 8113 visit(node.identifier); | 8518 visit(node.identifier); |
| 8114 visit(node.parameters); | 8519 visit(node.parameters); |
| 8115 return null; | 8520 return null; |
| 8116 } | 8521 } |
| 8522 |
| 8117 Object visitForEachStatement(ForEachStatement node) { | 8523 Object visitForEachStatement(ForEachStatement node) { |
| 8118 DeclaredIdentifier loopVariable = node.loopVariable; | 8524 DeclaredIdentifier loopVariable = node.loopVariable; |
| 8119 _writer.print("for ("); | 8525 _writer.print("for ("); |
| 8120 if (loopVariable == null) { | 8526 if (loopVariable == null) { |
| 8121 visit(node.identifier); | 8527 visit(node.identifier); |
| 8122 } else { | 8528 } else { |
| 8123 visit(loopVariable); | 8529 visit(loopVariable); |
| 8124 } | 8530 } |
| 8125 _writer.print(" in "); | 8531 _writer.print(" in "); |
| 8126 visit(node.iterator); | 8532 visit(node.iterator); |
| 8127 _writer.print(") "); | 8533 _writer.print(") "); |
| 8128 visit(node.body); | 8534 visit(node.body); |
| 8129 return null; | 8535 return null; |
| 8130 } | 8536 } |
| 8537 |
| 8131 Object visitFormalParameterList(FormalParameterList node) { | 8538 Object visitFormalParameterList(FormalParameterList node) { |
| 8132 String groupEnd = null; | 8539 String groupEnd = null; |
| 8133 _writer.print('('); | 8540 _writer.print('('); |
| 8134 NodeList<FormalParameter> parameters = node.parameters; | 8541 NodeList<FormalParameter> parameters = node.parameters; |
| 8135 int size = parameters.length; | 8542 int size = parameters.length; |
| 8136 for (int i = 0; i < size; i++) { | 8543 for (int i = 0; i < size; i++) { |
| 8137 FormalParameter parameter = parameters[i]; | 8544 FormalParameter parameter = parameters[i]; |
| 8138 if (i > 0) { | 8545 if (i > 0) { |
| 8139 _writer.print(", "); | 8546 _writer.print(", "); |
| 8140 } | 8547 } |
| 8141 if (groupEnd == null && parameter is DefaultFormalParameter) { | 8548 if (groupEnd == null && parameter is DefaultFormalParameter) { |
| 8142 if (identical(parameter.kind, ParameterKind.NAMED)) { | 8549 if (identical(parameter.kind, ParameterKind.NAMED)) { |
| 8143 groupEnd = "}"; | 8550 groupEnd = "}"; |
| 8144 _writer.print('{'); | 8551 _writer.print('{'); |
| 8145 } else { | 8552 } else { |
| 8146 groupEnd = "]"; | 8553 groupEnd = "]"; |
| 8147 _writer.print('['); | 8554 _writer.print('['); |
| 8148 } | 8555 } |
| 8149 } | 8556 } |
| 8150 parameter.accept(this); | 8557 parameter.accept(this); |
| 8151 } | 8558 } |
| 8152 if (groupEnd != null) { | 8559 if (groupEnd != null) { |
| 8153 _writer.print(groupEnd); | 8560 _writer.print(groupEnd); |
| 8154 } | 8561 } |
| 8155 _writer.print(')'); | 8562 _writer.print(')'); |
| 8156 return null; | 8563 return null; |
| 8157 } | 8564 } |
| 8565 |
| 8158 Object visitForStatement(ForStatement node) { | 8566 Object visitForStatement(ForStatement node) { |
| 8159 Expression initialization = node.initialization; | 8567 Expression initialization = node.initialization; |
| 8160 _writer.print("for ("); | 8568 _writer.print("for ("); |
| 8161 if (initialization != null) { | 8569 if (initialization != null) { |
| 8162 visit(initialization); | 8570 visit(initialization); |
| 8163 } else { | 8571 } else { |
| 8164 visit(node.variables); | 8572 visit(node.variables); |
| 8165 } | 8573 } |
| 8166 _writer.print(";"); | 8574 _writer.print(";"); |
| 8167 visit7(" ", node.condition); | 8575 visit7(" ", node.condition); |
| 8168 _writer.print(";"); | 8576 _writer.print(";"); |
| 8169 visitList7(" ", node.updaters, ", "); | 8577 visitList7(" ", node.updaters, ", "); |
| 8170 _writer.print(") "); | 8578 _writer.print(") "); |
| 8171 visit(node.body); | 8579 visit(node.body); |
| 8172 return null; | 8580 return null; |
| 8173 } | 8581 } |
| 8582 |
| 8174 Object visitFunctionDeclaration(FunctionDeclaration node) { | 8583 Object visitFunctionDeclaration(FunctionDeclaration node) { |
| 8175 visit6(node.returnType, " "); | 8584 visit6(node.returnType, " "); |
| 8176 visit8(node.propertyKeyword, " "); | 8585 visit8(node.propertyKeyword, " "); |
| 8177 visit(node.name); | 8586 visit(node.name); |
| 8178 visit(node.functionExpression); | 8587 visit(node.functionExpression); |
| 8179 return null; | 8588 return null; |
| 8180 } | 8589 } |
| 8590 |
| 8181 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { | 8591 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { |
| 8182 visit(node.functionDeclaration); | 8592 visit(node.functionDeclaration); |
| 8183 _writer.print(';'); | 8593 _writer.print(';'); |
| 8184 return null; | 8594 return null; |
| 8185 } | 8595 } |
| 8596 |
| 8186 Object visitFunctionExpression(FunctionExpression node) { | 8597 Object visitFunctionExpression(FunctionExpression node) { |
| 8187 visit(node.parameters); | 8598 visit(node.parameters); |
| 8188 _writer.print(' '); | 8599 _writer.print(' '); |
| 8189 visit(node.body); | 8600 visit(node.body); |
| 8190 return null; | 8601 return null; |
| 8191 } | 8602 } |
| 8603 |
| 8192 Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { | 8604 Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { |
| 8193 visit(node.function); | 8605 visit(node.function); |
| 8194 visit(node.argumentList); | 8606 visit(node.argumentList); |
| 8195 return null; | 8607 return null; |
| 8196 } | 8608 } |
| 8609 |
| 8197 Object visitFunctionTypeAlias(FunctionTypeAlias node) { | 8610 Object visitFunctionTypeAlias(FunctionTypeAlias node) { |
| 8198 _writer.print("typedef "); | 8611 _writer.print("typedef "); |
| 8199 visit6(node.returnType, " "); | 8612 visit6(node.returnType, " "); |
| 8200 visit(node.name); | 8613 visit(node.name); |
| 8201 visit(node.typeParameters); | 8614 visit(node.typeParameters); |
| 8202 visit(node.parameters); | 8615 visit(node.parameters); |
| 8203 _writer.print(";"); | 8616 _writer.print(";"); |
| 8204 return null; | 8617 return null; |
| 8205 } | 8618 } |
| 8619 |
| 8206 Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { | 8620 Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { |
| 8207 visit6(node.returnType, " "); | 8621 visit6(node.returnType, " "); |
| 8208 visit(node.identifier); | 8622 visit(node.identifier); |
| 8209 visit(node.parameters); | 8623 visit(node.parameters); |
| 8210 return null; | 8624 return null; |
| 8211 } | 8625 } |
| 8626 |
| 8212 Object visitHideCombinator(HideCombinator node) { | 8627 Object visitHideCombinator(HideCombinator node) { |
| 8213 _writer.print("hide "); | 8628 _writer.print("hide "); |
| 8214 visitList5(node.hiddenNames, ", "); | 8629 visitList5(node.hiddenNames, ", "); |
| 8215 return null; | 8630 return null; |
| 8216 } | 8631 } |
| 8632 |
| 8217 Object visitIfStatement(IfStatement node) { | 8633 Object visitIfStatement(IfStatement node) { |
| 8218 _writer.print("if ("); | 8634 _writer.print("if ("); |
| 8219 visit(node.condition); | 8635 visit(node.condition); |
| 8220 _writer.print(") "); | 8636 _writer.print(") "); |
| 8221 visit(node.thenStatement); | 8637 visit(node.thenStatement); |
| 8222 visit7(" else ", node.elseStatement); | 8638 visit7(" else ", node.elseStatement); |
| 8223 return null; | 8639 return null; |
| 8224 } | 8640 } |
| 8641 |
| 8225 Object visitImplementsClause(ImplementsClause node) { | 8642 Object visitImplementsClause(ImplementsClause node) { |
| 8226 _writer.print("implements "); | 8643 _writer.print("implements "); |
| 8227 visitList5(node.interfaces, ", "); | 8644 visitList5(node.interfaces, ", "); |
| 8228 return null; | 8645 return null; |
| 8229 } | 8646 } |
| 8647 |
| 8230 Object visitImportDirective(ImportDirective node) { | 8648 Object visitImportDirective(ImportDirective node) { |
| 8231 _writer.print("import "); | 8649 _writer.print("import "); |
| 8232 visit(node.uri); | 8650 visit(node.uri); |
| 8233 visit7(" as ", node.prefix); | 8651 visit7(" as ", node.prefix); |
| 8234 visitList7(" ", node.combinators, " "); | 8652 visitList7(" ", node.combinators, " "); |
| 8235 _writer.print(';'); | 8653 _writer.print(';'); |
| 8236 return null; | 8654 return null; |
| 8237 } | 8655 } |
| 8656 |
| 8238 Object visitIndexExpression(IndexExpression node) { | 8657 Object visitIndexExpression(IndexExpression node) { |
| 8239 if (node.isCascaded) { | 8658 if (node.isCascaded) { |
| 8240 _writer.print(".."); | 8659 _writer.print(".."); |
| 8241 } else { | 8660 } else { |
| 8242 visit(node.target); | 8661 visit(node.target); |
| 8243 } | 8662 } |
| 8244 _writer.print('['); | 8663 _writer.print('['); |
| 8245 visit(node.index); | 8664 visit(node.index); |
| 8246 _writer.print(']'); | 8665 _writer.print(']'); |
| 8247 return null; | 8666 return null; |
| 8248 } | 8667 } |
| 8668 |
| 8249 Object visitInstanceCreationExpression(InstanceCreationExpression node) { | 8669 Object visitInstanceCreationExpression(InstanceCreationExpression node) { |
| 8250 visit8(node.keyword, " "); | 8670 visit8(node.keyword, " "); |
| 8251 visit(node.constructorName); | 8671 visit(node.constructorName); |
| 8252 visit(node.argumentList); | 8672 visit(node.argumentList); |
| 8253 return null; | 8673 return null; |
| 8254 } | 8674 } |
| 8675 |
| 8255 Object visitIntegerLiteral(IntegerLiteral node) { | 8676 Object visitIntegerLiteral(IntegerLiteral node) { |
| 8256 _writer.print(node.literal.lexeme); | 8677 _writer.print(node.literal.lexeme); |
| 8257 return null; | 8678 return null; |
| 8258 } | 8679 } |
| 8680 |
| 8259 Object visitInterpolationExpression(InterpolationExpression node) { | 8681 Object visitInterpolationExpression(InterpolationExpression node) { |
| 8260 if (node.rightBracket != null) { | 8682 if (node.rightBracket != null) { |
| 8261 _writer.print("\${"); | 8683 _writer.print("\${"); |
| 8262 visit(node.expression); | 8684 visit(node.expression); |
| 8263 _writer.print("}"); | 8685 _writer.print("}"); |
| 8264 } else { | 8686 } else { |
| 8265 _writer.print("\$"); | 8687 _writer.print("\$"); |
| 8266 visit(node.expression); | 8688 visit(node.expression); |
| 8267 } | 8689 } |
| 8268 return null; | 8690 return null; |
| 8269 } | 8691 } |
| 8692 |
| 8270 Object visitInterpolationString(InterpolationString node) { | 8693 Object visitInterpolationString(InterpolationString node) { |
| 8271 _writer.print(node.contents.lexeme); | 8694 _writer.print(node.contents.lexeme); |
| 8272 return null; | 8695 return null; |
| 8273 } | 8696 } |
| 8697 |
| 8274 Object visitIsExpression(IsExpression node) { | 8698 Object visitIsExpression(IsExpression node) { |
| 8275 visit(node.expression); | 8699 visit(node.expression); |
| 8276 if (node.notOperator == null) { | 8700 if (node.notOperator == null) { |
| 8277 _writer.print(" is "); | 8701 _writer.print(" is "); |
| 8278 } else { | 8702 } else { |
| 8279 _writer.print(" is! "); | 8703 _writer.print(" is! "); |
| 8280 } | 8704 } |
| 8281 visit(node.type); | 8705 visit(node.type); |
| 8282 return null; | 8706 return null; |
| 8283 } | 8707 } |
| 8708 |
| 8284 Object visitLabel(Label node) { | 8709 Object visitLabel(Label node) { |
| 8285 visit(node.label); | 8710 visit(node.label); |
| 8286 _writer.print(":"); | 8711 _writer.print(":"); |
| 8287 return null; | 8712 return null; |
| 8288 } | 8713 } |
| 8714 |
| 8289 Object visitLabeledStatement(LabeledStatement node) { | 8715 Object visitLabeledStatement(LabeledStatement node) { |
| 8290 visitList6(node.labels, " ", " "); | 8716 visitList6(node.labels, " ", " "); |
| 8291 visit(node.statement); | 8717 visit(node.statement); |
| 8292 return null; | 8718 return null; |
| 8293 } | 8719 } |
| 8720 |
| 8294 Object visitLibraryDirective(LibraryDirective node) { | 8721 Object visitLibraryDirective(LibraryDirective node) { |
| 8295 _writer.print("library "); | 8722 _writer.print("library "); |
| 8296 visit(node.name); | 8723 visit(node.name); |
| 8297 _writer.print(';'); | 8724 _writer.print(';'); |
| 8298 nl(); | 8725 nl(); |
| 8299 return null; | 8726 return null; |
| 8300 } | 8727 } |
| 8728 |
| 8301 Object visitLibraryIdentifier(LibraryIdentifier node) { | 8729 Object visitLibraryIdentifier(LibraryIdentifier node) { |
| 8302 _writer.print(node.name); | 8730 _writer.print(node.name); |
| 8303 return null; | 8731 return null; |
| 8304 } | 8732 } |
| 8733 |
| 8305 Object visitListLiteral(ListLiteral node) { | 8734 Object visitListLiteral(ListLiteral node) { |
| 8306 if (node.constKeyword != null) { | 8735 if (node.constKeyword != null) { |
| 8307 _writer.print(node.constKeyword.lexeme); | 8736 _writer.print(node.constKeyword.lexeme); |
| 8308 _writer.print(' '); | 8737 _writer.print(' '); |
| 8309 } | 8738 } |
| 8310 visit6(node.typeArguments, " "); | 8739 visit6(node.typeArguments, " "); |
| 8311 _writer.print("["); | 8740 _writer.print("["); |
| 8312 { | 8741 { |
| 8313 NodeList<Expression> elements = node.elements; | 8742 NodeList<Expression> elements = node.elements; |
| 8314 if (elements.length < 2 || elements.toString().length < 60) { | 8743 if (elements.length < 2 || elements.toString().length < 60) { |
| 8315 visitList5(elements, ", "); | 8744 visitList5(elements, ", "); |
| 8316 } else { | 8745 } else { |
| 8317 String elementIndent = "${_indentString} "; | 8746 String elementIndent = "${_indentString} "; |
| 8318 _writer.print("\n"); | 8747 _writer.print("\n"); |
| 8319 _writer.print(elementIndent); | 8748 _writer.print(elementIndent); |
| 8320 visitList5(elements, ",\n${elementIndent}"); | 8749 visitList5(elements, ",\n${elementIndent}"); |
| 8321 } | 8750 } |
| 8322 } | 8751 } |
| 8323 _writer.print("]"); | 8752 _writer.print("]"); |
| 8324 return null; | 8753 return null; |
| 8325 } | 8754 } |
| 8755 |
| 8326 Object visitMapLiteral(MapLiteral node) { | 8756 Object visitMapLiteral(MapLiteral node) { |
| 8327 if (node.constKeyword != null) { | 8757 if (node.constKeyword != null) { |
| 8328 _writer.print(node.constKeyword.lexeme); | 8758 _writer.print(node.constKeyword.lexeme); |
| 8329 _writer.print(' '); | 8759 _writer.print(' '); |
| 8330 } | 8760 } |
| 8331 visit6(node.typeArguments, " "); | 8761 visit6(node.typeArguments, " "); |
| 8332 _writer.print("{"); | 8762 _writer.print("{"); |
| 8333 visitList5(node.entries, ", "); | 8763 visitList5(node.entries, ", "); |
| 8334 _writer.print("}"); | 8764 _writer.print("}"); |
| 8335 return null; | 8765 return null; |
| 8336 } | 8766 } |
| 8767 |
| 8337 Object visitMapLiteralEntry(MapLiteralEntry node) { | 8768 Object visitMapLiteralEntry(MapLiteralEntry node) { |
| 8338 visit(node.key); | 8769 visit(node.key); |
| 8339 _writer.print(" : "); | 8770 _writer.print(" : "); |
| 8340 visit(node.value); | 8771 visit(node.value); |
| 8341 return null; | 8772 return null; |
| 8342 } | 8773 } |
| 8774 |
| 8343 Object visitMethodDeclaration(MethodDeclaration node) { | 8775 Object visitMethodDeclaration(MethodDeclaration node) { |
| 8344 visit(node.documentationComment); | 8776 visit(node.documentationComment); |
| 8345 visit8(node.externalKeyword, " "); | 8777 visit8(node.externalKeyword, " "); |
| 8346 visit8(node.modifierKeyword, " "); | 8778 visit8(node.modifierKeyword, " "); |
| 8347 visit6(node.returnType, " "); | 8779 visit6(node.returnType, " "); |
| 8348 visit8(node.propertyKeyword, " "); | 8780 visit8(node.propertyKeyword, " "); |
| 8349 visit8(node.operatorKeyword, " "); | 8781 visit8(node.operatorKeyword, " "); |
| 8350 visit(node.name); | 8782 visit(node.name); |
| 8351 if (!node.isGetter) { | 8783 if (!node.isGetter) { |
| 8352 visit(node.parameters); | 8784 visit(node.parameters); |
| 8353 } | 8785 } |
| 8354 if (node.body is! EmptyFunctionBody) { | 8786 if (node.body is! EmptyFunctionBody) { |
| 8355 _writer.print(' '); | 8787 _writer.print(' '); |
| 8356 } | 8788 } |
| 8357 visit(node.body); | 8789 visit(node.body); |
| 8358 return null; | 8790 return null; |
| 8359 } | 8791 } |
| 8792 |
| 8360 Object visitMethodInvocation(MethodInvocation node) { | 8793 Object visitMethodInvocation(MethodInvocation node) { |
| 8361 if (node.isCascaded) { | 8794 if (node.isCascaded) { |
| 8362 _writer.print(".."); | 8795 _writer.print(".."); |
| 8363 } else { | 8796 } else { |
| 8364 visit6(node.target, "."); | 8797 visit6(node.target, "."); |
| 8365 } | 8798 } |
| 8366 visit(node.methodName); | 8799 visit(node.methodName); |
| 8367 visit(node.argumentList); | 8800 visit(node.argumentList); |
| 8368 return null; | 8801 return null; |
| 8369 } | 8802 } |
| 8803 |
| 8370 Object visitNamedExpression(NamedExpression node) { | 8804 Object visitNamedExpression(NamedExpression node) { |
| 8371 visit(node.name); | 8805 visit(node.name); |
| 8372 visit7(" ", node.expression); | 8806 visit7(" ", node.expression); |
| 8373 return null; | 8807 return null; |
| 8374 } | 8808 } |
| 8809 |
| 8375 Object visitNativeClause(NativeClause node) { | 8810 Object visitNativeClause(NativeClause node) { |
| 8376 _writer.print("native "); | 8811 _writer.print("native "); |
| 8377 visit(node.name); | 8812 visit(node.name); |
| 8378 return null; | 8813 return null; |
| 8379 } | 8814 } |
| 8815 |
| 8380 Object visitNativeFunctionBody(NativeFunctionBody node) { | 8816 Object visitNativeFunctionBody(NativeFunctionBody node) { |
| 8381 _writer.print("native "); | 8817 _writer.print("native "); |
| 8382 visit(node.stringLiteral); | 8818 visit(node.stringLiteral); |
| 8383 _writer.print(';'); | 8819 _writer.print(';'); |
| 8384 return null; | 8820 return null; |
| 8385 } | 8821 } |
| 8822 |
| 8386 Object visitNullLiteral(NullLiteral node) { | 8823 Object visitNullLiteral(NullLiteral node) { |
| 8387 _writer.print("null"); | 8824 _writer.print("null"); |
| 8388 return null; | 8825 return null; |
| 8389 } | 8826 } |
| 8827 |
| 8390 Object visitParenthesizedExpression(ParenthesizedExpression node) { | 8828 Object visitParenthesizedExpression(ParenthesizedExpression node) { |
| 8391 _writer.print('('); | 8829 _writer.print('('); |
| 8392 visit(node.expression); | 8830 visit(node.expression); |
| 8393 _writer.print(')'); | 8831 _writer.print(')'); |
| 8394 return null; | 8832 return null; |
| 8395 } | 8833 } |
| 8834 |
| 8396 Object visitPartDirective(PartDirective node) { | 8835 Object visitPartDirective(PartDirective node) { |
| 8397 _writer.print("part "); | 8836 _writer.print("part "); |
| 8398 visit(node.uri); | 8837 visit(node.uri); |
| 8399 _writer.print(';'); | 8838 _writer.print(';'); |
| 8400 return null; | 8839 return null; |
| 8401 } | 8840 } |
| 8841 |
| 8402 Object visitPartOfDirective(PartOfDirective node) { | 8842 Object visitPartOfDirective(PartOfDirective node) { |
| 8403 _writer.print("part of "); | 8843 _writer.print("part of "); |
| 8404 visit(node.libraryName); | 8844 visit(node.libraryName); |
| 8405 _writer.print(';'); | 8845 _writer.print(';'); |
| 8406 return null; | 8846 return null; |
| 8407 } | 8847 } |
| 8848 |
| 8408 Object visitPostfixExpression(PostfixExpression node) { | 8849 Object visitPostfixExpression(PostfixExpression node) { |
| 8409 visit(node.operand); | 8850 visit(node.operand); |
| 8410 _writer.print(node.operator.lexeme); | 8851 _writer.print(node.operator.lexeme); |
| 8411 return null; | 8852 return null; |
| 8412 } | 8853 } |
| 8854 |
| 8413 Object visitPrefixedIdentifier(PrefixedIdentifier node) { | 8855 Object visitPrefixedIdentifier(PrefixedIdentifier node) { |
| 8414 visit(node.prefix); | 8856 visit(node.prefix); |
| 8415 _writer.print('.'); | 8857 _writer.print('.'); |
| 8416 visit(node.identifier); | 8858 visit(node.identifier); |
| 8417 return null; | 8859 return null; |
| 8418 } | 8860 } |
| 8861 |
| 8419 Object visitPrefixExpression(PrefixExpression node) { | 8862 Object visitPrefixExpression(PrefixExpression node) { |
| 8420 _writer.print(node.operator.lexeme); | 8863 _writer.print(node.operator.lexeme); |
| 8421 visit(node.operand); | 8864 visit(node.operand); |
| 8422 return null; | 8865 return null; |
| 8423 } | 8866 } |
| 8867 |
| 8424 Object visitPropertyAccess(PropertyAccess node) { | 8868 Object visitPropertyAccess(PropertyAccess node) { |
| 8425 if (node.isCascaded) { | 8869 if (node.isCascaded) { |
| 8426 _writer.print(".."); | 8870 _writer.print(".."); |
| 8427 } else { | 8871 } else { |
| 8428 visit6(node.target, "."); | 8872 visit6(node.target, "."); |
| 8429 } | 8873 } |
| 8430 visit(node.propertyName); | 8874 visit(node.propertyName); |
| 8431 return null; | 8875 return null; |
| 8432 } | 8876 } |
| 8877 |
| 8433 Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation
node) { | 8878 Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation
node) { |
| 8434 _writer.print("this"); | 8879 _writer.print("this"); |
| 8435 visit7(".", node.constructorName); | 8880 visit7(".", node.constructorName); |
| 8436 visit(node.argumentList); | 8881 visit(node.argumentList); |
| 8437 return null; | 8882 return null; |
| 8438 } | 8883 } |
| 8884 |
| 8439 Object visitRethrowExpression(RethrowExpression node) { | 8885 Object visitRethrowExpression(RethrowExpression node) { |
| 8440 _writer.print("rethrow"); | 8886 _writer.print("rethrow"); |
| 8441 return null; | 8887 return null; |
| 8442 } | 8888 } |
| 8889 |
| 8443 Object visitReturnStatement(ReturnStatement node) { | 8890 Object visitReturnStatement(ReturnStatement node) { |
| 8444 Expression expression = node.expression; | 8891 Expression expression = node.expression; |
| 8445 if (expression == null) { | 8892 if (expression == null) { |
| 8446 _writer.print("return;"); | 8893 _writer.print("return;"); |
| 8447 } else { | 8894 } else { |
| 8448 _writer.print("return "); | 8895 _writer.print("return "); |
| 8449 expression.accept(this); | 8896 expression.accept(this); |
| 8450 _writer.print(";"); | 8897 _writer.print(";"); |
| 8451 } | 8898 } |
| 8452 return null; | 8899 return null; |
| 8453 } | 8900 } |
| 8901 |
| 8454 Object visitScriptTag(ScriptTag node) { | 8902 Object visitScriptTag(ScriptTag node) { |
| 8455 _writer.print(node.scriptTag.lexeme); | 8903 _writer.print(node.scriptTag.lexeme); |
| 8456 return null; | 8904 return null; |
| 8457 } | 8905 } |
| 8906 |
| 8458 Object visitShowCombinator(ShowCombinator node) { | 8907 Object visitShowCombinator(ShowCombinator node) { |
| 8459 _writer.print("show "); | 8908 _writer.print("show "); |
| 8460 visitList5(node.shownNames, ", "); | 8909 visitList5(node.shownNames, ", "); |
| 8461 return null; | 8910 return null; |
| 8462 } | 8911 } |
| 8912 |
| 8463 Object visitSimpleFormalParameter(SimpleFormalParameter node) { | 8913 Object visitSimpleFormalParameter(SimpleFormalParameter node) { |
| 8464 visit8(node.keyword, " "); | 8914 visit8(node.keyword, " "); |
| 8465 visit6(node.type, " "); | 8915 visit6(node.type, " "); |
| 8466 visit(node.identifier); | 8916 visit(node.identifier); |
| 8467 return null; | 8917 return null; |
| 8468 } | 8918 } |
| 8919 |
| 8469 Object visitSimpleIdentifier(SimpleIdentifier node) { | 8920 Object visitSimpleIdentifier(SimpleIdentifier node) { |
| 8470 _writer.print(node.token.lexeme); | 8921 _writer.print(node.token.lexeme); |
| 8471 return null; | 8922 return null; |
| 8472 } | 8923 } |
| 8924 |
| 8473 Object visitSimpleStringLiteral(SimpleStringLiteral node) { | 8925 Object visitSimpleStringLiteral(SimpleStringLiteral node) { |
| 8474 _writer.print(node.literal.lexeme); | 8926 _writer.print(node.literal.lexeme); |
| 8475 return null; | 8927 return null; |
| 8476 } | 8928 } |
| 8929 |
| 8477 Object visitStringInterpolation(StringInterpolation node) { | 8930 Object visitStringInterpolation(StringInterpolation node) { |
| 8478 visitList(node.elements); | 8931 visitList(node.elements); |
| 8479 return null; | 8932 return null; |
| 8480 } | 8933 } |
| 8934 |
| 8481 Object visitSuperConstructorInvocation(SuperConstructorInvocation node) { | 8935 Object visitSuperConstructorInvocation(SuperConstructorInvocation node) { |
| 8482 _writer.print("super"); | 8936 _writer.print("super"); |
| 8483 visit7(".", node.constructorName); | 8937 visit7(".", node.constructorName); |
| 8484 visit(node.argumentList); | 8938 visit(node.argumentList); |
| 8485 return null; | 8939 return null; |
| 8486 } | 8940 } |
| 8941 |
| 8487 Object visitSuperExpression(SuperExpression node) { | 8942 Object visitSuperExpression(SuperExpression node) { |
| 8488 _writer.print("super"); | 8943 _writer.print("super"); |
| 8489 return null; | 8944 return null; |
| 8490 } | 8945 } |
| 8946 |
| 8491 Object visitSwitchCase(SwitchCase node) { | 8947 Object visitSwitchCase(SwitchCase node) { |
| 8492 visitList6(node.labels, " ", " "); | 8948 visitList6(node.labels, " ", " "); |
| 8493 _writer.print("case "); | 8949 _writer.print("case "); |
| 8494 visit(node.expression); | 8950 visit(node.expression); |
| 8495 _writer.print(": "); | 8951 _writer.print(": "); |
| 8496 { | 8952 { |
| 8497 indentInc(); | 8953 indentInc(); |
| 8498 visitList5(node.statements, "\n"); | 8954 visitList5(node.statements, "\n"); |
| 8499 indentDec(); | 8955 indentDec(); |
| 8500 } | 8956 } |
| 8501 return null; | 8957 return null; |
| 8502 } | 8958 } |
| 8959 |
| 8503 Object visitSwitchDefault(SwitchDefault node) { | 8960 Object visitSwitchDefault(SwitchDefault node) { |
| 8504 visitList6(node.labels, " ", " "); | 8961 visitList6(node.labels, " ", " "); |
| 8505 _writer.print("default: "); | 8962 _writer.print("default: "); |
| 8506 { | 8963 { |
| 8507 indentInc(); | 8964 indentInc(); |
| 8508 visitList5(node.statements, "\n"); | 8965 visitList5(node.statements, "\n"); |
| 8509 indentDec(); | 8966 indentDec(); |
| 8510 } | 8967 } |
| 8511 return null; | 8968 return null; |
| 8512 } | 8969 } |
| 8970 |
| 8513 Object visitSwitchStatement(SwitchStatement node) { | 8971 Object visitSwitchStatement(SwitchStatement node) { |
| 8514 _writer.print("switch ("); | 8972 _writer.print("switch ("); |
| 8515 visit(node.expression); | 8973 visit(node.expression); |
| 8516 _writer.print(") {"); | 8974 _writer.print(") {"); |
| 8517 { | 8975 { |
| 8518 indentInc(); | 8976 indentInc(); |
| 8519 visitList5(node.members, "\n"); | 8977 visitList5(node.members, "\n"); |
| 8520 indentDec(); | 8978 indentDec(); |
| 8521 } | 8979 } |
| 8522 nl2(); | 8980 nl2(); |
| 8523 _writer.print('}'); | 8981 _writer.print('}'); |
| 8524 return null; | 8982 return null; |
| 8525 } | 8983 } |
| 8984 |
| 8526 Object visitSymbolLiteral(SymbolLiteral node) { | 8985 Object visitSymbolLiteral(SymbolLiteral node) { |
| 8527 _writer.print("#"); | 8986 _writer.print("#"); |
| 8528 visitList8(node.components, "."); | 8987 visitList9(node.components, "."); |
| 8529 return null; | 8988 return null; |
| 8530 } | 8989 } |
| 8990 |
| 8531 Object visitThisExpression(ThisExpression node) { | 8991 Object visitThisExpression(ThisExpression node) { |
| 8532 _writer.print("this"); | 8992 _writer.print("this"); |
| 8533 return null; | 8993 return null; |
| 8534 } | 8994 } |
| 8995 |
| 8535 Object visitThrowExpression(ThrowExpression node) { | 8996 Object visitThrowExpression(ThrowExpression node) { |
| 8536 _writer.print("throw "); | 8997 _writer.print("throw "); |
| 8537 visit(node.expression); | 8998 visit(node.expression); |
| 8538 return null; | 8999 return null; |
| 8539 } | 9000 } |
| 9001 |
| 8540 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { | 9002 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { |
| 8541 visit6(node.variables, ";"); | 9003 visit6(node.variables, ";"); |
| 8542 return null; | 9004 return null; |
| 8543 } | 9005 } |
| 9006 |
| 8544 Object visitTryStatement(TryStatement node) { | 9007 Object visitTryStatement(TryStatement node) { |
| 8545 _writer.print("try "); | 9008 _writer.print("try "); |
| 8546 visit(node.body); | 9009 visit(node.body); |
| 8547 visitList7(" ", node.catchClauses, " "); | 9010 visitList7(" ", node.catchClauses, " "); |
| 8548 visit7(" finally ", node.finallyBlock); | 9011 visit7(" finally ", node.finallyBlock); |
| 8549 return null; | 9012 return null; |
| 8550 } | 9013 } |
| 9014 |
| 8551 Object visitTypeArgumentList(TypeArgumentList node) { | 9015 Object visitTypeArgumentList(TypeArgumentList node) { |
| 8552 _writer.print('<'); | 9016 _writer.print('<'); |
| 8553 visitList5(node.arguments, ", "); | 9017 visitList5(node.arguments, ", "); |
| 8554 _writer.print('>'); | 9018 _writer.print('>'); |
| 8555 return null; | 9019 return null; |
| 8556 } | 9020 } |
| 9021 |
| 8557 Object visitTypeName(TypeName node) { | 9022 Object visitTypeName(TypeName node) { |
| 8558 visit(node.name); | 9023 visit(node.name); |
| 8559 visit(node.typeArguments); | 9024 visit(node.typeArguments); |
| 8560 return null; | 9025 return null; |
| 8561 } | 9026 } |
| 9027 |
| 8562 Object visitTypeParameter(TypeParameter node) { | 9028 Object visitTypeParameter(TypeParameter node) { |
| 8563 visit(node.name); | 9029 visit(node.name); |
| 8564 visit7(" extends ", node.bound); | 9030 visit7(" extends ", node.bound); |
| 8565 return null; | 9031 return null; |
| 8566 } | 9032 } |
| 9033 |
| 8567 Object visitTypeParameterList(TypeParameterList node) { | 9034 Object visitTypeParameterList(TypeParameterList node) { |
| 8568 _writer.print('<'); | 9035 _writer.print('<'); |
| 8569 visitList5(node.typeParameters, ", "); | 9036 visitList5(node.typeParameters, ", "); |
| 8570 _writer.print('>'); | 9037 _writer.print('>'); |
| 8571 return null; | 9038 return null; |
| 8572 } | 9039 } |
| 9040 |
| 8573 Object visitVariableDeclaration(VariableDeclaration node) { | 9041 Object visitVariableDeclaration(VariableDeclaration node) { |
| 8574 visit(node.name); | 9042 visit(node.name); |
| 8575 visit7(" = ", node.initializer); | 9043 visit7(" = ", node.initializer); |
| 8576 return null; | 9044 return null; |
| 8577 } | 9045 } |
| 9046 |
| 8578 Object visitVariableDeclarationList(VariableDeclarationList node) { | 9047 Object visitVariableDeclarationList(VariableDeclarationList node) { |
| 8579 visit8(node.keyword, " "); | 9048 visit8(node.keyword, " "); |
| 8580 visit6(node.type, " "); | 9049 visit6(node.type, " "); |
| 8581 visitList5(node.variables, ", "); | 9050 visitList5(node.variables, ", "); |
| 8582 return null; | 9051 return null; |
| 8583 } | 9052 } |
| 9053 |
| 8584 Object visitVariableDeclarationStatement(VariableDeclarationStatement node) { | 9054 Object visitVariableDeclarationStatement(VariableDeclarationStatement node) { |
| 8585 visit(node.variables); | 9055 visit(node.variables); |
| 8586 _writer.print(";"); | 9056 _writer.print(";"); |
| 8587 return null; | 9057 return null; |
| 8588 } | 9058 } |
| 9059 |
| 8589 Object visitWhileStatement(WhileStatement node) { | 9060 Object visitWhileStatement(WhileStatement node) { |
| 8590 _writer.print("while ("); | 9061 _writer.print("while ("); |
| 8591 visit(node.condition); | 9062 visit(node.condition); |
| 8592 _writer.print(") "); | 9063 _writer.print(") "); |
| 8593 visit(node.body); | 9064 visit(node.body); |
| 8594 return null; | 9065 return null; |
| 8595 } | 9066 } |
| 9067 |
| 8596 Object visitWithClause(WithClause node) { | 9068 Object visitWithClause(WithClause node) { |
| 8597 _writer.print("with "); | 9069 _writer.print("with "); |
| 8598 visitList5(node.mixinTypes, ", "); | 9070 visitList5(node.mixinTypes, ", "); |
| 8599 return null; | 9071 return null; |
| 8600 } | 9072 } |
| 9073 |
| 8601 void indent() { | 9074 void indent() { |
| 8602 _writer.print(_indentString); | 9075 _writer.print(_indentString); |
| 8603 } | 9076 } |
| 9077 |
| 8604 void indentDec() { | 9078 void indentDec() { |
| 8605 _indentLevel -= 2; | 9079 _indentLevel -= 2; |
| 8606 _indentString = StringUtils.repeat(" ", _indentLevel); | 9080 _indentString = StringUtils.repeat(" ", _indentLevel); |
| 8607 } | 9081 } |
| 9082 |
| 8608 void indentInc() { | 9083 void indentInc() { |
| 8609 _indentLevel += 2; | 9084 _indentLevel += 2; |
| 8610 _indentString = StringUtils.repeat(" ", _indentLevel); | 9085 _indentString = StringUtils.repeat(" ", _indentLevel); |
| 8611 } | 9086 } |
| 9087 |
| 8612 void nl() { | 9088 void nl() { |
| 8613 _writer.print("\n"); | 9089 _writer.print("\n"); |
| 8614 } | 9090 } |
| 9091 |
| 8615 void nl2() { | 9092 void nl2() { |
| 8616 nl(); | 9093 nl(); |
| 8617 indent(); | 9094 indent(); |
| 8618 } | 9095 } |
| 8619 | 9096 |
| 8620 /** | 9097 /** |
| 8621 * Safely visit the given node. | 9098 * Safely visit the given node. |
| 8622 * | 9099 * |
| 8623 * @param node the node to be visited | 9100 * @param node the node to be visited |
| 8624 */ | 9101 */ |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8678 visitList5(nodes, ""); | 9155 visitList5(nodes, ""); |
| 8679 } | 9156 } |
| 8680 | 9157 |
| 8681 /** | 9158 /** |
| 8682 * Print a list of nodes, separated by the given separator. | 9159 * Print a list of nodes, separated by the given separator. |
| 8683 * | 9160 * |
| 8684 * @param nodes the nodes to be printed | 9161 * @param nodes the nodes to be printed |
| 8685 * @param separator the separator to be printed between adjacent nodes | 9162 * @param separator the separator to be printed between adjacent nodes |
| 8686 */ | 9163 */ |
| 8687 void visitList5(NodeList<ASTNode> nodes, String separator) { | 9164 void visitList5(NodeList<ASTNode> nodes, String separator) { |
| 8688 if (nodes != null) { | 9165 visitList8("", nodes, separator, ""); |
| 8689 int size = nodes.length; | |
| 8690 for (int i = 0; i < size; i++) { | |
| 8691 if ("\n" == separator) { | |
| 8692 _writer.print("\n"); | |
| 8693 indent(); | |
| 8694 } else if (i > 0) { | |
| 8695 _writer.print(separator); | |
| 8696 } | |
| 8697 nodes[i].accept(this); | |
| 8698 } | |
| 8699 } | |
| 8700 } | 9166 } |
| 8701 | 9167 |
| 8702 /** | 9168 /** |
| 8703 * Print a list of nodes, separated by the given separator. | 9169 * Print a list of nodes, separated by the given separator. |
| 8704 * | 9170 * |
| 8705 * @param nodes the nodes to be printed | 9171 * @param nodes the nodes to be printed |
| 8706 * @param separator the separator to be printed between adjacent nodes | 9172 * @param separator the separator to be printed between adjacent nodes |
| 8707 * @param suffix the suffix to be printed if the list is not empty | 9173 * @param suffix the suffix to be printed if the list is not empty |
| 8708 */ | 9174 */ |
| 8709 void visitList6(NodeList<ASTNode> nodes, String separator, String suffix) { | 9175 void visitList6(NodeList<ASTNode> nodes, String separator, String suffix) { |
| 8710 if (nodes != null) { | 9176 visitList8("", nodes, separator, suffix); |
| 8711 int size = nodes.length; | |
| 8712 if (size > 0) { | |
| 8713 for (int i = 0; i < size; i++) { | |
| 8714 if (i > 0) { | |
| 8715 _writer.print(separator); | |
| 8716 } | |
| 8717 nodes[i].accept(this); | |
| 8718 } | |
| 8719 _writer.print(suffix); | |
| 8720 } | |
| 8721 } | |
| 8722 } | 9177 } |
| 8723 | 9178 |
| 8724 /** | 9179 /** |
| 8725 * Print a list of nodes, separated by the given separator. | 9180 * Print a list of nodes, separated by the given separator. |
| 8726 * | 9181 * |
| 8727 * @param prefix the prefix to be printed if the list is not empty | 9182 * @param prefix the prefix to be printed if the list is not empty |
| 8728 * @param nodes the nodes to be printed | 9183 * @param nodes the nodes to be printed |
| 8729 * @param separator the separator to be printed between adjacent nodes | 9184 * @param separator the separator to be printed between adjacent nodes |
| 8730 */ | 9185 */ |
| 8731 void visitList7(String prefix, NodeList<ASTNode> nodes, String separator) { | 9186 void visitList7(String prefix, NodeList<ASTNode> nodes, String separator) { |
| 9187 visitList8(prefix, nodes, separator, ""); |
| 9188 } |
| 9189 |
| 9190 /** |
| 9191 * Print a list of nodes, separated by the given separator. |
| 9192 * |
| 9193 * @param prefix the prefix to be printed if the list is not empty |
| 9194 * @param nodes the nodes to be printed |
| 9195 * @param separator the separator to be printed between adjacent nodes |
| 9196 * @param suffix the suffix to be printed if the list is not empty |
| 9197 */ |
| 9198 void visitList8(String prefix, NodeList<ASTNode> nodes, String separator, Stri
ng suffix) { |
| 8732 if (nodes != null) { | 9199 if (nodes != null) { |
| 8733 int size = nodes.length; | 9200 int size = nodes.length; |
| 8734 if (size > 0) { | 9201 if (size != 0) { |
| 8735 _writer.print(prefix); | 9202 _writer.print(prefix); |
| 9203 if (prefix.endsWith("\n")) { |
| 9204 indent(); |
| 9205 } |
| 9206 bool newLineSeparator = separator.endsWith("\n"); |
| 8736 for (int i = 0; i < size; i++) { | 9207 for (int i = 0; i < size; i++) { |
| 8737 if (i > 0) { | 9208 if (i > 0) { |
| 8738 _writer.print(separator); | 9209 _writer.print(separator); |
| 9210 if (newLineSeparator) { |
| 9211 indent(); |
| 9212 } |
| 8739 } | 9213 } |
| 8740 nodes[i].accept(this); | 9214 nodes[i].accept(this); |
| 8741 } | 9215 } |
| 9216 _writer.print(suffix); |
| 8742 } | 9217 } |
| 8743 } | 9218 } |
| 8744 } | 9219 } |
| 8745 | 9220 |
| 8746 /** | 9221 /** |
| 8747 * Print a list of tokens, separated by the given separator. | 9222 * Print a list of tokens, separated by the given separator. |
| 8748 * | 9223 * |
| 8749 * @param tokens the tokens to be printed | 9224 * @param tokens the tokens to be printed |
| 8750 * @param separator the separator to be printed between adjacent tokens | 9225 * @param separator the separator to be printed between adjacent tokens |
| 8751 */ | 9226 */ |
| 8752 void visitList8(List<Token> tokens, String separator) { | 9227 void visitList9(List<Token> tokens, String separator) { |
| 8753 int size = tokens.length; | 9228 int size = tokens.length; |
| 8754 for (int i = 0; i < size; i++) { | 9229 for (int i = 0; i < size; i++) { |
| 8755 if ("\n" == separator) { | 9230 if ("\n" == separator) { |
| 8756 _writer.print("\n"); | 9231 _writer.print("\n"); |
| 8757 indent(); | 9232 indent(); |
| 8758 } else if (i > 0) { | 9233 } else if (i > 0) { |
| 8759 _writer.print(separator); | 9234 _writer.print(separator); |
| 8760 } | 9235 } |
| 8761 _writer.print(tokens[i].lexeme); | 9236 _writer.print(tokens[i].lexeme); |
| 8762 } | 9237 } |
| 8763 } | 9238 } |
| 8764 } | 9239 } |
| OLD | NEW |