diff --git a/.gitignore b/.gitignore index 2e662011793..ea127ef168e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ idea/idea.properties +examples/.idea/dictionaries +examples/.idea/workspace.xml diff --git a/grammar/src/expressions.grm b/grammar/src/expressions.grm index f1c55a4dd29..357a78e56ad 100644 --- a/grammar/src/expressions.grm +++ b/grammar/src/expressions.grm @@ -1,4 +1,5 @@ expression + : attributes expression : "(" expression ")" // see tupleLiteral : literalConstant : functionLiteral @@ -155,9 +156,8 @@ tupleLiteral // Ambiguity when after a SimpleName (infix call). In this case (e) functionLiteral // one can use "it" as a parameter name : "{" expressions "}" - : "{" (type ".")? SimpleName "=>" expressions "}" - : "{" (type ".")? "(" SimpleName{","} ")" "=>" expressions "}" - : "{" (type ".")? "(" parameter{","} ")" (":" type)? "=>" expressions "}" + : "{" (type ".")? modifiers SimpleName "=>" expressions "}" + : "{" (type ".")? "(" (modifiers SimpleName (":" type)?){","} ")" (":" type)? "=>" expressions "}" ; expressions diff --git a/idea/src/org/jetbrains/jet/JetNodeTypes.java b/idea/src/org/jetbrains/jet/JetNodeTypes.java index 14165494eda..35d8d5ce02b 100644 --- a/idea/src/org/jetbrains/jet/JetNodeTypes.java +++ b/idea/src/org/jetbrains/jet/JetNodeTypes.java @@ -88,6 +88,8 @@ public interface JetNodeTypes { JetNodeType LOOP_RANGE = new JetNodeType("LOOP_RANGE"); JetNodeType BODY = new JetNodeType("BODY"); JetNodeType RECEIVER_TYPE = new JetNodeType("RECEIVER_TYPE"); + JetNodeType FUNCTION_LITERAL = new JetNodeType("FUNCTION_LITERAL"); + JetNodeType ANNOTATED_EXPRESSION = new JetNodeType("ANNOTATED_EXPRESSION"); IElementType NAMESPACE_NAME = new JetNodeType("NAMESPACE_NAME"); } diff --git a/idea/src/org/jetbrains/jet/lang/parsing/AbstractJetParsing.java b/idea/src/org/jetbrains/jet/lang/parsing/AbstractJetParsing.java index 130e53b4bd7..dd2b01dd57b 100644 --- a/idea/src/org/jetbrains/jet/lang/parsing/AbstractJetParsing.java +++ b/idea/src/org/jetbrains/jet/lang/parsing/AbstractJetParsing.java @@ -166,6 +166,14 @@ import static org.jetbrains.jet.lexer.JetTokens.*; error.error(mesage); } + protected void errorUntilOffset(String mesage, int offset) { + PsiBuilder.Marker error = mark(); + while (!eof() && myBuilder.getCurrentOffset() < offset) { + advance(); + } + error.error(mesage); + } + protected int matchTokenStreamPredicate(TokenStreamPattern pattern) { PsiBuilder.Marker currentPosition = mark(); int openAngleBrackets = 0; @@ -225,6 +233,25 @@ import static org.jetbrains.jet.lexer.JetTokens.*; return myBuilder.eolInLastWhitespace() || eof(); } + protected JetParsing createTruncatedBuilder(int eofPosition) { + return new JetParsing(new TruncatedSemanticWhitespaceAwarePsiBuilder(myBuilder, eofPosition)); + } + + protected class AtOffset implements TokenStreamPredicate { + + private final int offset; + + public AtOffset(int offset) { + this.offset = offset; + } + + @Override + public boolean matching(boolean topLevel) { + return myBuilder.getCurrentOffset() == offset; + } + + } + protected class At implements TokenStreamPredicate { private final IElementType lookFor; @@ -259,6 +286,10 @@ import static org.jetbrains.jet.lexer.JetTokens.*; this(lookFor, true); } + public AtSet(IElementType... lookFor) { + this(TokenSet.create(lookFor), true); + } + @Override public boolean matching(boolean topLevel) { return (topLevel || !topLevelOnly) && atSet(lookFor); diff --git a/idea/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java b/idea/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java index 4f872c13af8..0ba93c33965 100644 --- a/idea/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java +++ b/idea/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java @@ -21,6 +21,7 @@ public class JetExpressionParsing extends AbstractJetParsing { /* * expression + * : attributes expression * : "(" expression ")" // see tupleLiteral * : literalConstant * : functionLiteral @@ -115,17 +116,23 @@ public class JetExpressionParsing extends AbstractJetParsing { if (!parseLocalDeclaration()) { PsiBuilder.Marker attributes = mark(); myJetParsing.parseAttributeList(); - attributes.error("Attributes are only allowed on declarations"); + parseExpression(); + attributes.done(ANNOTATED_EXPRESSION); } } else if (at(IDENTIFIER)) { - if (!parseLocalDeclaration()) { - expect(IDENTIFIER, "[Internal error: should never occur]"); // TODO + if (JetParsing.MODIFIER_KEYWORD_MAP.containsKey(myBuilder.getTokenText())) { + if (!parseLocalDeclaration()) { + expect(IDENTIFIER, "[Internal error: should never occur]"); + // TODO + } + } else { + expect(IDENTIFIER, "[Internal error: should never occur]"); + // TODO } } else if (at(LBRACE)) { - // TODO - myJetParsing.parseBlock(); + parseFunctionLiteral(); } else { errorAndAdvance("Expecting an expression"); @@ -134,6 +141,9 @@ public class JetExpressionParsing extends AbstractJetParsing { // TODO: Binary operations } + /* + * modifiers declarationRest + */ private boolean parseLocalDeclaration() { PsiBuilder.Marker decls = mark(); JetParsing.EnumDetector enumDetector = new JetParsing.EnumDetector(); @@ -150,6 +160,139 @@ public class JetExpressionParsing extends AbstractJetParsing { } } + /* + * functionLiteral // one can use "it" as a parameter name + * : "{" expressions "}" + * : "{" (type ".")? modifiers SimpleName "=>" expressions "}" + * : "{" (type ".")? "(" (modifiers SimpleName (":" type)?){","} ")" (":" type)? "=>" expressions "}" + * ; + */ + private void parseFunctionLiteral() { + assert at(LBRACE); + + PsiBuilder.Marker literal = mark(); + + advance(); // LBRACE + + int doubleArrowPos = matchTokenStreamPredicate(new FirstBefore(new At(DOUBLE_ARROW), new At(RBRACE))); + + if (doubleArrowPos >= 0) { + boolean dontExpectParameters = false; + + int lastDot = matchTokenStreamPredicate(new LastBefore(new At(DOT), new AtOffset(doubleArrowPos))); + if (lastDot >= 0) { // There is a receiver type + PsiBuilder.Marker receiverType = mark(); + createTruncatedBuilder(lastDot).parseTypeRef(); + receiverType.done(RECEIVER_TYPE); + assert at(DOT); + advance(); // DOT; + + if (!at(LPAR)) { + int firstLParPos = matchTokenStreamPredicate(new FirstBefore(new At(LPAR), new AtOffset(doubleArrowPos))); + + if (firstLParPos >= 0) { + errorUntilOffset("Expecting '('", firstLParPos); + } else { + errorUntilOffset("To specify a receiver type, use the full notation: {ReceiverType.(parameters) [: ReturnType] => ...}", + doubleArrowPos); + dontExpectParameters = true; + } + } + + } + + if (at(LPAR)) { + PsiBuilder.Marker list = mark(); + expect(LPAR, "Expecting a parameter list in parentheses (...)", TokenSet.create(DOUBLE_ARROW, COLON)); + + if (!at(RPAR)) { + while (true) { + if (at(COMMA)) errorAndAdvance("Expecting a parameter declaration"); + + PsiBuilder.Marker parameter = mark(); + int parameterNamePos = matchTokenStreamPredicate(new LastBefore(new At(IDENTIFIER), new AtSet(COMMA, RPAR, COLON, DOUBLE_ARROW))); + createTruncatedBuilder(parameterNamePos).parseModifierList(); + + expect(IDENTIFIER, "Expecting parameter declaration"); + + if (at(COLON)) { + advance(); // COLON + myJetParsing.parseTypeRef(); + } + parameter.done(VALUE_PARAMETER); + if (!at(COMMA)) break; + advance(); // COMMA + + if (at(RPAR)) { + error("Expecting a parameter declaration"); + break; + } + } + } + + expect(RPAR, "Expecting ')", TokenSet.create(DOUBLE_ARROW, COLON)); + list.done(VALUE_PARAMETER_LIST); + + if (at(COLON)) { + advance(); // COLON + if (at(DOUBLE_ARROW)) { + error("Expecting a type"); + } else { + myJetParsing.parseTypeRef(); + } + } + } else if (!dontExpectParameters) { + PsiBuilder.Marker parameter = mark(); + int parameterNamePos = matchTokenStreamPredicate(new LastBefore(new At(IDENTIFIER), new AtOffset(doubleArrowPos))); + + createTruncatedBuilder(parameterNamePos).parseModifierList(); + + expect(IDENTIFIER, "Expecting parameter name", TokenSet.create(DOUBLE_ARROW)); + + parameter.done(VALUE_PARAMETER); + + if (at(COLON)) { + errorUntilOffset("To specify a type of a parameter or a return type, use the full notation: {(parameter : Type) : ReturnType => ...}", doubleArrowPos); + } else if (at(COMMA)) { + errorUntilOffset("To specify many parameters, use the full notation: {(p1, p2, ...) => ...}", doubleArrowPos); + } else if (!at(DOUBLE_ARROW)) { + errorUntilOffset("Expecting '=>'", doubleArrowPos); + } + + } + + expectNoAdvance(DOUBLE_ARROW, "Expecting '=>'"); + } + + PsiBuilder.Marker body = mark(); + parseExpressions(); + body.done(BODY); + + expect(RBRACE, "Expecting '}'"); + + literal.done(FUNCTION_LITERAL); + } + + /* + * expressions + * : expression{SEMI} SEMI? + */ + public void parseExpressions() { + while (!eof() && !at(RBRACE)) { + parseExpression(); + consumeIf(SEMICOLON); + } + } + + /* + * declaration + * : function + * : property + * : extension + * : class + * : typedef + * ; + */ private JetNodeType parseLocalDeclarationRest(boolean isEnum) { IElementType keywordToken = tt(); JetNodeType declType = null; @@ -174,7 +317,6 @@ public class JetExpressionParsing extends AbstractJetParsing { return declType; } - /* * doWhile * : "do" expression "while" "(" expression ")" diff --git a/idea/src/org/jetbrains/jet/lang/parsing/JetParsing.java b/idea/src/org/jetbrains/jet/lang/parsing/JetParsing.java index 0cc0874ecff..f70b1a02e45 100644 --- a/idea/src/org/jetbrains/jet/lang/parsing/JetParsing.java +++ b/idea/src/org/jetbrains/jet/lang/parsing/JetParsing.java @@ -20,9 +20,9 @@ import static org.jetbrains.jet.lexer.JetTokens.*; * @author abreslav */ public class JetParsing extends AbstractJetParsing { - // TODO: token sets to constants + // TODO: token sets to constants, including derived methods - private static final Map MODIFIER_KEYWORD_MAP = new HashMap(); + public static final Map MODIFIER_KEYWORD_MAP = new HashMap(); static { for (IElementType softKeyword : MODIFIER_KEYWORDS.getTypes()) { MODIFIER_KEYWORD_MAP.put(((JetKeywordToken) softKeyword).getValue(), softKeyword); @@ -868,7 +868,7 @@ public class JetParsing extends AbstractJetParsing { /* * block - * : "{" (expression SEMI)* "}" + * : "{" (expressions)* "}" * ; */ public void parseBlock() { @@ -876,10 +876,7 @@ public class JetParsing extends AbstractJetParsing { expect(LBRACE, "Expecting '{' to open a block"); - while (!eof() && !at(RBRACE)) { - myExpressionParsing.parseExpression(); - consumeIf(SEMICOLON); - } + myExpressionParsing.parseExpressions(); expect(RBRACE, "Expecting '}"); @@ -1377,10 +1374,6 @@ public class JetParsing extends AbstractJetParsing { parameter.done(VALUE_PARAMETER); } - private JetParsing createTruncatedBuilder(int eofPosition) { - return new JetParsing(new TruncatedSemanticWhitespaceAwarePsiBuilder(myBuilder, eofPosition)); - } - /*package*/ static class EnumDetector implements Consumer { private boolean myEnum = false; diff --git a/idea/src/org/jetbrains/jet/lexer/Jet.flex b/idea/src/org/jetbrains/jet/lexer/Jet.flex index 6f30ee77119..608b1e821a1 100644 --- a/idea/src/org/jetbrains/jet/lexer/Jet.flex +++ b/idea/src/org/jetbrains/jet/lexer/Jet.flex @@ -134,6 +134,7 @@ RAW_STRING_LITERAL = {THREE_QUO} {QUO_STRING_CHAR}* {THREE_QUO}? "+=" { return JetTokens.PLUSEQ ; } "-=" { return JetTokens.MINUSEQ ; } "->" { return JetTokens.ARROW ; } + "=>" { return JetTokens.DOUBLE_ARROW; } "[" { return JetTokens.LBRACKET ; } "]" { return JetTokens.RBRACKET ; } "{" { return JetTokens.LBRACE ; } diff --git a/idea/src/org/jetbrains/jet/lexer/JetTokens.java b/idea/src/org/jetbrains/jet/lexer/JetTokens.java index 3c5c82861c2..0e30f5bad1c 100644 --- a/idea/src/org/jetbrains/jet/lexer/JetTokens.java +++ b/idea/src/org/jetbrains/jet/lexer/JetTokens.java @@ -77,6 +77,7 @@ public interface JetTokens { JetToken GTEQ = new JetToken("GTEQ"); JetToken EQEQEQ = new JetToken("EQEQEQ"); JetToken ARROW = new JetToken("ARROW"); + JetToken DOUBLE_ARROW = new JetToken("DOUBLE_ARROW"); JetToken EXCLEQEQEQ = new JetToken("EXCLEQEQEQ"); JetToken EQEQ = new JetToken("EQEQ"); JetToken EXCLEQ = new JetToken("EXCLEQ"); diff --git a/idea/src/org/jetbrains/jet/lexer/_JetLexer.java b/idea/src/org/jetbrains/jet/lexer/_JetLexer.java index 73d578b93b9..093a2cd840c 100644 --- a/idea/src/org/jetbrains/jet/lexer/_JetLexer.java +++ b/idea/src/org/jetbrains/jet/lexer/_JetLexer.java @@ -1,4 +1,4 @@ -/* The following code was generated by JFlex 1.4.3 on 12/29/10 2:56 PM */ +/* The following code was generated by JFlex 1.4.3 on 12/29/10 6:25 PM */ /* It's an automatically generated code. Do not modify it. */ package org.jetbrains.jet.lexer; @@ -13,7 +13,7 @@ import org.jetbrains.jet.lexer.JetTokens; /** * This class is a scanner generated by * JFlex 1.4.3 - * on 12/29/10 2:56 PM from the specification file + * on 12/29/10 6:25 PM from the specification file * /home/user/work/jet/idea/src/org/jetbrains/jet/lexer/Jet.flex */ class _JetLexer implements FlexLexer { @@ -146,19 +146,19 @@ class _JetLexer implements FlexLexer { "\1\35\1\36\1\37\1\40\1\0\2\2\1\34\1\41"+ "\1\42\1\43\1\44\1\45\1\46\2\11\3\12\1\3"+ "\1\47\13\3\1\50\3\3\1\51\1\52\1\53\6\3"+ - "\1\54\1\0\1\55\1\56\1\57\1\60\1\61\1\62"+ - "\1\63\1\64\1\65\1\66\1\67\1\34\1\36\1\70"+ - "\1\0\1\33\3\0\1\12\1\71\5\3\1\72\3\3"+ - "\1\73\1\74\3\3\1\75\3\3\1\76\1\3\1\77"+ - "\2\3\1\100\1\101\1\102\1\103\1\104\1\105\1\0"+ - "\2\70\1\0\1\34\2\0\2\3\1\106\6\3\1\107"+ - "\1\110\1\111\1\3\1\112\3\3\1\36\1\0\1\34"+ - "\1\0\3\3\1\113\1\3\1\114\3\3\1\115\1\116"+ - "\1\117\1\120\1\71\3\3\1\121\1\122\1\3\1\123"+ - "\6\3\1\124\2\3\1\125\1\126\1\127"; + "\1\54\1\55\1\0\1\56\1\57\1\60\1\61\1\62"+ + "\1\63\1\64\1\65\1\66\1\67\1\70\1\34\1\36"+ + "\1\71\1\0\1\33\3\0\1\12\1\72\5\3\1\73"+ + "\3\3\1\74\1\75\3\3\1\76\3\3\1\77\1\3"+ + "\1\100\2\3\1\101\1\102\1\103\1\104\1\105\1\106"+ + "\1\0\2\71\1\0\1\34\2\0\2\3\1\107\6\3"+ + "\1\110\1\111\1\112\1\3\1\113\3\3\1\36\1\0"+ + "\1\34\1\0\3\3\1\114\1\3\1\115\3\3\1\116"+ + "\1\117\1\120\1\121\1\72\3\3\1\122\1\123\1\3"+ + "\1\124\6\3\1\125\2\3\1\126\1\127\1\130"; private static int [] zzUnpackAction() { - int [] result = new int[206]; + int [] result = new int[207]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -194,24 +194,24 @@ class _JetLexer implements FlexLexer { "\0\u0aa8\0\u0ae6\0\u0b24\0\u0b62\0\272\0\u0ba0\0\u0bde\0\u0c1c"+ "\0\u0c5a\0\u0c98\0\u0cd6\0\u0d14\0\u0d52\0\u0d90\0\u0dce\0\u0e0c"+ "\0\272\0\u0e4a\0\u0e88\0\u0ec6\0\272\0\272\0\272\0\u0f04"+ - "\0\u0f42\0\u0f80\0\u0fbe\0\u0ffc\0\u103a\0\u1078\0\u10b6\0\u10f4"+ - "\0\76\0\76\0\76\0\76\0\76\0\76\0\76\0\76"+ - "\0\76\0\76\0\u1132\0\u1170\0\u11ae\0\u11ec\0\u11ec\0\u122a"+ - "\0\u1268\0\u12a6\0\76\0\u12e4\0\u1322\0\u1360\0\u139e\0\u13dc"+ - "\0\u141a\0\272\0\u1458\0\u1496\0\u14d4\0\272\0\272\0\u1512"+ - "\0\u1550\0\u158e\0\272\0\u15cc\0\u160a\0\u1648\0\272\0\u1686"+ - "\0\272\0\u16c4\0\u1702\0\272\0\272\0\76\0\76\0\76"+ - "\0\76\0\u1740\0\u177e\0\76\0\u17bc\0\u17fa\0\u1838\0\u1876"+ - "\0\u18b4\0\u18f2\0\272\0\u1930\0\u196e\0\u19ac\0\u19ea\0\u1a28"+ - "\0\u1a66\0\272\0\272\0\u1aa4\0\u1ae2\0\272\0\u1b20\0\u1b5e"+ - "\0\u1b9c\0\76\0\u1bda\0\u11ec\0\u1c18\0\u1c56\0\u1c94\0\u1cd2"+ - "\0\272\0\u1d10\0\272\0\u1d4e\0\u1d8c\0\u1dca\0\272\0\272"+ - "\0\272\0\272\0\76\0\u1e08\0\u1e46\0\u1e84\0\272\0\272"+ - "\0\u1ec2\0\272\0\u1f00\0\u1f3e\0\u1f7c\0\u1fba\0\u1ff8\0\u2036"+ - "\0\272\0\u2074\0\u20b2\0\272\0\272\0\272"; + "\0\u0f42\0\u0f80\0\u0fbe\0\u0ffc\0\u103a\0\u1078\0\76\0\u10b6"+ + "\0\u10f4\0\76\0\76\0\76\0\76\0\76\0\76\0\76"+ + "\0\76\0\76\0\76\0\u1132\0\u1170\0\u11ae\0\u11ec\0\u11ec"+ + "\0\u122a\0\u1268\0\u12a6\0\76\0\u12e4\0\u1322\0\u1360\0\u139e"+ + "\0\u13dc\0\u141a\0\272\0\u1458\0\u1496\0\u14d4\0\272\0\272"+ + "\0\u1512\0\u1550\0\u158e\0\272\0\u15cc\0\u160a\0\u1648\0\272"+ + "\0\u1686\0\272\0\u16c4\0\u1702\0\272\0\272\0\76\0\76"+ + "\0\76\0\76\0\u1740\0\u177e\0\76\0\u17bc\0\u17fa\0\u1838"+ + "\0\u1876\0\u18b4\0\u18f2\0\272\0\u1930\0\u196e\0\u19ac\0\u19ea"+ + "\0\u1a28\0\u1a66\0\272\0\272\0\u1aa4\0\u1ae2\0\272\0\u1b20"+ + "\0\u1b5e\0\u1b9c\0\76\0\u1bda\0\u11ec\0\u1c18\0\u1c56\0\u1c94"+ + "\0\u1cd2\0\272\0\u1d10\0\272\0\u1d4e\0\u1d8c\0\u1dca\0\272"+ + "\0\272\0\272\0\272\0\76\0\u1e08\0\u1e46\0\u1e84\0\272"+ + "\0\272\0\u1ec2\0\272\0\u1f00\0\u1f3e\0\u1f7c\0\u1fba\0\u1ff8"+ + "\0\u2036\0\272\0\u2074\0\u20b2\0\272\0\272\0\272"; private static int [] zzUnpackRowMap() { - int [] result = new int[206]; + int [] result = new int[207]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -279,166 +279,166 @@ class _JetLexer implements FlexLexer { "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ "\1\4\3\0\23\4\1\134\3\4\23\0\2\4\1\0"+ "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ - "\11\4\1\135\15\4\76\0\1\136\62\0\1\137\12\0"+ - "\1\140\75\0\1\141\1\0\1\142\73\0\1\143\75\0"+ - "\1\144\102\0\1\145\76\0\1\146\31\0\1\147\45\0"+ - "\1\150\65\0\1\151\22\0\1\70\7\0\1\70\3\0"+ - "\1\56\1\152\1\60\5\0\1\56\1\60\15\0\1\56"+ - "\32\0\1\153\7\0\1\153\3\0\1\56\2\0\1\153"+ - "\4\0\1\56\16\0\1\56\11\0\1\153\17\0\10\61"+ - "\1\0\65\61\7\154\1\155\66\154\1\0\1\65\7\0"+ - "\1\65\3\0\1\56\1\70\1\60\5\0\1\56\1\60"+ - "\15\0\1\56\31\0\1\156\2\66\5\156\1\0\1\66"+ - "\1\156\1\66\1\157\1\66\1\160\1\66\1\156\1\161"+ - "\3\156\3\66\2\156\1\161\3\156\1\66\5\156\2\66"+ - "\3\156\1\157\24\156\1\0\1\67\7\0\1\67\2\0"+ - "\1\55\1\0\1\162\32\0\1\55\25\0\1\70\7\0"+ - "\1\70\3\0\1\56\1\0\1\60\5\0\1\56\1\60"+ - "\15\0\1\56\31\0\10\13\1\0\65\13\10\101\1\0"+ - "\12\101\1\102\1\163\61\101\1\0\65\101\24\0\1\164"+ - "\52\0\2\4\1\0\2\4\3\0\5\4\1\0\1\4"+ - "\1\0\1\4\3\0\2\4\1\165\24\4\23\0\2\4"+ - "\1\0\2\4\3\0\5\4\1\0\1\4\1\0\1\4"+ - "\3\0\13\4\1\166\13\4\23\0\2\4\1\0\2\4"+ - "\3\0\5\4\1\0\1\4\1\0\1\4\3\0\6\4"+ - "\1\167\20\4\23\0\2\4\1\0\2\4\3\0\5\4"+ - "\1\0\1\4\1\0\1\4\3\0\10\4\1\170\16\4"+ + "\11\4\1\135\15\4\76\0\1\136\3\0\1\137\56\0"+ + "\1\140\12\0\1\141\75\0\1\142\1\0\1\143\73\0"+ + "\1\144\75\0\1\145\102\0\1\146\76\0\1\147\31\0"+ + "\1\150\45\0\1\151\65\0\1\152\22\0\1\70\7\0"+ + "\1\70\3\0\1\56\1\153\1\60\5\0\1\56\1\60"+ + "\15\0\1\56\32\0\1\154\7\0\1\154\3\0\1\56"+ + "\2\0\1\154\4\0\1\56\16\0\1\56\11\0\1\154"+ + "\17\0\10\61\1\0\65\61\7\155\1\156\66\155\1\0"+ + "\1\65\7\0\1\65\3\0\1\56\1\70\1\60\5\0"+ + "\1\56\1\60\15\0\1\56\31\0\1\157\2\66\5\157"+ + "\1\0\1\66\1\157\1\66\1\160\1\66\1\161\1\66"+ + "\1\157\1\162\3\157\3\66\2\157\1\162\3\157\1\66"+ + "\5\157\2\66\3\157\1\160\24\157\1\0\1\67\7\0"+ + "\1\67\2\0\1\55\1\0\1\163\32\0\1\55\25\0"+ + "\1\70\7\0\1\70\3\0\1\56\1\0\1\60\5\0"+ + "\1\56\1\60\15\0\1\56\31\0\10\13\1\0\65\13"+ + "\10\101\1\0\12\101\1\102\1\164\61\101\1\0\65\101"+ + "\24\0\1\165\52\0\2\4\1\0\2\4\3\0\5\4"+ + "\1\0\1\4\1\0\1\4\3\0\2\4\1\166\24\4"+ "\23\0\2\4\1\0\2\4\3\0\5\4\1\0\1\4"+ - "\1\0\1\4\3\0\11\4\1\171\15\4\23\0\2\4"+ + "\1\0\1\4\3\0\13\4\1\167\13\4\23\0\2\4"+ "\1\0\2\4\3\0\5\4\1\0\1\4\1\0\1\4"+ - "\3\0\13\4\1\172\13\4\23\0\2\4\1\0\2\4"+ - "\3\0\5\4\1\0\1\4\1\0\1\4\3\0\21\4"+ - "\1\173\5\4\23\0\2\4\1\0\2\4\3\0\5\4"+ - "\1\0\1\4\1\0\1\4\3\0\13\4\1\174\13\4"+ + "\3\0\6\4\1\170\20\4\23\0\2\4\1\0\2\4"+ + "\3\0\5\4\1\0\1\4\1\0\1\4\3\0\10\4"+ + "\1\171\16\4\23\0\2\4\1\0\2\4\3\0\5\4"+ + "\1\0\1\4\1\0\1\4\3\0\11\4\1\172\15\4"+ "\23\0\2\4\1\0\2\4\3\0\5\4\1\0\1\4"+ - "\1\0\1\4\3\0\13\4\1\175\3\4\1\176\7\4"+ - "\23\0\2\4\1\0\2\4\3\0\5\4\1\0\1\4"+ - "\1\0\1\4\3\0\22\4\1\177\4\4\23\0\2\4"+ + "\1\0\1\4\3\0\13\4\1\173\13\4\23\0\2\4"+ "\1\0\2\4\3\0\5\4\1\0\1\4\1\0\1\4"+ - "\3\0\4\4\1\200\22\4\23\0\2\4\1\0\2\4"+ - "\3\0\5\4\1\0\1\4\1\0\1\4\3\0\24\4"+ - "\1\201\2\4\23\0\2\4\1\0\2\4\3\0\5\4"+ - "\1\0\1\4\1\0\1\4\3\0\15\4\1\202\1\203"+ - "\10\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ - "\1\4\1\0\1\4\3\0\5\4\1\204\21\4\23\0"+ + "\3\0\21\4\1\174\5\4\23\0\2\4\1\0\2\4"+ + "\3\0\5\4\1\0\1\4\1\0\1\4\3\0\13\4"+ + "\1\175\13\4\23\0\2\4\1\0\2\4\3\0\5\4"+ + "\1\0\1\4\1\0\1\4\3\0\13\4\1\176\3\4"+ + "\1\177\7\4\23\0\2\4\1\0\2\4\3\0\5\4"+ + "\1\0\1\4\1\0\1\4\3\0\22\4\1\200\4\4"+ + "\23\0\2\4\1\0\2\4\3\0\5\4\1\0\1\4"+ + "\1\0\1\4\3\0\4\4\1\201\22\4\23\0\2\4"+ + "\1\0\2\4\3\0\5\4\1\0\1\4\1\0\1\4"+ + "\3\0\24\4\1\202\2\4\23\0\2\4\1\0\2\4"+ + "\3\0\5\4\1\0\1\4\1\0\1\4\3\0\15\4"+ + "\1\203\1\204\10\4\23\0\2\4\1\0\2\4\3\0"+ + "\5\4\1\0\1\4\1\0\1\4\3\0\5\4\1\205"+ + "\21\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ + "\1\4\1\0\1\4\3\0\7\4\1\206\4\4\1\207"+ + "\12\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ + "\1\4\1\0\1\4\3\0\7\4\1\210\17\4\23\0"+ "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ - "\1\4\3\0\7\4\1\205\4\4\1\206\12\4\23\0"+ - "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ - "\1\4\3\0\7\4\1\207\17\4\23\0\2\4\1\0"+ + "\1\4\3\0\24\4\1\211\2\4\23\0\2\4\1\0"+ "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ - "\24\4\1\210\2\4\23\0\2\4\1\0\2\4\3\0"+ - "\5\4\1\0\1\4\1\0\1\4\3\0\10\4\1\211"+ - "\16\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ - "\1\4\1\0\1\4\3\0\1\4\1\212\25\4\23\0"+ + "\10\4\1\212\16\4\23\0\2\4\1\0\2\4\3\0"+ + "\5\4\1\0\1\4\1\0\1\4\3\0\1\4\1\213"+ + "\25\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ + "\1\4\1\0\1\4\3\0\14\4\1\214\12\4\23\0"+ "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ - "\1\4\3\0\14\4\1\213\12\4\23\0\2\4\1\0"+ - "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ - "\7\4\1\214\14\4\1\215\2\4\76\0\1\216\54\0"+ - "\1\217\1\0\1\220\114\0\1\221\22\0\1\153\7\0"+ - "\1\153\3\0\1\56\7\0\1\56\16\0\1\56\31\0"+ - "\7\154\1\222\66\154\6\223\1\224\1\155\66\223\1\0"+ - "\2\156\6\0\1\156\1\0\1\156\1\0\1\156\1\0"+ - "\1\156\1\0\1\225\3\0\3\156\2\0\1\225\3\0"+ - "\1\156\5\0\2\156\31\0\2\156\6\0\1\156\1\0"+ - "\1\156\1\0\1\156\1\152\1\156\1\0\1\225\3\0"+ - "\3\156\2\0\1\225\3\0\1\156\5\0\2\156\31\0"+ - "\1\226\1\156\6\0\1\226\1\0\1\156\1\0\1\156"+ - "\1\0\1\156\1\227\1\225\3\0\3\156\2\0\1\225"+ - "\3\0\1\156\5\0\2\156\10\0\1\227\35\0\1\152"+ - "\57\0\24\164\1\230\51\164\1\0\2\4\1\0\2\4"+ - "\3\0\5\4\1\0\1\4\1\0\1\4\3\0\3\4"+ - "\1\231\23\4\23\0\2\4\1\0\2\4\3\0\5\4"+ - "\1\0\1\4\1\0\1\4\3\0\1\4\1\232\25\4"+ - "\23\0\2\4\1\0\2\4\3\0\5\4\1\0\1\4"+ - "\1\0\1\4\3\0\1\4\1\233\25\4\23\0\2\4"+ + "\1\4\3\0\7\4\1\215\14\4\1\216\2\4\76\0"+ + "\1\217\54\0\1\220\1\0\1\221\114\0\1\222\22\0"+ + "\1\154\7\0\1\154\3\0\1\56\7\0\1\56\16\0"+ + "\1\56\31\0\7\155\1\223\66\155\6\224\1\225\1\156"+ + "\66\224\1\0\2\157\6\0\1\157\1\0\1\157\1\0"+ + "\1\157\1\0\1\157\1\0\1\226\3\0\3\157\2\0"+ + "\1\226\3\0\1\157\5\0\2\157\31\0\2\157\6\0"+ + "\1\157\1\0\1\157\1\0\1\157\1\153\1\157\1\0"+ + "\1\226\3\0\3\157\2\0\1\226\3\0\1\157\5\0"+ + "\2\157\31\0\1\227\1\157\6\0\1\227\1\0\1\157"+ + "\1\0\1\157\1\0\1\157\1\230\1\226\3\0\3\157"+ + "\2\0\1\226\3\0\1\157\5\0\2\157\10\0\1\230"+ + "\35\0\1\153\57\0\24\165\1\231\51\165\1\0\2\4"+ "\1\0\2\4\3\0\5\4\1\0\1\4\1\0\1\4"+ - "\3\0\13\4\1\234\13\4\23\0\2\4\1\0\2\4"+ - "\3\0\5\4\1\0\1\4\1\0\1\4\3\0\6\4"+ - "\1\235\20\4\23\0\2\4\1\0\2\4\3\0\5\4"+ - "\1\0\1\4\1\0\1\4\3\0\1\4\1\236\25\4"+ - "\23\0\2\4\1\0\2\4\3\0\5\4\1\0\1\4"+ - "\1\0\1\4\3\0\2\4\1\237\24\4\23\0\2\4"+ - "\1\0\2\4\3\0\5\4\1\0\1\4\1\0\1\4"+ - "\3\0\15\4\1\240\11\4\23\0\2\4\1\0\2\4"+ + "\3\0\3\4\1\232\23\4\23\0\2\4\1\0\2\4"+ "\3\0\5\4\1\0\1\4\1\0\1\4\3\0\1\4"+ - "\1\241\25\4\23\0\2\4\1\0\2\4\3\0\5\4"+ - "\1\0\1\4\1\0\1\4\3\0\24\4\1\242\2\4"+ + "\1\233\25\4\23\0\2\4\1\0\2\4\3\0\5\4"+ + "\1\0\1\4\1\0\1\4\3\0\1\4\1\234\25\4"+ "\23\0\2\4\1\0\2\4\3\0\5\4\1\0\1\4"+ - "\1\0\1\4\3\0\1\4\1\243\25\4\23\0\2\4"+ + "\1\0\1\4\3\0\13\4\1\235\13\4\23\0\2\4"+ "\1\0\2\4\3\0\5\4\1\0\1\4\1\0\1\4"+ - "\3\0\1\4\1\244\25\4\23\0\2\4\1\0\2\4"+ - "\3\0\5\4\1\0\1\4\1\0\1\4\3\0\3\4"+ - "\1\245\23\4\23\0\2\4\1\0\2\4\3\0\5\4"+ - "\1\0\1\4\1\0\1\4\3\0\6\4\1\246\20\4"+ + "\3\0\6\4\1\236\20\4\23\0\2\4\1\0\2\4"+ + "\3\0\5\4\1\0\1\4\1\0\1\4\3\0\1\4"+ + "\1\237\25\4\23\0\2\4\1\0\2\4\3\0\5\4"+ + "\1\0\1\4\1\0\1\4\3\0\2\4\1\240\24\4"+ "\23\0\2\4\1\0\2\4\3\0\5\4\1\0\1\4"+ - "\1\0\1\4\3\0\6\4\1\247\20\4\23\0\2\4"+ + "\1\0\1\4\3\0\15\4\1\241\11\4\23\0\2\4"+ "\1\0\2\4\3\0\5\4\1\0\1\4\1\0\1\4"+ - "\3\0\11\4\1\250\15\4\23\0\2\4\1\0\2\4"+ + "\3\0\1\4\1\242\25\4\23\0\2\4\1\0\2\4"+ "\3\0\5\4\1\0\1\4\1\0\1\4\3\0\24\4"+ - "\1\251\2\4\22\0\6\154\1\252\1\222\66\154\7\223"+ - "\1\253\66\223\1\0\1\153\7\0\1\153\6\0\1\227"+ - "\35\0\1\227\20\0\1\226\1\156\6\0\1\226\1\0"+ - "\1\156\1\0\1\254\1\0\1\156\1\0\1\225\3\0"+ - "\1\254\2\156\2\0\1\225\3\0\1\156\5\0\1\254"+ - "\1\156\31\0\1\153\7\0\1\153\64\0\24\164\1\255"+ - "\51\164\1\0\2\4\1\0\2\4\3\0\5\4\1\0"+ - "\1\4\1\0\1\4\3\0\4\4\1\256\22\4\23\0"+ + "\1\243\2\4\23\0\2\4\1\0\2\4\3\0\5\4"+ + "\1\0\1\4\1\0\1\4\3\0\1\4\1\244\25\4"+ + "\23\0\2\4\1\0\2\4\3\0\5\4\1\0\1\4"+ + "\1\0\1\4\3\0\1\4\1\245\25\4\23\0\2\4"+ + "\1\0\2\4\3\0\5\4\1\0\1\4\1\0\1\4"+ + "\3\0\3\4\1\246\23\4\23\0\2\4\1\0\2\4"+ + "\3\0\5\4\1\0\1\4\1\0\1\4\3\0\6\4"+ + "\1\247\20\4\23\0\2\4\1\0\2\4\3\0\5\4"+ + "\1\0\1\4\1\0\1\4\3\0\6\4\1\250\20\4"+ + "\23\0\2\4\1\0\2\4\3\0\5\4\1\0\1\4"+ + "\1\0\1\4\3\0\11\4\1\251\15\4\23\0\2\4"+ + "\1\0\2\4\3\0\5\4\1\0\1\4\1\0\1\4"+ + "\3\0\24\4\1\252\2\4\22\0\6\155\1\253\1\223"+ + "\66\155\7\224\1\254\66\224\1\0\1\154\7\0\1\154"+ + "\6\0\1\230\35\0\1\230\20\0\1\227\1\157\6\0"+ + "\1\227\1\0\1\157\1\0\1\255\1\0\1\157\1\0"+ + "\1\226\3\0\1\255\2\157\2\0\1\226\3\0\1\157"+ + "\5\0\1\255\1\157\31\0\1\154\7\0\1\154\64\0"+ + "\24\165\1\256\51\165\1\0\2\4\1\0\2\4\3\0"+ + "\5\4\1\0\1\4\1\0\1\4\3\0\4\4\1\257"+ + "\22\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ + "\1\4\1\0\1\4\3\0\10\4\1\260\16\4\23\0"+ "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ - "\1\4\3\0\10\4\1\257\16\4\23\0\2\4\1\0"+ + "\1\4\3\0\14\4\1\261\12\4\23\0\2\4\1\0"+ "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ - "\14\4\1\260\12\4\23\0\2\4\1\0\2\4\3\0"+ - "\5\4\1\0\1\4\1\0\1\4\3\0\6\4\1\261"+ - "\20\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ - "\1\4\1\0\1\4\3\0\2\4\1\262\24\4\23\0"+ - "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ - "\1\4\3\0\23\4\1\263\3\4\23\0\2\4\1\0"+ - "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ - "\7\4\1\264\17\4\23\0\2\4\1\0\2\4\3\0"+ - "\5\4\1\0\1\4\1\0\1\4\3\0\6\4\1\265"+ - "\20\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ - "\1\4\1\0\1\4\3\0\3\4\1\266\23\4\23\0"+ - "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ - "\1\4\3\0\22\4\1\267\4\4\23\0\2\4\1\0"+ - "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ - "\1\4\1\270\25\4\23\0\2\4\1\0\2\4\3\0"+ - "\5\4\1\0\1\4\1\0\1\4\3\0\25\4\1\271"+ - "\1\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ - "\1\4\1\0\1\4\3\0\1\4\1\272\25\4\22\0"+ - "\6\223\1\224\1\253\66\223\24\164\1\273\51\164\1\0"+ - "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ - "\1\4\3\0\5\4\1\274\21\4\23\0\2\4\1\0"+ - "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ - "\6\4\1\275\20\4\23\0\2\4\1\0\2\4\3\0"+ - "\5\4\1\0\1\4\1\0\1\4\3\0\10\4\1\276"+ - "\16\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ - "\1\4\1\0\1\4\3\0\13\4\1\277\13\4\23\0"+ - "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ - "\1\4\3\0\10\4\1\300\16\4\23\0\2\4\1\0"+ - "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ - "\5\4\1\301\21\4\23\0\2\4\1\0\2\4\3\0"+ - "\5\4\1\0\1\4\1\0\1\4\3\0\17\4\1\302"+ - "\7\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ - "\1\4\1\0\1\4\3\0\3\4\1\303\23\4\23\0"+ - "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ - "\1\4\3\0\14\4\1\304\12\4\23\0\2\4\1\0"+ - "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ - "\15\4\1\305\11\4\23\0\2\4\1\0\2\4\3\0"+ - "\5\4\1\0\1\4\1\0\1\4\3\0\11\4\1\306"+ - "\15\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ - "\1\4\1\0\1\4\3\0\6\4\1\307\20\4\23\0"+ - "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ - "\1\4\3\0\3\4\1\310\23\4\23\0\2\4\1\0"+ - "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ - "\1\4\1\311\25\4\23\0\2\4\1\0\2\4\3\0"+ - "\5\4\1\0\1\4\1\0\1\4\3\0\2\4\1\312"+ + "\6\4\1\262\20\4\23\0\2\4\1\0\2\4\3\0"+ + "\5\4\1\0\1\4\1\0\1\4\3\0\2\4\1\263"+ "\24\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ - "\1\4\1\0\1\4\3\0\1\4\1\313\25\4\23\0"+ + "\1\4\1\0\1\4\3\0\23\4\1\264\3\4\23\0"+ "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ - "\1\4\3\0\10\4\1\314\16\4\23\0\2\4\1\0"+ + "\1\4\3\0\7\4\1\265\17\4\23\0\2\4\1\0"+ "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ - "\1\4\1\315\25\4\23\0\2\4\1\0\2\4\3\0"+ - "\5\4\1\0\1\4\1\0\1\4\3\0\7\4\1\316"+ - "\17\4\22\0"; + "\6\4\1\266\20\4\23\0\2\4\1\0\2\4\3\0"+ + "\5\4\1\0\1\4\1\0\1\4\3\0\3\4\1\267"+ + "\23\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ + "\1\4\1\0\1\4\3\0\22\4\1\270\4\4\23\0"+ + "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ + "\1\4\3\0\1\4\1\271\25\4\23\0\2\4\1\0"+ + "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ + "\25\4\1\272\1\4\23\0\2\4\1\0\2\4\3\0"+ + "\5\4\1\0\1\4\1\0\1\4\3\0\1\4\1\273"+ + "\25\4\22\0\6\224\1\225\1\254\66\224\24\165\1\274"+ + "\51\165\1\0\2\4\1\0\2\4\3\0\5\4\1\0"+ + "\1\4\1\0\1\4\3\0\5\4\1\275\21\4\23\0"+ + "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ + "\1\4\3\0\6\4\1\276\20\4\23\0\2\4\1\0"+ + "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ + "\10\4\1\277\16\4\23\0\2\4\1\0\2\4\3\0"+ + "\5\4\1\0\1\4\1\0\1\4\3\0\13\4\1\300"+ + "\13\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ + "\1\4\1\0\1\4\3\0\10\4\1\301\16\4\23\0"+ + "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ + "\1\4\3\0\5\4\1\302\21\4\23\0\2\4\1\0"+ + "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ + "\17\4\1\303\7\4\23\0\2\4\1\0\2\4\3\0"+ + "\5\4\1\0\1\4\1\0\1\4\3\0\3\4\1\304"+ + "\23\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ + "\1\4\1\0\1\4\3\0\14\4\1\305\12\4\23\0"+ + "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ + "\1\4\3\0\15\4\1\306\11\4\23\0\2\4\1\0"+ + "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ + "\11\4\1\307\15\4\23\0\2\4\1\0\2\4\3\0"+ + "\5\4\1\0\1\4\1\0\1\4\3\0\6\4\1\310"+ + "\20\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ + "\1\4\1\0\1\4\3\0\3\4\1\311\23\4\23\0"+ + "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ + "\1\4\3\0\1\4\1\312\25\4\23\0\2\4\1\0"+ + "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ + "\2\4\1\313\24\4\23\0\2\4\1\0\2\4\3\0"+ + "\5\4\1\0\1\4\1\0\1\4\3\0\1\4\1\314"+ + "\25\4\23\0\2\4\1\0\2\4\3\0\5\4\1\0"+ + "\1\4\1\0\1\4\3\0\10\4\1\315\16\4\23\0"+ + "\2\4\1\0\2\4\3\0\5\4\1\0\1\4\1\0"+ + "\1\4\3\0\1\4\1\316\25\4\23\0\2\4\1\0"+ + "\2\4\3\0\5\4\1\0\1\4\1\0\1\4\3\0"+ + "\7\4\1\317\17\4\22\0"; private static int [] zzUnpackTrans() { int [] result = new int[8432]; @@ -483,13 +483,13 @@ class _JetLexer implements FlexLexer { private static final String ZZ_ATTRIBUTE_PACKED_0 = "\1\0\1\11\40\1\1\11\1\1\12\11\4\1\2\11"+ - "\1\0\3\1\7\11\37\1\1\0\1\1\12\11\3\1"+ - "\1\0\1\1\3\0\1\11\32\1\4\11\1\0\1\1"+ - "\1\11\1\0\1\1\2\0\21\1\1\11\1\0\1\1"+ - "\1\0\15\1\1\11\23\1"; + "\1\0\3\1\7\11\37\1\1\11\1\0\1\1\12\11"+ + "\3\1\1\0\1\1\3\0\1\11\32\1\4\11\1\0"+ + "\1\1\1\11\1\0\1\1\2\0\21\1\1\11\1\0"+ + "\1\1\1\0\15\1\1\11\23\1"; private static int [] zzUnpackAttribute() { - int [] result = new int[206]; + int [] result = new int[207]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -797,351 +797,355 @@ class _JetLexer implements FlexLexer { case 3: { return JetTokens.IDENTIFIER; } - case 88: break; - case 62: + case 89: break; + case 63: { return JetTokens.FOR_KEYWORD ; } - case 89: break; - case 58: + case 90: break; + case 59: { return JetTokens.OUT_KEYWORD ; } - case 90: break; - case 82: + case 91: break; + case 83: { return JetTokens.RETURN_KEYWORD ; } - case 91: break; - case 71: + case 92: break; + case 72: { return JetTokens.NULL_KEYWORD ; } - case 92: break; + case 93: break; case 14: { return JetTokens.LT ; } - case 93: break; + case 94: break; case 39: { return JetTokens.DO_KEYWORD ; } - case 94: break; + case 95: break; case 13: { return JetTokens.PLUS ; } - case 95: break; + case 96: break; case 27: { return JetTokens.LONG_LITERAL; } - case 96: break; - case 57: + case 97: break; + case 58: { return JetTokens.RAW_STRING_LITERAL; } - case 97: break; - case 46: + case 98: break; + case 47: { return JetTokens.PLUSEQ ; } - case 98: break; - case 76: + case 99: break; + case 77: { return JetTokens.MATCH_KEYWORD ; } - case 99: break; + case 100: break; case 26: { return JetTokens.COMMA ; } - case 100: break; + case 101: break; case 15: { return JetTokens.GT ; } - case 101: break; + case 102: break; case 4: { return JetTokens.WHITE_SPACE; } - case 102: break; - case 83: + case 103: break; + case 84: { return JetTokens.TYPEOF_KEYWORD ; } - case 103: break; + case 104: break; case 24: { return JetTokens.RPAR ; } - case 104: break; - case 72: - { return JetTokens.TRUE_KEYWORD ; - } case 105: break; - case 50: - { return JetTokens.ANDAND ; + case 45: + { return JetTokens.DOUBLE_ARROW; } case 106: break; - case 56: - { return JetTokens.DOC_COMMENT; + case 73: + { return JetTokens.TRUE_KEYWORD ; } case 107: break; + case 51: + { return JetTokens.ANDAND ; + } + case 108: break; + case 57: + { return JetTokens.DOC_COMMENT; + } + case 109: break; case 28: { return JetTokens.FLOAT_LITERAL; } - case 108: break; + case 110: break; case 29: { return JetTokens.EOL_COMMENT; } - case 109: break; + case 111: break; case 17: { return JetTokens.COLON ; } - case 110: break; - case 48: + case 112: break; + case 49: { return JetTokens.LTEQ ; } - case 111: break; + case 113: break; case 38: { return JetTokens.ARROW ; } - case 112: break; + case 114: break; case 19: { return JetTokens.LBRACKET ; } - case 113: break; - case 55: + case 115: break; + case 56: { yypushback(2); return JetTokens.INTEGER_LITERAL; } - case 114: break; + case 116: break; case 9: { return JetTokens.CHARACTER_LITERAL; } - case 115: break; - case 64: + case 117: break; + case 65: { return JetTokens.VAR_KEYWORD ; } - case 116: break; - case 49: + case 118: break; + case 50: { return JetTokens.GTEQ ; } - case 117: break; + case 119: break; case 2: { return JetTokens.INTEGER_LITERAL; } - case 118: break; + case 120: break; case 22: { return JetTokens.RBRACE ; } - case 119: break; - case 75: + case 121: break; + case 76: { return JetTokens.CLASS_KEYWORD ; } - case 120: break; + case 122: break; case 12: { return JetTokens.EXCL ; } - case 121: break; - case 61: + case 123: break; + case 62: { return JetTokens.TRY_KEYWORD ; } - case 122: break; - case 45: + case 124: break; + case 46: { return JetTokens.EXCLEQ ; } - case 123: break; + case 125: break; case 37: { return JetTokens.MINUSEQ ; } - case 124: break; - case 77: + case 126: break; + case 78: { return JetTokens.THROW_KEYWORD ; } - case 125: break; - case 80: + case 127: break; + case 81: { return JetTokens.WHILE_KEYWORD ; } - case 126: break; + case 128: break; case 36: { return JetTokens.MINUSMINUS; } - case 127: break; - case 84: + case 129: break; + case 85: { return JetTokens.CONTINUE_KEYWORD ; } - case 128: break; - case 68: + case 130: break; + case 69: { return JetTokens.NOT_IN; } - case 129: break; + case 131: break; case 5: { return JetTokens.DIV ; } - case 130: break; - case 53: + case 132: break; + case 54: { return JetTokens.ELVIS ; } - case 131: break; + case 133: break; case 16: { return JetTokens.QUEST ; } - case 132: break; - case 51: + case 134: break; + case 52: { return JetTokens.OROR ; } - case 133: break; + case 135: break; case 18: { return JetTokens.PERC ; } - case 134: break; - case 69: + case 136: break; + case 70: { return JetTokens.EXCLEQEQEQ; } - case 135: break; - case 54: + case 137: break; + case 55: { return JetTokens.PERCEQ ; } - case 136: break; + case 138: break; case 34: { return JetTokens.RANGE ; } - case 137: break; + case 139: break; case 1: { return TokenType.BAD_CHARACTER; } - case 138: break; - case 52: + case 140: break; + case 53: { return JetTokens.SAFE_ACCESS; } - case 139: break; - case 86: + case 141: break; + case 87: { return JetTokens.NAMESPACE_KEYWORD ; } - case 140: break; - case 87: + case 142: break; + case 88: { return JetTokens.DECOMPOSER_KEYWORD ; } - case 141: break; - case 67: + case 143: break; + case 68: { return JetTokens.NOT_IS; } - case 142: break; + case 144: break; case 6: { return JetTokens.MUL ; } - case 143: break; + case 145: break; case 20: { return JetTokens.RBRACKET ; } - case 144: break; - case 47: + case 146: break; + case 48: { return JetTokens.PLUSPLUS ; } - case 145: break; - case 74: + case 147: break; + case 75: { return JetTokens.THIS_KEYWORD ; } - case 146: break; + case 148: break; case 7: { return JetTokens.DOT ; } - case 147: break; + case 149: break; case 25: { return JetTokens.SEMICOLON ; } - case 148: break; + case 150: break; case 43: { return JetTokens.IF_KEYWORD ; } - case 149: break; + case 151: break; case 11: { return JetTokens.EQ ; } - case 150: break; + case 152: break; case 23: { return JetTokens.LPAR ; } - case 151: break; + case 153: break; case 8: { return JetTokens.MINUS ; } - case 152: break; - case 78: + case 154: break; + case 79: { return JetTokens.FALSE_KEYWORD ; } - case 153: break; - case 73: + case 155: break; + case 74: { return JetTokens.TYPE_KEYWORD ; } - case 154: break; - case 59: + case 156: break; + case 60: { return JetTokens.REF_KEYWORD ; } - case 155: break; - case 63: + case 157: break; + case 64: { return JetTokens.FUN_KEYWORD ; } - case 156: break; + case 158: break; case 41: { return JetTokens.IS_KEYWORD ; } - case 157: break; + case 159: break; case 31: { return JetTokens.DIVEQ ; } - case 158: break; - case 85: + case 160: break; + case 86: { return JetTokens.EXTENSION_KEYWORD ; } - case 159: break; + case 161: break; case 40: { return JetTokens.AS_KEYWORD ; } - case 160: break; - case 70: + case 162: break; + case 71: { return JetTokens.ELSE_KEYWORD ; } - case 161: break; + case 163: break; case 42: { return JetTokens.IN_KEYWORD ; } - case 162: break; + case 164: break; case 44: { return JetTokens.EQEQ ; } - case 163: break; - case 65: + case 165: break; + case 66: { return JetTokens.VAL_KEYWORD ; } - case 164: break; - case 66: + case 166: break; + case 67: { return JetTokens.EQEQEQ ; } - case 165: break; - case 60: + case 167: break; + case 61: { return JetTokens.NEW_KEYWORD ; } - case 166: break; + case 168: break; case 32: { return JetTokens.MULTEQ ; } - case 167: break; + case 169: break; case 10: { return JetTokens.STRING_LITERAL; } - case 168: break; + case 170: break; case 21: { return JetTokens.LBRACE ; } - case 169: break; - case 81: + case 171: break; + case 82: { return JetTokens.OBJECT_KEYWORD ; } - case 170: break; - case 79: + case 172: break; + case 80: { return JetTokens.BREAK_KEYWORD ; } - case 171: break; + case 173: break; case 30: { return JetTokens.BLOCK_COMMENT; } - case 172: break; + case 174: break; case 35: { return JetTokens.FILTER ; } - case 173: break; + case 175: break; case 33: { return JetTokens.MAP ; } - case 174: break; + case 176: break; default: if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { zzAtEOF = true; diff --git a/idea/testData/psi/AnnotatedExpressions.jet b/idea/testData/psi/AnnotatedExpressions.jet new file mode 100644 index 00000000000..062e2db0602 --- /dev/null +++ b/idea/testData/psi/AnnotatedExpressions.jet @@ -0,0 +1,5 @@ +fun foo() { + [a] foo + 1 + [a] this +} diff --git a/idea/testData/psi/LocalDeclarations_ERR.txt b/idea/testData/psi/AnnotatedExpressions.txt similarity index 80% rename from idea/testData/psi/LocalDeclarations_ERR.txt rename to idea/testData/psi/AnnotatedExpressions.txt index 3d77fe5c4da..211a3252c66 100644 --- a/idea/testData/psi/LocalDeclarations_ERR.txt +++ b/idea/testData/psi/AnnotatedExpressions.txt @@ -1,4 +1,4 @@ -JetFile: LocalDeclarations_ERR.jet +JetFile: AnnotatedExpressions.jet NAMESPACE FUN PsiElement(fun)('fun') @@ -13,23 +13,27 @@ JetFile: LocalDeclarations_ERR.jet BLOCK PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - PsiErrorElement:Attributes are only allowed on declarations + ANNOTATED_EXPRESSION ATTRIBUTE_ANNOTATION PsiElement(LBRACKET)('[') ATTRIBUTE USER_TYPE PsiElement(IDENTIFIER)('a') PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') PsiWhiteSpace('\n ') INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - PsiErrorElement:Attributes are only allowed on declarations + ANNOTATED_EXPRESSION ATTRIBUTE_ANNOTATION PsiElement(LBRACKET)('[') ATTRIBUTE USER_TYPE PsiElement(IDENTIFIER)('a') PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiElement(this)('this') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/idea/testData/psi/ControlStructures.txt b/idea/testData/psi/ControlStructures.txt index 1ad0508e7d3..69f87139e36 100644 --- a/idea/testData/psi/ControlStructures.txt +++ b/idea/testData/psi/ControlStructures.txt @@ -492,8 +492,10 @@ JetFile: ControlStructures.jet PsiElement(RPAR)(')') PsiWhiteSpace(' ') BODY - BLOCK + FUNCTION_LITERAL PsiElement(LBRACE)('{') + BODY + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') WHILE @@ -506,17 +508,21 @@ JetFile: ControlStructures.jet PsiElement(RPAR)(')') PsiWhiteSpace(' ') BODY - BLOCK + FUNCTION_LITERAL PsiElement(LBRACE)('{') + BODY + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') DO_WHILE PsiElement(do)('do') PsiWhiteSpace(' ') BODY - BLOCK + FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n\n ') + BODY + PsiElement(RBRACE)('}') PsiWhiteSpace(' ') PsiElement(while)('while') diff --git a/idea/testData/psi/FunctionLiterals.jet b/idea/testData/psi/FunctionLiterals.jet new file mode 100644 index 00000000000..92f389fa1eb --- /dev/null +++ b/idea/testData/psi/FunctionLiterals.jet @@ -0,0 +1,27 @@ +fun foo() { + {} + + {foo} + + {a => a} + + {(a) => a} + {(a : A) => a} + {(a : A) : T => a} + {(a) : T => a} + + {(a, a) => a} + {(a : A, a : B) => a} + {(a : A, a) : T => a} + {(a, a : B) : T => a} + + {() => a} + {() => a} + {() : T => a} + {() : T => a} + + {T.(a) => a} + {T.(a : A) => a} + {T.(a : A) : T => a} + {T.(a) : T => a} +} diff --git a/idea/testData/psi/FunctionLiterals.txt b/idea/testData/psi/FunctionLiterals.txt new file mode 100644 index 00000000000..2870dc722ef --- /dev/null +++ b/idea/testData/psi/FunctionLiterals.txt @@ -0,0 +1,387 @@ +JetFile: FunctionLiterals.jet + NAMESPACE + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + TYPE_PARAMETER_LIST + + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BODY + + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BODY + PsiElement(IDENTIFIER)('foo') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + RECEIVER_TYPE + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + RECEIVER_TYPE + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + RECEIVER_TYPE + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + RECEIVER_TYPE + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/idea/testData/psi/FunctionLiterals_ERR.jet b/idea/testData/psi/FunctionLiterals_ERR.jet new file mode 100644 index 00000000000..54ecc770b99 --- /dev/null +++ b/idea/testData/psi/FunctionLiterals_ERR.jet @@ -0,0 +1,19 @@ +fun foo() { + { => a} + {a, b => a} + + {(a => a} + {(a : ) => a} + {(a : A) : => a} + {(a) : T => } + + {(a, ) => a} + {(a : A, , a : B) => a} + {(a : A, , , a) : T => a} + + {T.t(a) => a} + {T.t -(a : A) => a} + + {a : b => f} + {T.a : b => f} +} \ No newline at end of file diff --git a/idea/testData/psi/FunctionLiterals_ERR.txt b/idea/testData/psi/FunctionLiterals_ERR.txt new file mode 100644 index 00000000000..922ef7aae78 --- /dev/null +++ b/idea/testData/psi/FunctionLiterals_ERR.txt @@ -0,0 +1,297 @@ +JetFile: FunctionLiterals_ERR.jet + NAMESPACE + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + TYPE_PARAMETER_LIST + + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiErrorElement:Expecting parameter name + + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiErrorElement:To specify many parameters, use the full notation: {(p1, p2, ...) => ...} + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('b') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BODY + TUPLE + PsiElement(LPAR)('(') + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Expecting ')' + + PsiWhiteSpace(' ') + PsiErrorElement:Expecting an expression + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiErrorElement:Expecting a type + + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COMMA)(',') + PsiErrorElement:Expecting a parameter declaration + + PsiWhiteSpace(' ') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting a parameter declaration + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting a parameter declaration + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiErrorElement:Expecting parameter declaration + + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + RECEIVER_TYPE + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + PsiErrorElement:Expecting '(' + PsiElement(IDENTIFIER)('t') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + RECEIVER_TYPE + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + PsiErrorElement:Expecting '(' + PsiElement(IDENTIFIER)('t') + PsiWhiteSpace(' ') + PsiElement(MINUS)('-') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiErrorElement:To specify a type of a parameter or a return type, use the full notation: {(parameter : Type) : ReturnType => ...} + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('b') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('f') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + RECEIVER_TYPE + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + PsiErrorElement:To specify a receiver type, use the full notation: {ReceiverType.(parameters) [: ReturnType] => ...} + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('b') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BODY + PsiElement(IDENTIFIER)('f') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/idea/testData/psi/LocalDeclarations_ERR.jet b/idea/testData/psi/LocalDeclarations_ERR.jet deleted file mode 100644 index b45037565fb..00000000000 --- a/idea/testData/psi/LocalDeclarations_ERR.jet +++ /dev/null @@ -1,5 +0,0 @@ -fun foo() { - [a] - 1 - [a] -} diff --git a/idea/tests/org/jetbrains/jet/parsing/JetParsingTest.java b/idea/tests/org/jetbrains/jet/parsing/JetParsingTest.java index 0ba579a233d..0047169dd6b 100644 --- a/idea/tests/org/jetbrains/jet/parsing/JetParsingTest.java +++ b/idea/tests/org/jetbrains/jet/parsing/JetParsingTest.java @@ -27,6 +27,7 @@ public class JetParsingTest extends ParsingTestCase { return new File(PathManager.getResourceRoot(JetParsingTest.class, "/")).getParentFile().getParentFile().getParent(); } + public void testAnnotatedExpressions() throws Exception {doTest(true);} public void testAttributes() throws Exception {doTest(true);} public void testAttributes_ERR() throws Exception {doTest(true);} public void testBabySteps() throws Exception {doTest(true);} @@ -40,6 +41,8 @@ public class JetParsingTest extends ParsingTestCase { public void testExtensions() throws Exception {doTest(true);} public void testExtensions_ERR() throws Exception {doTest(true);} public void testFileStart_ERR() throws Exception {doTest(true);} + public void testFunctionLiterals() throws Exception {doTest(true);} + public void testFunctionLiterals_ERR() throws Exception {doTest(true);} public void testFunctions() throws Exception {doTest(true);} public void testFunctions_ERR() throws Exception {doTest(true);} public void testFunctionTypes() throws Exception {doTest(true);} @@ -48,7 +51,6 @@ public class JetParsingTest extends ParsingTestCase { public void testImports_ERR() throws Exception {doTest(true);} public void testImportSoftKW() throws Exception {doTest(true);} public void testLocalDeclarations() throws Exception {doTest(true);} - public void testLocalDeclarations_ERR() throws Exception {doTest(true);} public void testNamespaceBlock_ERR() throws Exception {doTest(true);} public void testNamespaceBlock() throws Exception {doTest(true);} public void testProperties() throws Exception {doTest(true);}