New syntax for patterns
This commit is contained in:
@@ -6,6 +6,9 @@ import com.intellij.psi.tree.TokenSet;
|
||||
import org.jetbrains.jet.JetNodeType;
|
||||
import org.jetbrains.jet.lexer.JetTokens;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.JetNodeTypes.*;
|
||||
import static org.jetbrains.jet.lexer.JetTokens.*;
|
||||
|
||||
@@ -80,12 +83,9 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
||||
NAMESPACE_KEYWORD // for absolute qualified names
|
||||
), MODIFIER_KEYWORDS);
|
||||
|
||||
private final JetParsing myJetParsing;
|
||||
|
||||
public JetExpressionParsing(SemanticWhitespaceAwarePsiBuilder builder, JetParsing jetParsing) {
|
||||
super(builder);
|
||||
myJetParsing = jetParsing;
|
||||
}
|
||||
private static final TokenSet EXPRESSION_FOLLOW = TokenSet.create(
|
||||
SEMICOLON, DOUBLE_ARROW, COMMA, RBRACE, RPAR, RBRACKET
|
||||
);
|
||||
|
||||
@SuppressWarnings({"UnusedDeclaration"})
|
||||
private enum Precedence {
|
||||
@@ -170,6 +170,29 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
||||
}
|
||||
}
|
||||
|
||||
private final JetParsing myJetParsing;
|
||||
private TokenSet expressionFollow = null;
|
||||
private TokenSet decomposerExpressionFollow = null;
|
||||
|
||||
public JetExpressionParsing(SemanticWhitespaceAwarePsiBuilder builder, JetParsing jetParsing) {
|
||||
super(builder);
|
||||
myJetParsing = jetParsing;
|
||||
}
|
||||
|
||||
private TokenSet getDecomposerExpressionFollow() {
|
||||
// TODO : memoize
|
||||
List<IElementType> elvisFollow = new ArrayList<IElementType>();
|
||||
Precedence precedence = Precedence.ELVIS;
|
||||
while (precedence != null) {
|
||||
IElementType[] types = precedence.getOperations().getTypes();
|
||||
for (IElementType type : types) {
|
||||
elvisFollow.add(type);
|
||||
}
|
||||
precedence = precedence.higher;
|
||||
}
|
||||
return TokenSet.orSet(EXPRESSION_FOLLOW, TokenSet.create(elvisFollow.toArray(new IElementType[elvisFollow.size()])));
|
||||
}
|
||||
|
||||
/*
|
||||
* expression
|
||||
* : attributes expression
|
||||
@@ -620,14 +643,14 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
||||
|
||||
/*
|
||||
* pattern
|
||||
* : attributes pattern
|
||||
* : type // '[a] T' is a type-pattern 'T' with an attribute '[a]', not a type-pattern '[a] T'
|
||||
* // this makes sense because is-chack may be different for a type with attributes
|
||||
* : tuplePattern
|
||||
* : decomposerPattern
|
||||
* : constantPattern
|
||||
* : bindingPattern
|
||||
* : expressionPattern
|
||||
* : attributes pattern
|
||||
* : type // '[a] T' is a type-pattern 'T' with an attribute '[a]', not a type-pattern '[a] T'
|
||||
* // this makes sense because is-check may be different for a type with attributes
|
||||
* : tuplePattern
|
||||
* : decomposerPattern
|
||||
* : constantPattern
|
||||
* : bindingPattern
|
||||
* : "*" // wildcard pattern
|
||||
* ;
|
||||
*/
|
||||
private void parsePattern() {
|
||||
@@ -635,22 +658,37 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
||||
|
||||
myJetParsing.parseAttributeList();
|
||||
|
||||
if (at(NAMESPACE_KEYWORD) || at(IDENTIFIER)) {
|
||||
myJetParsing.parseUserTypeOrQualifiedName();
|
||||
if (!myBuilder.newlineBeforeCurrentToken() && at(LPAR)) {
|
||||
if (at(NAMESPACE_KEYWORD) || at(IDENTIFIER) || at(LBRACE) || at(THIS_KEYWORD)) {
|
||||
PsiBuilder.Marker rollbackMarker = mark();
|
||||
parseBinaryExpression(Precedence.ELVIS);
|
||||
if (at(AT)) {
|
||||
rollbackMarker.drop();
|
||||
advance(); // AT
|
||||
PsiBuilder.Marker list = mark();
|
||||
parseTuplePattern(DECOMPOSER_ARGUMENT);
|
||||
list.done(DECOMPOSER_ARGUMENT_LIST);
|
||||
pattern.done(DECOMPOSER_PATTERN);
|
||||
} else {
|
||||
pattern.done(TYPE_PATTERN);
|
||||
int expressionEndOffset = myBuilder.getCurrentOffset();
|
||||
rollbackMarker.rollbackTo();
|
||||
rollbackMarker = mark();
|
||||
|
||||
myJetParsing.parseTypeRef();
|
||||
if (at(AT)) {
|
||||
errorAndAdvance("'@' is allowed only after a decomposer expression, not after a type");
|
||||
}
|
||||
if (myBuilder.getCurrentOffset() < expressionEndOffset) {
|
||||
rollbackMarker.rollbackTo();
|
||||
parseBinaryExpression(Precedence.ELVIS);
|
||||
pattern.done(DECOMPOSER_PATTERN);
|
||||
} else {
|
||||
rollbackMarker.drop();
|
||||
pattern.done(TYPE_PATTERN);
|
||||
}
|
||||
}
|
||||
} else if (at(LPAR)) {
|
||||
parseTuplePattern(TUPLE_PATTERN_ENTRY);
|
||||
pattern.done(TUPLE_PATTERN);
|
||||
} else if (at(LBRACE) || at(CAPITALIZED_THIS_KEYWORD)) {
|
||||
myJetParsing.parseTypeRef();
|
||||
pattern.done(TYPE_PATTERN);
|
||||
}
|
||||
else if (at(QUEST)) {
|
||||
parseBindingPattern();
|
||||
@@ -673,10 +711,9 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
||||
* ;
|
||||
*/
|
||||
private void parseTuplePattern(JetNodeType entryType) {
|
||||
assert _at(LPAR);
|
||||
|
||||
myBuilder.disableNewlines();
|
||||
advance(); // LPAR
|
||||
expect(LPAR, "Expecting '('", getDecomposerExpressionFollow());
|
||||
|
||||
if (!at(RPAR)) {
|
||||
while (true) {
|
||||
|
||||
@@ -165,6 +165,7 @@ RAW_STRING_LITERAL = {THREE_QUO} {QUO_STRING_CHAR}* {THREE_QUO}?
|
||||
<YYINITIAL> "=" { return JetTokens.EQ ; }
|
||||
<YYINITIAL> "," { return JetTokens.COMMA ; }
|
||||
<YYINITIAL> "#" { return JetTokens.HASH ; }
|
||||
<YYINITIAL> "@" { return JetTokens.AT ; }
|
||||
|
||||
<YYINITIAL> . { return TokenType.BAD_CHARACTER; }
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ public interface JetTokens {
|
||||
JetToken NOT_IN = JetKeywordToken.keyword("NOT_IN");
|
||||
JetToken NOT_IS = JetKeywordToken.keyword("NOT_IS");
|
||||
JetToken HASH = new JetToken("HASH");
|
||||
JetToken AT = new JetToken("AT");
|
||||
|
||||
JetToken COMMA = new JetToken("COMMA");
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,6 @@ fun foo() {
|
||||
is [a] =2 => d
|
||||
is [a] 2 => d
|
||||
is [a] T => d
|
||||
is [a] T() => d
|
||||
is [a] T @ () => d
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,8 +82,10 @@ JetFile: AttributesOnPatterns.jet
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -106,6 +108,9 @@ JetFile: AttributesOnPatterns.jet
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
|
||||
@@ -21,12 +21,12 @@ fun foo() {
|
||||
+ d]
|
||||
|
||||
when (e) {
|
||||
is T
|
||||
is T @
|
||||
() => a
|
||||
in f
|
||||
() => a
|
||||
!is T
|
||||
() => a
|
||||
@ () => a
|
||||
!in f
|
||||
() => a
|
||||
f
|
||||
|
||||
@@ -229,6 +229,8 @@ JetFile: NewlinesInParentheses.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace('\n ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
@@ -264,6 +266,8 @@ JetFile: NewlinesInParentheses.jet
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
@@ -321,8 +325,10 @@ JetFile: NewlinesInParentheses.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiWhiteSpace('\n ')
|
||||
TUPLE
|
||||
PsiElement(LPAR)('(')
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace foo.bar {
|
||||
namespace.foo.bar.X
|
||||
new namespace.foo.bar.X()
|
||||
when (e) {
|
||||
is namespace.foo.bar.X(x) => {}
|
||||
is namespace.foo.bar.X @ (x) => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,22 +88,31 @@ JetFile: RootNamespace.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(namespace)('namespace')
|
||||
DOT_QIALIFIED_EXPRESSION
|
||||
DOT_QIALIFIED_EXPRESSION
|
||||
DOT_QIALIFIED_EXPRESSION
|
||||
ROOT_NAMESPACE
|
||||
PsiElement(namespace)('namespace')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
|
||||
@@ -212,18 +212,20 @@ JetFile: TypeExpressionAmbiguities_ERR.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiErrorElement:Expecting a '>'
|
||||
<empty list>
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiErrorElement:Expecting a '>'
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
+14
-14
@@ -16,8 +16,8 @@ fun foo() {
|
||||
is a => foo
|
||||
}
|
||||
when (e) {
|
||||
is Tree(a, b) => foo
|
||||
is Tree(a, b) if (a > 5) => foo
|
||||
is Tree @ (a, b) => foo
|
||||
is Tree @ (a, b) if (a > 5) => foo
|
||||
is null => foo
|
||||
is 1 => foo
|
||||
is A.b => foo
|
||||
@@ -43,14 +43,14 @@ fun foo() {
|
||||
fun foo() {
|
||||
when (val a = e) {
|
||||
is Tree => c
|
||||
is Tree(null, ?r) => c
|
||||
is a(a, b) => c
|
||||
is a(a, b) => c
|
||||
is a.a(a, b) => c
|
||||
is a.a(foo = a, bar = b) => c
|
||||
is namespace.a.a(a, b) => c
|
||||
is a(?a is T, b) => c
|
||||
is a(b, 1) => c
|
||||
is Tree @ (null, ?r) => c
|
||||
is a @ (a, b) => c
|
||||
is a @ (a, b) => c
|
||||
is a.a @ (a, b) => c
|
||||
is a.a @ (foo = a, bar = b) => c
|
||||
is namespace.a.a @ (a, b) => c
|
||||
is a @ (?a is T, b) => c
|
||||
is a @ (b, 1) => c
|
||||
in 1..2 => dsf
|
||||
!in 2 => sd
|
||||
!is t => d
|
||||
@@ -66,11 +66,11 @@ fun foo() {
|
||||
fun foo() {
|
||||
when (val a = e) {
|
||||
is Tree,
|
||||
is Tree(null, ?r),
|
||||
is a(a, b) => c
|
||||
is Tree @ (null, ?r),
|
||||
is a @ (a, b) => c
|
||||
1, foo(), bar, 2 + 3,
|
||||
is a(a, b) => c
|
||||
is a.a(=a + 3, b) => c
|
||||
is a @ (a, b) => c
|
||||
is a.a @ (=a + 3, b) => c
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+313
-161
@@ -48,8 +48,10 @@ JetFile: When.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -117,8 +119,10 @@ JetFile: When.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -144,18 +148,25 @@ JetFile: When.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Tree')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
@@ -170,18 +181,25 @@ JetFile: When.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Tree')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(if)('if')
|
||||
@@ -233,11 +251,13 @@ JetFile: When.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -313,8 +333,8 @@ JetFile: When.jet
|
||||
WHEN_CONDITION
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
WILDCARD_PATTERN
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -326,32 +346,17 @@ JetFile: When.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace('\n ')
|
||||
WHEN_ENTRY
|
||||
WHEN_CONDITION
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -366,20 +371,25 @@ JetFile: When.jet
|
||||
PsiElement(LPAR)('(')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
@@ -454,8 +464,10 @@ JetFile: When.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Tree')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Tree')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -469,6 +481,9 @@ JetFile: When.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Tree')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
@@ -479,7 +494,8 @@ JetFile: When.jet
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('r')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -495,18 +511,25 @@ JetFile: When.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
@@ -521,18 +544,25 @@ JetFile: When.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
@@ -545,23 +575,31 @@ JetFile: When.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
DOT_QIALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
@@ -574,11 +612,15 @@ JetFile: When.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
DOT_QIALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
@@ -587,8 +629,10 @@ JetFile: When.jet
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
@@ -597,8 +641,10 @@ JetFile: When.jet
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
@@ -611,25 +657,35 @@ JetFile: When.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(namespace)('namespace')
|
||||
DOT_QIALIFIED_EXPRESSION
|
||||
DOT_QIALIFIED_EXPRESSION
|
||||
ROOT_NAMESPACE
|
||||
PsiElement(namespace)('namespace')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
@@ -644,24 +700,32 @@ JetFile: When.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
@@ -676,12 +740,17 @@ JetFile: When.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
@@ -728,8 +797,10 @@ JetFile: When.jet
|
||||
PsiElement(NOT_IS)('!is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('t')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('t')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -780,36 +851,38 @@ JetFile: When.jet
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
WILDCARD_PATTERN
|
||||
PsiElement(MUL)('*')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
TYPE_PATTERN
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
@@ -825,13 +898,16 @@ JetFile: When.jet
|
||||
PsiElement(LPAR)('(')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(in)('in')
|
||||
@@ -845,48 +921,60 @@ JetFile: When.jet
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
WILDCARD_PATTERN
|
||||
PsiElement(MUL)('*')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('_')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(NOT_IS)('!is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
CALL_EXPRESSION
|
||||
DOT_QIALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(GT)('>')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
DECOMPOSER_PATTERN
|
||||
CALL_EXPRESSION
|
||||
DOT_QIALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -903,14 +991,18 @@ JetFile: When.jet
|
||||
PsiElement(LPAR)('(')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_PATTERN_ENTRY
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
@@ -918,6 +1010,27 @@ JetFile: When.jet
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('2')
|
||||
PsiWhiteSpace('\n ')
|
||||
WHEN_ENTRY
|
||||
WHEN_CONDITION
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
BINDING_PATTERN
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('2')
|
||||
PsiWhiteSpace('\n ')
|
||||
WHEN_ENTRY
|
||||
PsiElement(else)('else')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -969,8 +1082,10 @@ JetFile: When.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Tree')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Tree')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
WHEN_CONDITION
|
||||
@@ -979,6 +1094,9 @@ JetFile: When.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Tree')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
@@ -989,7 +1107,8 @@ JetFile: When.jet
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
BINDING_PATTERN
|
||||
PsiElement(QUEST)('?')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('r')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
@@ -1000,18 +1119,25 @@ JetFile: When.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
@@ -1056,18 +1182,25 @@ JetFile: When.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
@@ -1080,32 +1213,51 @@ JetFile: When.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
DOT_QIALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
EXPRESSION_PATTERN
|
||||
PsiElement(EQ)('=')
|
||||
BINARY_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(PLUS)('+')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('3')
|
||||
BINDING_PATTERN
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(if)('if')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LPAR)('(')
|
||||
BINARY_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQEQ)('==')
|
||||
PsiWhiteSpace(' ')
|
||||
BINARY_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(PLUS)('+')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('3')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
|
||||
@@ -99,10 +99,10 @@ class BinaryTree<T> : IMutableSet<T> {
|
||||
|
||||
private fun remove(node : TreeNode) {
|
||||
when (node) {
|
||||
is TreeNode(null, null) => replace(node, null)
|
||||
is TreeNode(null, right) => replace(node, right)
|
||||
is TreeNode(left, null) => replace(node, left)
|
||||
is TreeNode(left, right) => {
|
||||
is TreeNode @ (null, null) => replace(node, null)
|
||||
is TreeNode @ (null, right) => replace(node, right)
|
||||
is TreeNode @ (left, null) => replace(node, left)
|
||||
is TreeNode @ (left, right) => {
|
||||
val min = min(node.right)
|
||||
node.value = min.value
|
||||
remove(min)
|
||||
|
||||
@@ -1347,6 +1347,9 @@ JetFile: BinaryTree.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('TreeNode')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
@@ -1385,6 +1388,9 @@ JetFile: BinaryTree.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('TreeNode')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
@@ -1395,8 +1401,10 @@ JetFile: BinaryTree.jet
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('right')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('right')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
@@ -1423,12 +1431,17 @@ JetFile: BinaryTree.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('TreeNode')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('left')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('left')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
@@ -1461,18 +1474,25 @@ JetFile: BinaryTree.jet
|
||||
DECOMPOSER_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('TreeNode')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('left')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('left')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_ARGUMENT
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('right')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('right')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(DOUBLE_ARROW)('=>')
|
||||
|
||||
@@ -318,16 +318,18 @@ JetFile: BinaryHeap.jet
|
||||
PsiElement(is)('is')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PATTERN
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('IComparable')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(GT)('>')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('IComparable')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n ')
|
||||
BINARY_EXPRESSION
|
||||
|
||||
Reference in New Issue
Block a user