-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect parsing of TParent type reification (+ reification tests)
- Loading branch information
Showing
11 changed files
with
1,382 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
src/test/java/com/intellij/plugins/haxe/lang/parser/macro/Macro.java
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
src/test/java/com/intellij/plugins/haxe/lang/parser/reification/ReificationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.intellij.plugins.haxe.lang.parser.reification; | ||
|
||
import com.intellij.plugins.haxe.lang.parser.statements.StatementTestBase; | ||
import org.junit.Test; | ||
|
||
public class ReificationTest extends StatementTestBase { | ||
public ReificationTest() { | ||
super("reification"); | ||
} | ||
|
||
@Test | ||
public void testBasicExpressionReifications() throws Throwable { | ||
doTest(true); | ||
} | ||
@Test | ||
public void testBasicTypeReifications() throws Throwable { | ||
doTest(true); | ||
} | ||
@Test | ||
public void testReificationsInLoops() throws Throwable { | ||
doTest(true); | ||
} | ||
@Test | ||
public void testDeclarationReifications() throws Throwable { | ||
doTest(true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/test/resources/testData/parsing/haxe/statements/reification/BasicTypeReifications.hx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package; | ||
|
||
class MacroTest { | ||
|
||
macro public function macroTypeReification() { | ||
|
||
// ComplexType.TPath | ||
var path:ComplexType = macro : haxe.ds.Map; | ||
|
||
// ComplexType.TFunction | ||
var func:ComplexType = macro : String -> Int -> Float; | ||
|
||
// ComplexType.TAnonymous | ||
var anon:ComplexType = macro : { | ||
field:String | ||
}; | ||
|
||
// ComplexType.TExtend | ||
var extendedAnon:ComplexType = macro : { | ||
> Type, field:Type | ||
}; | ||
|
||
// ComplexType.TParent | ||
var parent:ComplexType = macro : (Type); | ||
|
||
// ComplexType.TOptional | ||
var optional:ComplexType = macro : ?String; | ||
|
||
} | ||
|
||
|
||
} |
Oops, something went wrong.