@@ -62,7 +62,7 @@ classParameters <- LPAREN __* (classParameter (__* COMMA __* classParameter)* (_
62
62
classParameter <- (modifiers? _* VAL {PUSH_KIND(auxil, K_CONSTANT);} / modifiers? _* VAR {PUSH_KIND(auxil, K_VARIABLE);} / modifiers? {PUSH_KIND(auxil, K_IGNORE);} _*)? __* <simpleIdentifier> {makeKotlinTag(auxil, $1, $1s, true);} _* COLON __* type (__* ASSIGNMENT __* expression)? {POP_SCOPE(auxil);}
63
63
delegationSpecifiers <- annotatedDelegationSpecifier (__* COMMA __* annotatedDelegationSpecifier)*
64
64
delegationSpecifier <- constructorInvocation / explicitDelegation / userType / functionType
65
- constructorInvocation <- userType _ * valueArguments
65
+ constructorInvocation <- userType __ * valueArguments
66
66
annotatedDelegationSpecifier <- annotation* __* delegationSpecifier
67
67
explicitDelegation <- (userType / functionType) __* BY __* expression
68
68
typeParameters <- LANGLE __* typeParameter (__* COMMA __* typeParameter)* (__* COMMA)? __* RANGLE
@@ -74,7 +74,7 @@ typeConstraint <- annotation* simpleIdentifier __* COLON __* type
74
74
classMemberDeclarations <- (classMemberDeclaration semis?)*
75
75
classMemberDeclaration <- secondaryConstructor / anonymousInitializer / companionObject / declaration
76
76
anonymousInitializer <- INIT __* block
77
- companionObject <- modifiers? COMPANION __* OBJECT {PUSH_KIND(auxil, K_OBJECT);} <(__* simpleIdentifier)?> {makeKotlinTag(auxil, $1e-$1s != 0 ? $1 : "Companion", $1s, true);} (__* COLON __* delegationSpecifiers)? (__* classBody)? {POP_SCOPE(auxil);}
77
+ companionObject <- modifiers? COMPANION __* (DATA __*)? OBJECT {PUSH_KIND(auxil, K_OBJECT);} <(__* simpleIdentifier)?> {makeKotlinTag(auxil, $1e-$1s != 0 ? $1 : "Companion", $1s, true);} (__* COLON __* delegationSpecifiers)? (__* classBody)? {POP_SCOPE(auxil);}
78
78
functionValueParameters <- LPAREN __* (functionValueParameter (__* COMMA __* functionValueParameter)* (__* COMMA)?)? __* RPAREN
79
79
functionValueParameter <- parameterModifiers? _* parameter (__* ASSIGNMENT __* expression)?
80
80
functionDeclaration <- modifiers? _* FUN {PUSH_KIND(auxil, K_METHOD);} _* (__* typeParameters)? _* (__* receiverTypeAndDot)? __* <simpleIdentifier> {makeKotlinTag(auxil, $1, $1s, true);} __* functionValueParameters _* (__* COLON __* type)? _* (__* typeConstraints)? _* (__* functionBody)? {POP_SCOPE(auxil);}
@@ -141,7 +141,7 @@ infixOperation <- elvisExpression (_* inOperator __* elvisExpression / _* isOper
141
141
elvisExpression <- infixFunctionCall (__* elvis __* infixFunctionCall)*
142
142
elvis <- QUEST_NO_WS COLON
143
143
infixFunctionCall <- rangeExpression (_* simpleIdentifier __* rangeExpression)*
144
- rangeExpression <- additiveExpression (_* RANGE __* additiveExpression)*
144
+ rangeExpression <- additiveExpression (_* (RANGE_UNTIL / RANGE) __* additiveExpression)*
145
145
additiveExpression <- multiplicativeExpression (_* additiveOperator __* multiplicativeExpression)*
146
146
multiplicativeExpression <- asExpression (_* multiplicativeOperator __* asExpression)*
147
147
asExpression <- prefixUnaryExpression (__* asOperator __* type)*
@@ -203,9 +203,9 @@ inside_valueArgument <- annotation? __* (simpleIdentifier __* ASSIGNMENT __*)? M
203
203
lambdaLiteral <- LCURL {PUSH_KIND(auxil, K_METHOD); makeKotlinTag(auxil, "<lambda>", $0s, true);} __* statements __* RCURL {POP_SCOPE(auxil);} / LCURL {PUSH_KIND(auxil, K_METHOD); makeKotlinTag(auxil, "<lambda>", 8, true);} __* lambdaParameters? __* ARROW __* statements __* RCURL {POP_SCOPE(auxil);}
204
204
lambdaParameters <- lambdaParameter (__* COMMA __* lambdaParameter)* (__* COMMA)?
205
205
lambdaParameter <- variableDeclaration / multiVariableDeclaration (__* COLON __* type)?
206
- anonymousFunction <- FUN {PUSH_KIND(auxil, K_METHOD); makeKotlinTag(auxil, "<anonymous>", $0s, true);} (__* type __* DOT)? __* parametersWithOptionalType (__* COLON __* type)? (__* typeConstraints)? (__* functionBody)? {POP_SCOPE(auxil);}
206
+ anonymousFunction <- (SUSPEND __*)? FUN {PUSH_KIND(auxil, K_METHOD); makeKotlinTag(auxil, "<anonymous>", $0s, true);} (__* type __* DOT)? __* parametersWithOptionalType (__* COLON __* type)? (__* typeConstraints)? (__* functionBody)? {POP_SCOPE(auxil);}
207
207
functionLiteral <- lambdaLiteral / anonymousFunction
208
- objectLiteral <- OBJECT __* COLON __* delegationSpecifiers __* classBody / OBJECT __* classBody
208
+ objectLiteral <- (DATA __*)? OBJECT __* COLON __* delegationSpecifiers __* classBody / OBJECT __* classBody
209
209
thisExpression <- THIS_AT / THIS !(Letter / UnicodeDigit)
210
210
superExpression <- SUPER_AT / SUPER (LANGLE __* type __* RANGLE)? (AT_NO_WS simpleIdentifier)?
211
211
ifExpression <- IF __* LPAREN __* expression __* RPAREN __* controlStructureBody? __* SEMICOLON? __* ELSE __* (controlStructureBody / SEMICOLON) / IF __* LPAREN __* expression __* RPAREN __* (controlStructureBody / SEMICOLON)
@@ -314,6 +314,7 @@ MOD_ASSIGNMENT <- '%='
314
314
ARROW <- '->'
315
315
#DOUBLE_ARROW <- '=>'
316
316
RANGE <- '..'
317
+ RANGE_UNTIL <- '..<'
317
318
COLONCOLON <- '::'
318
319
#DOUBLE_SEMICOLON <- ';;'
319
320
#HASH <- '#'
0 commit comments