| 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 library engine.parser; | 3 library engine.parser; |
| 4 import 'dart:collection'; | 4 import 'dart:collection'; |
| 5 import 'java_core.dart'; | 5 import 'java_core.dart'; |
| 6 import 'java_engine.dart'; | 6 import 'java_engine.dart'; |
| 7 import 'instrumentation.dart'; | 7 import 'instrumentation.dart'; |
| 8 import 'error.dart'; | 8 import 'error.dart'; |
| 9 import 'source.dart'; | 9 import 'source.dart'; |
| 10 import 'scanner.dart'; | 10 import 'scanner.dart'; |
| (...skipping 3663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3674 CommentAndMetadata commentAndMetadata = parseCommentAndMetadata(); | 3674 CommentAndMetadata commentAndMetadata = parseCommentAndMetadata(); |
| 3675 FinalConstVarOrType holder = parseFinalConstVarOrType(true); | 3675 FinalConstVarOrType holder = parseFinalConstVarOrType(true); |
| 3676 Token thisKeyword = null; | 3676 Token thisKeyword = null; |
| 3677 Token period = null; | 3677 Token period = null; |
| 3678 if (matches(Keyword.THIS)) { | 3678 if (matches(Keyword.THIS)) { |
| 3679 thisKeyword = andAdvance; | 3679 thisKeyword = andAdvance; |
| 3680 period = expect2(TokenType.PERIOD); | 3680 period = expect2(TokenType.PERIOD); |
| 3681 } | 3681 } |
| 3682 SimpleIdentifier identifier = parseSimpleIdentifier(); | 3682 SimpleIdentifier identifier = parseSimpleIdentifier(); |
| 3683 if (matches5(TokenType.OPEN_PAREN)) { | 3683 if (matches5(TokenType.OPEN_PAREN)) { |
| 3684 if (holder.keyword != null) { | 3684 FormalParameterList parameters = parseFormalParameterList(); |
| 3685 reportError8(ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, holder.keywor
d, []); | 3685 if (thisKeyword == null) { |
| 3686 if (holder.keyword != null) { |
| 3687 reportError8(ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, holder.keyw
ord, []); |
| 3688 } |
| 3689 return new FunctionTypedFormalParameter.full(commentAndMetadata.comment,
commentAndMetadata.metadata, holder.type, identifier, parameters); |
| 3690 } else { |
| 3691 return new FieldFormalParameter.full(commentAndMetadata.comment, comment
AndMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifi
er, parameters); |
| 3686 } | 3692 } |
| 3687 if (thisKeyword != null) { | |
| 3688 } | |
| 3689 FormalParameterList parameters = parseFormalParameterList(); | |
| 3690 return new FunctionTypedFormalParameter.full(commentAndMetadata.comment, c
ommentAndMetadata.metadata, holder.type, identifier, parameters); | |
| 3691 } | 3693 } |
| 3692 TypeName type = holder.type; | 3694 TypeName type = holder.type; |
| 3693 if (type != null && matches3(type.name.beginToken, Keyword.VOID)) { | 3695 if (type != null && matches3(type.name.beginToken, Keyword.VOID)) { |
| 3694 reportError8(ParserErrorCode.VOID_PARAMETER, type.name.beginToken, []); | 3696 reportError8(ParserErrorCode.VOID_PARAMETER, type.name.beginToken, []); |
| 3695 } | 3697 } |
| 3696 if (thisKeyword != null) { | 3698 if (thisKeyword != null) { |
| 3697 return new FieldFormalParameter.full(commentAndMetadata.comment, commentAn
dMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifier
); | 3699 return new FieldFormalParameter.full(commentAndMetadata.comment, commentAn
dMetadata.metadata, holder.keyword, holder.type, thisKeyword, period, identifier
, null); |
| 3698 } | 3700 } |
| 3699 return new SimpleFormalParameter.full(commentAndMetadata.comment, commentAnd
Metadata.metadata, holder.keyword, holder.type, identifier); | 3701 return new SimpleFormalParameter.full(commentAndMetadata.comment, commentAnd
Metadata.metadata, holder.keyword, holder.type, identifier); |
| 3700 } | 3702 } |
| 3701 | 3703 |
| 3702 /** | 3704 /** |
| 3703 * Parse an operator declaration. | 3705 * Parse an operator declaration. |
| 3704 * | 3706 * |
| 3705 * <pre> | 3707 * <pre> |
| 3706 * operatorDeclaration ::= | 3708 * operatorDeclaration ::= |
| 3707 * operatorSignature (';' | functionBody) | 3709 * operatorSignature (';' | functionBody) |
| (...skipping 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6110 visit8(node.keyword, " "); | 6112 visit8(node.keyword, " "); |
| 6111 visit(node.fields); | 6113 visit(node.fields); |
| 6112 _writer.print(";"); | 6114 _writer.print(";"); |
| 6113 return null; | 6115 return null; |
| 6114 } | 6116 } |
| 6115 Object visitFieldFormalParameter(FieldFormalParameter node) { | 6117 Object visitFieldFormalParameter(FieldFormalParameter node) { |
| 6116 visit8(node.keyword, " "); | 6118 visit8(node.keyword, " "); |
| 6117 visit6(node.type, " "); | 6119 visit6(node.type, " "); |
| 6118 _writer.print("this."); | 6120 _writer.print("this."); |
| 6119 visit(node.identifier); | 6121 visit(node.identifier); |
| 6122 visit(node.parameters); |
| 6120 return null; | 6123 return null; |
| 6121 } | 6124 } |
| 6122 Object visitForEachStatement(ForEachStatement node) { | 6125 Object visitForEachStatement(ForEachStatement node) { |
| 6123 _writer.print("for ("); | 6126 _writer.print("for ("); |
| 6124 visit(node.loopVariable); | 6127 visit(node.loopVariable); |
| 6125 _writer.print(" in "); | 6128 _writer.print(" in "); |
| 6126 visit(node.iterator); | 6129 visit(node.iterator); |
| 6127 _writer.print(") "); | 6130 _writer.print(") "); |
| 6128 visit(node.body); | 6131 visit(node.body); |
| 6129 return null; | 6132 return null; |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6721 for (int i = 0; i < size; i++) { | 6724 for (int i = 0; i < size; i++) { |
| 6722 if (i > 0) { | 6725 if (i > 0) { |
| 6723 _writer.print(separator); | 6726 _writer.print(separator); |
| 6724 } | 6727 } |
| 6725 nodes[i].accept(this); | 6728 nodes[i].accept(this); |
| 6726 } | 6729 } |
| 6727 } | 6730 } |
| 6728 } | 6731 } |
| 6729 } | 6732 } |
| 6730 } | 6733 } |
| OLD | NEW |