@@ -276,7 +276,7 @@ private externAndMaybePrivate1 ::= privateKeyWord? externKeyWord
276
276
private externAndMaybePrivate2 ::= externKeyWord privateKeyWord?
277
277
private externAndMaybePrivate ::= externAndMaybePrivate2 | externAndMaybePrivate1
278
278
279
- typedefDeclaration ::= macroClassList? externOrPrivate? 'typedef' componentName genericParam? '=' functionTypeWrapper ';'?
279
+ typedefDeclaration ::= macroClassList? externOrPrivate? 'typedef' componentName genericParam? '=' typeWrapper ';'?
280
280
{pin=5 mixin="com.intellij.plugins.haxe.lang.psi.impl.AbstractHaxeTypeDefImpl" implements="com.intellij.plugins.haxe.lang.psi.HaxeClass"}
281
281
282
282
externClassDeclaration ::= macroClassList? externAndMaybePrivate 'class' componentName genericParam? inheritList? '{' externClassDeclarationBody '}'
@@ -292,7 +292,7 @@ classDeclaration ::= macroClassList? privateKeyWord? 'class' componentName gener
292
292
{pin=3 mixin="com.intellij.plugins.haxe.lang.psi.impl.AbstractHaxePsiClass" implements="com.intellij.plugins.haxe.lang.psi.HaxeClass"}
293
293
294
294
//'from' | 'to'
295
- abstractClassDeclaration ::= macroClassList? privateKeyWord? 'abstract' componentName genericParam? ('(' functionTypeWrapper ')')? ((identifier) type)* '{' classBody '}'
295
+ abstractClassDeclaration ::= macroClassList? privateKeyWord? 'abstract' componentName genericParam? ('(' typeWrapper ')')? ((identifier) type)* '{' classBody '}'
296
296
{pin=3 mixin="com.intellij.plugins.haxe.lang.psi.impl.AbstractHaxePsiClass" implements="com.intellij.plugins.haxe.lang.psi.HaxeClass"}
297
297
298
298
classBody ::= classBodyPart*
@@ -374,9 +374,19 @@ arrayLiteral ::= '[' (expressionList ','?)? ']'
374
374
{mixin="com.intellij.plugins.haxe.lang.psi.impl.HaxeReferenceImpl" implements="com.intellij.plugins.haxe.lang.psi.HaxeReference"}
375
375
376
376
private functionTypeWrapper ::= functionTypeOrWrapper functionType*
377
- private functionTypeOrWrapper ::= typeOrAnonymous | '(' functionTypeWrapper ')'
377
+ private functionTypeOrWrapper ::= '?'? typeOrAnonymous | '(' functionTypeWrapper ')'
378
378
left functionType ::= '->' '?'? typeOrAnonymous
379
379
380
+ private typeWrapper::= functionTypeWrapper
381
+
382
+ // EMB: To replace the above four lines. See issue #575. //////////////////////////////////
383
+ //functionArgument ::= (typeOrAnonymous | ('(' functionType ')'))
384
+ //private functionOptionalArgument ::= '?'? functionArgument
385
+ //functionType ::= functionOptionalArgument '->' (functionOptionalArgument '->')* functionArgument {pin=2 recoverWhile="functionTypeRecovery"}
386
+ //functionTypeRecovery ::= !('}' | ';' | '>' | '=')
387
+ //
388
+ //private typeWrapper ::= functionType | typeOrAnonymous
389
+ // /////////////////////////////////////////////////////////////////////////////////////////
380
390
/*
381
391
* Haxe and Java have this backward from each other.
382
392
*
@@ -391,13 +401,13 @@ left functionType ::= '->' '?'? typeOrAnonymous
391
401
*
392
402
*/
393
403
394
- typeTag ::= ':' functionTypeWrapper
404
+ typeTag ::= ':' typeWrapper
395
405
typeParam ::= '<' typeList '>' {mixin="com.intellij.plugins.haxe.lang.psi.impl.HaxeTypeParamPsiMixinImpl" implements="com.intellij.plugins.haxe.lang.psi.HaxeTypeParamPsiMixin"}
396
406
typeList ::= typeListPart (',' typeListPart)*
397
407
genericParam ::= '<' genericListPart (',' genericListPart)* '>'
398
408
genericListPart ::= componentName (':' ('(' typeList ')' | typeListPart))?
399
409
{mixin="com.intellij.plugins.haxe.lang.psi.impl.AbstractHaxeNamedComponent" implements="com.intellij.plugins.haxe.lang.psi.HaxeComponent"}
400
- typeListPart ::= functionTypeWrapper
410
+ typeListPart ::= typeWrapper
401
411
{mixin="com.intellij.plugins.haxe.lang.psi.impl.HaxeTypeListPartPsiMixinImpl" implements="com.intellij.plugins.haxe.lang.psi.HaxeTypeListPartPsiMixin"}
402
412
type ::= referenceExpression qualifiedReferenceExpression* typeParam?
403
413
{mixin="com.intellij.plugins.haxe.lang.psi.impl.HaxeTypePsiMixinImpl" implements="com.intellij.plugins.haxe.lang.psi.HaxeTypePsiMixin"}
@@ -549,7 +559,7 @@ regularExpressionLiteral ::= REG_EXP
549
559
private parenthesizedExpressionOrCall ::= parenthesizedExpression qualifiedReferenceTail?
550
560
parenthesizedExpression ::= '(' (typeCheckExpr | expression | statement) ')'
551
561
552
- typeCheckExpr ::= expression ':' functionTypeWrapper
562
+ typeCheckExpr ::= expression ':' typeWrapper
553
563
{mixin="com.intellij.plugins.haxe.lang.psi.impl.HaxeClassReferenceImpl" implements="com.intellij.plugins.haxe.lang.psi.HaxeReference"}
554
564
555
565
private newExpressionOrCall ::= newExpression qualifiedReferenceTail?
@@ -588,7 +598,7 @@ superExpression ::= 'super'
588
598
newExpression ::= 'new' type '(' (expression (',' expression)*)? ')'
589
599
{pin=2 recoverWhile="expression_recover" mixin="com.intellij.plugins.haxe.lang.psi.impl.HaxeReferenceImpl" implements="com.intellij.plugins.haxe.lang.psi.HaxeReference"}
590
600
591
- castExpression ::= 'cast' (('(' expression ',' functionTypeWrapper ')') | expression)
601
+ castExpression ::= 'cast' (('(' expression ',' typeWrapper ')') | expression)
592
602
{mixin="com.intellij.plugins.haxe.lang.psi.impl.HaxeClassReferenceImpl" implements="com.intellij.plugins.haxe.lang.psi.HaxeReference"}
593
603
594
604
inheritList ::= inherit (','? inherit)*
0 commit comments