-
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.
- Loading branch information
Apprentice Alchemist
committed
Aug 18, 2021
1 parent
24472a7
commit c8c5683
Showing
7 changed files
with
279 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
-cp src | ||
-cp out | ||
-cp idl | ||
-m webidl.Main | ||
--macro nullSafety("webidl") | ||
--interp | ||
--macro nullSafety("webidl.Printer",Off) | ||
--run webidl.Main | ||
tests | ||
# -js out.js |
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,28 @@ | ||
package webidl; | ||
|
||
import haxe.macro.MacroStringTools; | ||
import haxe.DynamicAccess; | ||
import haxe.ds.StringMap; | ||
|
||
@:structInit class Config { | ||
public var pack:Array<String> = []; | ||
|
||
/** | ||
* Map from webidl names to haxe type paths. | ||
*/ | ||
public var typemap:Map<String, haxe.macro.Expr.TypePath> = []; | ||
|
||
public static function fromJson(j:Null<{pack:String, typemap:DynamicAccess<String>}>):Config { | ||
if(j == null) return {}; | ||
return { | ||
pack: j.pack == null ? [] : j.pack.split(".").filter(s -> s != ""), | ||
typemap: j.typemap == null ? [] : [ | ||
for (name => path in j.typemap) | ||
name => { | ||
var pack = path.split("."); | ||
{pack: pack, name: pack.pop(), params: []}; | ||
} | ||
] | ||
} | ||
} | ||
} |
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
Oops, something went wrong.