From 04fbaa26fef04fe43216fe5cec28c07e5a534bab Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Tue, 11 Jan 2011 00:32:59 +0300 Subject: [PATCH] Special node for match expression (as its RHS is not an expression) --- idea/src/org/jetbrains/jet/JetNodeTypes.java | 2 + .../lang/parsing/JetExpressionParsing.java | 7 + .../jetbrains/jet/lang/psi/JetMatchBlock.java | 18 + .../jet/lang/psi/JetMatchExpression.java | 32 + .../jetbrains/jet/lang/psi/JetVisitor.java | 8 + idea/testData/psi/Match.txt | 557 ++++----- idea/testData/psi/Match_ERR.txt | 241 ++-- idea/testData/psi/NewlinesInParentheses.txt | 43 +- idea/testData/psi/Precedence.txt | 28 +- idea/testData/psi/RootNamespace.txt | 67 +- idea/testData/psi/examples/BinaryTree.txt | 1099 +++++++++-------- 11 files changed, 1097 insertions(+), 1005 deletions(-) create mode 100644 idea/src/org/jetbrains/jet/lang/psi/JetMatchBlock.java create mode 100644 idea/src/org/jetbrains/jet/lang/psi/JetMatchExpression.java diff --git a/idea/src/org/jetbrains/jet/JetNodeTypes.java b/idea/src/org/jetbrains/jet/JetNodeTypes.java index ffb3bc79360..9df453a71ec 100644 --- a/idea/src/org/jetbrains/jet/JetNodeTypes.java +++ b/idea/src/org/jetbrains/jet/JetNodeTypes.java @@ -98,6 +98,7 @@ public interface JetNodeTypes { JetNodeType THIS_EXPRESSION = new JetNodeType("THIS_EXPRESSION", JetThisExpression.class); JetNodeType BINARY_EXPRESSION = new JetNodeType("BINARY_EXPRESSION", JetBinaryExpression.class); JetNodeType BINARY_WITH_TYPE = new JetNodeType("BINARY_WITH_TYPE", JetBinaryExpressionWithTypeRHS.class); + JetNodeType MATCH_EXPRESSION = new JetNodeType("MATCH_EXPRESSION", JetMatchExpression.class); JetNodeType PREFIX_EXPRESSION = new JetNodeType("PREFIX_EXPRESSION", JetPrefixExpression.class); JetNodeType POSTFIX_EXPRESSION = new JetNodeType("POSTFIX_EXPRESSION", JetPostfixExpression.class); JetNodeType CALL_EXPRESSION = new JetNodeType("CALL_EXPRESSION", JetCallExpression.class); @@ -106,6 +107,7 @@ public interface JetNodeTypes { JetNodeType DOT_QIALIFIED_EXPRESSION = new JetNodeType("DOT_QIALIFIED_EXPRESSION", JetDotQualifiedExpression.class); JetNodeType HASH_QIALIFIED_EXPRESSION = new JetNodeType("HASH_QIALIFIED_EXPRESSION", JetHashQualifiedExpression.class); JetNodeType SAFE_ACCESS_EXPRESSION = new JetNodeType("SAFE_ACCESS_EXPRESSION", JetSafeQualifiedExpression.class); + JetNodeType MATCH_BLOCK = new JetNodeType("MATCH_BLOCK", JetMatchBlock.class); JetNodeType MATCH_ENTRY = new JetNodeType("MATCH_ENTRY"); JetNodeType PATTERN = new JetNodeType("PATTERN"); JetNodeType TUPLE_PATTERN = new JetNodeType("TUPLE_PATTERN"); diff --git a/idea/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java b/idea/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java index 61d4cca23bb..40817fedde5 100644 --- a/idea/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java +++ b/idea/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java @@ -82,6 +82,11 @@ public class JetExpressionParsing extends AbstractJetParsing { public void parseRightHandSide(JetExpressionParsing parsing) { parsing.parseMatchBlock(); } + + @Override + public JetNodeType getProductType() { + return MATCH_EXPRESSION; + } }, // TODO: don't build a binary tree, build a tuple ARROW(JetTokens.ARROW), @@ -403,6 +408,7 @@ public class JetExpressionParsing extends AbstractJetParsing { * "{" matchEntry+ "}" */ private void parseMatchBlock() { + PsiBuilder.Marker mark = mark(); expect(LBRACE, "Expecting '{' to open a match block"); while (!eof() && !at(RBRACE)) { if (at(CASE_KEYWORD) || at(LBRACKET)) { @@ -412,6 +418,7 @@ public class JetExpressionParsing extends AbstractJetParsing { } } expect(RBRACE, "Expecting '}'"); + mark.done(MATCH_BLOCK); } /* diff --git a/idea/src/org/jetbrains/jet/lang/psi/JetMatchBlock.java b/idea/src/org/jetbrains/jet/lang/psi/JetMatchBlock.java new file mode 100644 index 00000000000..53b271cd895 --- /dev/null +++ b/idea/src/org/jetbrains/jet/lang/psi/JetMatchBlock.java @@ -0,0 +1,18 @@ +package org.jetbrains.jet.lang.psi; + +import com.intellij.lang.ASTNode; +import org.jetbrains.annotations.NotNull; + +/** + * @author max + */ +public class JetMatchBlock extends JetElement { + public JetMatchBlock(@NotNull ASTNode node) { + super(node); + } + + @Override + public void accept(JetVisitor visitor) { + visitor.visitMatchBlock(this); + } +} diff --git a/idea/src/org/jetbrains/jet/lang/psi/JetMatchExpression.java b/idea/src/org/jetbrains/jet/lang/psi/JetMatchExpression.java new file mode 100644 index 00000000000..94f0876ed8e --- /dev/null +++ b/idea/src/org/jetbrains/jet/lang/psi/JetMatchExpression.java @@ -0,0 +1,32 @@ +package org.jetbrains.jet.lang.psi; + +import com.intellij.lang.ASTNode; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.jet.JetNodeTypes; + +/** + * @author max + */ +public class JetMatchExpression extends JetExpression { + public JetMatchExpression(@NotNull ASTNode node) { + super(node); + } + + @Override + public void accept(JetVisitor visitor) { + visitor.visitMatchExpression(this); + } + + @NotNull + public JetExpression getTestedExpression() { + JetExpression left = findChildByClass(JetExpression.class); + assert left != null; + return left; + } + + @Nullable + public JetMatchBlock getMatchBlock() { + return (JetMatchBlock) findChildByType(JetNodeTypes.MATCH_BLOCK); + } +} diff --git a/idea/src/org/jetbrains/jet/lang/psi/JetVisitor.java b/idea/src/org/jetbrains/jet/lang/psi/JetVisitor.java index 55b0c0c930f..76fe7a5afe3 100644 --- a/idea/src/org/jetbrains/jet/lang/psi/JetVisitor.java +++ b/idea/src/org/jetbrains/jet/lang/psi/JetVisitor.java @@ -317,4 +317,12 @@ public class JetVisitor extends PsiElementVisitor { public void visitBinaryWithTypeRHSExpression(JetBinaryExpressionWithTypeRHS expression) { visitExpression(expression); } + + public void visitMatchExpression(JetMatchExpression expression) { + visitExpression(expression); + } + + public void visitMatchBlock(JetMatchBlock block) { + visitJetElement(block); + } } diff --git a/idea/testData/psi/Match.txt b/idea/testData/psi/Match.txt index 2c31a8f4393..f71818d664c 100644 --- a/idea/testData/psi/Match.txt +++ b/idea/testData/psi/Match.txt @@ -34,27 +34,28 @@ JetFile: Match.jet FUNCTION_LITERAL PsiElement(LBRACE)('{') BODY - BINARY_EXPRESSION + MATCH_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace(' ') - MATCH_ENTRY - PsiElement(case)('case') + MATCH_BLOCK + PsiElement(LBRACE)('{') PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('a') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace(' ') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') PsiComment(EOL_COMMENT)('// foo') @@ -88,302 +89,308 @@ JetFile: Match.jet BLOCK PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - BINARY_EXPRESSION + MATCH_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('e') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - BINARY_EXPRESSION + MATCH_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('e') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - BINARY_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('e') - PsiWhiteSpace(' ') - PsiElement(match)('match') - PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('Tree') - TUPLE_PATTERN - PsiElement(LPAR)('(') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('a') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('b') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('Tree') - TUPLE_PATTERN - PsiElement(LPAR)('(') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('a') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('b') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(if)('if') - PsiWhiteSpace(' ') - PsiElement(LPAR)('(') - CONDITION - BINARY_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(GT)('>') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('5') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - NULL - PsiElement(null)('null') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('A') - PsiElement(DOT)('.') - USER_TYPE - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - LONG_CONSTANT - PsiElement(LONG_LITERAL)('1l') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - FLOAT_CONSTANT - PsiElement(FLOAT_CONSTANT)('1.0') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - CHARACTER_CONSTANT - PsiElement(CHARACTER_LITERAL)(''c'') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - STRING_CONSTANT - PsiElement(STRING_LITERAL)('"sadfsa"') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - STRING_CONSTANT - PsiElement(RAW_STRING_LITERAL)('"""ddd"""') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - PsiElement(QUEST)('?') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - PsiElement(QUEST)('?') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') PsiWhiteSpace(' ') PATTERN USER_TYPE - PsiElement(IDENTIFIER)('Foo') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - PsiElement(QUEST)('?') - PsiElement(IDENTIFIER)('a') + PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + MATCH_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('e') + PsiWhiteSpace(' ') + PsiElement(match)('match') + PsiWhiteSpace(' ') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') PsiWhiteSpace(' ') PATTERN USER_TYPE - PsiElement(IDENTIFIER)('Foo') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - TUPLE_PATTERN - PsiElement(LPAR)('(') - PATTERN - PsiElement(QUEST)('?') - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(IDENTIFIER)('Tree') + TUPLE_PATTERN + PsiElement(LPAR)('(') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('a') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') PATTERN USER_TYPE - PsiElement(IDENTIFIER)('Foo') - PsiElement(COMMA)(',') + PsiElement(IDENTIFIER)('b') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('Tree') + TUPLE_PATTERN + PsiElement(LPAR)('(') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('a') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('b') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(if)('if') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + CONDITION + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('5') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + NULL + PsiElement(null)('null') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('A') + PsiElement(DOT)('.') + USER_TYPE + PsiElement(IDENTIFIER)('b') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + LONG_CONSTANT + PsiElement(LONG_LITERAL)('1l') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + FLOAT_CONSTANT + PsiElement(FLOAT_CONSTANT)('1.0') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + CHARACTER_CONSTANT + PsiElement(CHARACTER_LITERAL)(''c'') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + STRING_CONSTANT + PsiElement(STRING_LITERAL)('"sadfsa"') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + STRING_CONSTANT + PsiElement(RAW_STRING_LITERAL)('"""ddd"""') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + PsiElement(QUEST)('?') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + PsiElement(QUEST)('?') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') PsiWhiteSpace(' ') PATTERN USER_TYPE - PsiElement(IDENTIFIER)('b') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') + PsiElement(IDENTIFIER)('Foo') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + PsiElement(QUEST)('?') + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('Foo') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + TUPLE_PATTERN + PsiElement(LPAR)('(') + PATTERN + PsiElement(QUEST)('?') + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('Foo') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('b') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - BINARY_EXPRESSION - BINARY_EXPRESSION - BINARY_EXPRESSION + MATCH_EXPRESSION + MATCH_EXPRESSION + MATCH_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('e') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/idea/testData/psi/Match_ERR.txt b/idea/testData/psi/Match_ERR.txt index 7476a0d414b..ced7214535b 100644 --- a/idea/testData/psi/Match_ERR.txt +++ b/idea/testData/psi/Match_ERR.txt @@ -13,146 +13,81 @@ JetFile: Match_ERR.jet BLOCK PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - BINARY_EXPRESSION + MATCH_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('e') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - BINARY_EXPRESSION + MATCH_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('e') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - PsiErrorElement:Pattern expected - - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - BINARY_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('e') - PsiWhiteSpace(' ') - PsiElement(match)('match') - PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - PsiErrorElement:Pattern expected - - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting an expression - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - BINARY_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('e') - PsiWhiteSpace(' ') - PsiElement(match)('match') - PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - PsiErrorElement:Expecting 'case' to start pattern matching - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - BINARY_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('e') - PsiWhiteSpace(' ') - PsiElement(match)('match') - PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - PsiErrorElement:Expecting 'case' to start pattern matching - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - BINARY_EXPRESSION - BINARY_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('e') - PsiWhiteSpace(' ') - PsiElement(match)('match') - PsiWhiteSpace(' ') + MATCH_BLOCK PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') MATCH_ENTRY PsiElement(case)('case') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') PATTERN PsiErrorElement:Pattern expected - PsiElement(MINUS)('-') - PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + MATCH_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('e') + PsiWhiteSpace(' ') + PsiElement(match)('match') + PsiWhiteSpace(' ') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + PsiErrorElement:Pattern expected + + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting an expression + PsiElement(SEMICOLON)(';') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + MATCH_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('e') + PsiWhiteSpace(' ') + PsiElement(match)('match') + PsiWhiteSpace(' ') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PsiErrorElement:Expecting 'case' to start pattern matching + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('bar') PsiWhiteSpace('\n ') MATCH_ENTRY PsiElement(case)('case') PsiWhiteSpace(' ') PATTERN - TUPLE_PATTERN - PsiElement(LPAR)('(') - PsiErrorElement:Expecting a pattern - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting a pattern - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PATTERN - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting a pattern - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PATTERN - PsiErrorElement:Pattern expected - PsiElement(RPAR)(')') - PsiErrorElement:Expecting ')' - + USER_TYPE + PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') PsiElement(DOUBLE_ARROW)('=>') PsiWhiteSpace(' ') @@ -160,11 +95,83 @@ JetFile: Match_ERR.jet PsiElement(IDENTIFIER)('foo') PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + MATCH_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('e') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PsiErrorElement:Expecting 'case' to start pattern matching + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('bar') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + MATCH_EXPRESSION + MATCH_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('e') + PsiWhiteSpace(' ') + PsiElement(match)('match') + PsiWhiteSpace(' ') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + PsiErrorElement:Pattern expected + PsiElement(MINUS)('-') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + TUPLE_PATTERN + PsiElement(LPAR)('(') + PsiErrorElement:Expecting a pattern + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting a pattern + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PATTERN + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting a pattern + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PATTERN + PsiErrorElement:Pattern expected + PsiElement(RPAR)(')') + PsiErrorElement:Expecting ')' + + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + PsiElement(match)('match') + PsiWhiteSpace(' ') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/idea/testData/psi/NewlinesInParentheses.txt b/idea/testData/psi/NewlinesInParentheses.txt index 80124ca7028..d7496363e54 100644 --- a/idea/testData/psi/NewlinesInParentheses.txt +++ b/idea/testData/psi/NewlinesInParentheses.txt @@ -212,31 +212,32 @@ JetFile: NewlinesInParentheses.jet PsiElement(IDENTIFIER)('d') PsiElement(RBRACKET)(']') PsiWhiteSpace('\n\n ') - BINARY_EXPRESSION + MATCH_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('e') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('A') - PsiWhiteSpace('\n ') - TUPLE_PATTERN - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace('\n ') + TUPLE_PATTERN + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(SEMICOLON)(';') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/idea/testData/psi/Precedence.txt b/idea/testData/psi/Precedence.txt index 77b6f560dbe..bce8df420bf 100644 --- a/idea/testData/psi/Precedence.txt +++ b/idea/testData/psi/Precedence.txt @@ -605,8 +605,8 @@ JetFile: Precedence.jet PsiWhiteSpace(' ') PsiElement(EQ)('=') PsiWhiteSpace(' ') - BINARY_EXPRESSION - BINARY_EXPRESSION + MATCH_EXPRESSION + MATCH_EXPRESSION BINARY_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') @@ -618,13 +618,15 @@ JetFile: Precedence.jet PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') BINARY_EXPRESSION REFERENCE_EXPRESSION @@ -632,7 +634,7 @@ JetFile: Precedence.jet PsiWhiteSpace(' ') PsiElement(EQ)('=') PsiWhiteSpace(' ') - BINARY_EXPRESSION + MATCH_EXPRESSION BINARY_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') @@ -644,8 +646,9 @@ JetFile: Precedence.jet PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') BINARY_EXPRESSION REFERENCE_EXPRESSION @@ -660,14 +663,15 @@ JetFile: Precedence.jet PsiWhiteSpace(' ') PsiElement(ARROW)('->') PsiWhiteSpace(' ') - BINARY_EXPRESSION + MATCH_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('c') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace(' ') PsiElement(ARROW)('->') PsiWhiteSpace(' ') diff --git a/idea/testData/psi/RootNamespace.txt b/idea/testData/psi/RootNamespace.txt index 2e329a16eab..d80fa46613c 100644 --- a/idea/testData/psi/RootNamespace.txt +++ b/idea/testData/psi/RootNamespace.txt @@ -72,44 +72,45 @@ JetFile: RootNamespace.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace('\n ') - BINARY_EXPRESSION + MATCH_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('e') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - PsiElement(namespace)('namespace') - PsiElement(DOT)('.') - USER_TYPE - PsiElement(IDENTIFIER)('foo') - PsiElement(DOT)('.') - USER_TYPE - PsiElement(IDENTIFIER)('bar') - PsiElement(DOT)('.') - USER_TYPE - PsiElement(IDENTIFIER)('X') - TUPLE_PATTERN - PsiElement(LPAR)('(') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - BODY - - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + PsiElement(namespace)('namespace') + PsiElement(DOT)('.') + USER_TYPE + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + USER_TYPE + PsiElement(IDENTIFIER)('bar') + PsiElement(DOT)('.') + USER_TYPE + PsiElement(IDENTIFIER)('X') + TUPLE_PATTERN + PsiElement(LPAR)('(') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BODY + + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') diff --git a/idea/testData/psi/examples/BinaryTree.txt b/idea/testData/psi/examples/BinaryTree.txt index 1cbf2a19bed..4858429fb72 100644 --- a/idea/testData/psi/examples/BinaryTree.txt +++ b/idea/testData/psi/examples/BinaryTree.txt @@ -380,7 +380,7 @@ JetFile: BinaryTree.jet BOOLEAN_CONSTANT PsiElement(false)('false') PsiWhiteSpace('\n ') - BINARY_EXPRESSION + MATCH_EXPRESSION CALL_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('compare') @@ -402,77 +402,78 @@ JetFile: BinaryTree.jet PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('EQ') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - BOOLEAN_CONSTANT - PsiElement(true)('true') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('LS') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('contains') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - DOT_QIALIFIED_EXPRESSION + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('EQ') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('LS') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('contains') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + DOT_QIALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('left') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('item') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('GT') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('contains') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + DOT_QIALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('right') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('left') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('item') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('GT') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('contains') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - DOT_QIALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('right') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('item') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') + PsiElement(IDENTIFIER)('item') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') @@ -653,7 +654,7 @@ JetFile: BinaryTree.jet PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - BINARY_EXPRESSION + MATCH_EXPRESSION CALL_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('compare') @@ -675,81 +676,82 @@ JetFile: BinaryTree.jet PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('EQ') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - BOOLEAN_CONSTANT - PsiElement(false)('false') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('LS') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('add') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - PsiElement(ref)('ref') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('EQ') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('LS') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('add') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + PsiElement(ref)('ref') + PsiWhiteSpace(' ') + DOT_QIALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('left') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DOT_QIALIFIED_EXPRESSION + VALUE_ARGUMENT REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('node') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('left') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('GT') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('add') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - PsiElement(ref)('ref') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('GT') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('add') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + PsiElement(ref)('ref') + PsiWhiteSpace(' ') + DOT_QIALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('right') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DOT_QIALIFIED_EXPRESSION + VALUE_ARGUMENT REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('node') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('right') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') @@ -831,7 +833,7 @@ JetFile: BinaryTree.jet PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - BINARY_EXPRESSION + MATCH_EXPRESSION CALL_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('compare') @@ -853,196 +855,197 @@ JetFile: BinaryTree.jet PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('EQ') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - RETURN - PsiElement(return)('return') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') PsiWhiteSpace(' ') - BOOLEAN_CONSTANT - PsiElement(false)('false') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('LS') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace('\n ') - IF - PsiElement(if)('if') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('EQ') PsiWhiteSpace(' ') - PsiElement(LPAR)('(') - CONDITION - BINARY_EXPRESSION - DOT_QIALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('left') - PsiWhiteSpace(' ') - PsiElement(EQEQ)('==') - PsiWhiteSpace(' ') - NULL - PsiElement(null)('null') - PsiElement(RPAR)(')') + PsiElement(DOUBLE_ARROW)('=>') PsiWhiteSpace(' ') - THEN - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - BODY - BINARY_EXPRESSION - DOT_QIALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('left') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('TreeNode') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('item') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(RPAR)(')') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('LS') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace('\n ') + IF + PsiElement(if)('if') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + CONDITION + BINARY_EXPRESSION + DOT_QIALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('left') + PsiWhiteSpace(' ') + PsiElement(EQEQ)('==') + PsiWhiteSpace(' ') + NULL + PsiElement(null)('null') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + THEN + FUNCTION_LITERAL + PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - RETURN - PsiElement(return)('return') - PsiWhiteSpace(' ') - BOOLEAN_CONSTANT - PsiElement(true)('true') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace(' ') - PsiElement(else)('else') - PsiWhiteSpace(' ') - ELSE - RETURN - PsiElement(return)('return') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('add') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT + BODY + BINARY_EXPRESSION DOT_QIALIFIED_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('node') PsiElement(DOT)('.') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('left') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('GT') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' \n ') - IF - PsiElement(if)('if') - PsiWhiteSpace(' ') - PsiElement(LPAR)('(') - CONDITION - BINARY_EXPRESSION - DOT_QIALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('right') - PsiWhiteSpace(' ') - PsiElement(EQEQ)('==') - PsiWhiteSpace(' ') - NULL - PsiElement(null)('null') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - THEN - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - BODY - BINARY_EXPRESSION - DOT_QIALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('right') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('TreeNode') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('item') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('TreeNode') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('item') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + PsiElement(else)('else') + PsiWhiteSpace(' ') + ELSE + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('add') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + DOT_QIALIFIED_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('node') - PsiElement(RPAR)(')') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('left') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('GT') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' \n ') + IF + PsiElement(if)('if') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + CONDITION + BINARY_EXPRESSION + DOT_QIALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('right') + PsiWhiteSpace(' ') + PsiElement(EQEQ)('==') + PsiWhiteSpace(' ') + NULL + PsiElement(null)('null') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + THEN + FUNCTION_LITERAL + PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - RETURN - PsiElement(return)('return') - PsiWhiteSpace(' ') - BOOLEAN_CONSTANT - PsiElement(true)('true') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace(' ') - PsiElement(else)('else') - PsiWhiteSpace(' ') - ELSE - RETURN - PsiElement(return)('return') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('add') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT + BODY + BINARY_EXPRESSION DOT_QIALIFIED_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('node') PsiElement(DOT)('.') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('right') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('TreeNode') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('item') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + PsiElement(else)('else') + PsiWhiteSpace(' ') + ELSE + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('add') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + DOT_QIALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('right') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') @@ -1197,7 +1200,7 @@ JetFile: BinaryTree.jet NULL PsiElement(null)('null') PsiWhiteSpace('\n ') - BINARY_EXPRESSION + MATCH_EXPRESSION CALL_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('compare') @@ -1219,67 +1222,68 @@ JetFile: BinaryTree.jet PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('EQ') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('LS') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - CALL_EXPRESSION + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('EQ') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('find') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - DOT_QIALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('left') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('GT') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('find') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - DOT_QIALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('right') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') + PsiElement(IDENTIFIER)('node') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('LS') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('find') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + DOT_QIALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('left') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('GT') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('find') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + DOT_QIALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('right') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') @@ -1309,194 +1313,195 @@ JetFile: BinaryTree.jet BLOCK PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - BINARY_EXPRESSION + MATCH_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('node') PsiWhiteSpace(' ') PsiElement(match)('match') PsiWhiteSpace(' ') - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('TreeNode') - TUPLE_PATTERN - PsiElement(LPAR)('(') - PATTERN - NULL - PsiElement(null)('null') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PATTERN - NULL - PsiElement(null)('null') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('replace') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - NULL - PsiElement(null)('null') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('TreeNode') - TUPLE_PATTERN - PsiElement(LPAR)('(') - PATTERN - NULL - PsiElement(null)('null') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('right') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('replace') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('right') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('TreeNode') - TUPLE_PATTERN - PsiElement(LPAR)('(') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('left') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PATTERN - NULL - PsiElement(null)('null') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('replace') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('left') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - MATCH_ENTRY - PsiElement(case)('case') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('TreeNode') - TUPLE_PATTERN - PsiElement(LPAR)('(') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('left') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PATTERN - USER_TYPE - PsiElement(IDENTIFIER)('right') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - BODY - PROPERTY - PsiElement(val)('val') + MATCH_BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('TreeNode') + TUPLE_PATTERN + PsiElement(LPAR)('(') + PATTERN + NULL + PsiElement(null)('null') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('min') + PATTERN + NULL + PsiElement(null)('null') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('replace') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(EQ)('=') + VALUE_ARGUMENT + NULL + PsiElement(null)('null') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('TreeNode') + TUPLE_PATTERN + PsiElement(LPAR)('(') + PATTERN + NULL + PsiElement(null)('null') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('right') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('replace') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('right') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('TreeNode') + TUPLE_PATTERN + PsiElement(LPAR)('(') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('left') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PATTERN + NULL + PsiElement(null)('null') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('replace') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('left') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + MATCH_ENTRY + PsiElement(case)('case') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('TreeNode') + TUPLE_PATTERN + PsiElement(LPAR)('(') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('left') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PATTERN + USER_TYPE + PsiElement(IDENTIFIER)('right') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(DOUBLE_ARROW)('=>') + PsiWhiteSpace(' ') + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + BODY + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('min') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('min') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + DOT_QIALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('right') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + BINARY_EXPRESSION + DOT_QIALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('node') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('value') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + DOT_QIALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('min') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('value') + PsiWhiteSpace('\n ') CALL_EXPRESSION REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('min') + PsiElement(IDENTIFIER)('remove') VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') VALUE_ARGUMENT - DOT_QIALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('right') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('min') PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - BINARY_EXPRESSION - DOT_QIALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('node') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('value') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - DOT_QIALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('min') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('value') - PsiWhiteSpace('\n ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('remove') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('min') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') FUN PsiElement(fun)('fun')