forked from SumRndmDde/evil-haxe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial compilation server tests (HaxeFoundation#6248)
* add some compilation server tests * install hxnodejs and utest * create directory before running haxe (because --cwd) * actually print "reusing" messages * typemize server messages * do it properly * use proper positions * check if this is the problem
- Loading branch information
Showing
12 changed files
with
587 additions
and
10 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
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
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,5 @@ | ||
-cp src | ||
-main Main | ||
-js test.js | ||
-lib hxnodejs | ||
-lib utest |
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 @@ | ||
import haxe.macro.Expr; | ||
import haxe.macro.Context; | ||
|
||
class AsyncMacro { | ||
static public macro function async(e:Expr) { | ||
var el = switch (e.expr) { | ||
case EBlock(el): el; | ||
case _: Context.error("Block expression expected", e.pos); | ||
} | ||
el.unshift(macro var _done = utest.Assert.createAsync(1000)); | ||
el.push(macro _done()); | ||
function loop(el:Array<Expr>) { | ||
var e0 = el.shift(); | ||
return if (el.length == 0) { | ||
e0; | ||
} else switch (e0) { | ||
case macro haxe($a{args}): | ||
var e = loop(el); | ||
args.push(macro () -> $e); | ||
macro haxe($a{args}); | ||
case _: | ||
macro { $e0; ${loop(el)}}; | ||
} | ||
} | ||
return loop(el); | ||
} | ||
} |
Oops, something went wrong.