Skip to content

Commit

Permalink
Use hx-lua-simdjson for Lua json parsing (HaxeFoundation#9885)
Browse files Browse the repository at this point in the history
* [lua] update with hx-lua-simdjson

* [lua] bump haxe-deps
  • Loading branch information
jdonaldson authored Sep 11, 2020
1 parent 6ddf647 commit 5fdb166
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion std/lua/_std/haxe/format/JsonParser.hx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class JsonParser {
If `str` is null, the result is unspecified.
**/
static public inline function parse(str:String):Dynamic {
return new JsonParser(str).doParse();
// return new JsonParser(str).doParse();
return lua.lib.hxluasimdjson.Json.parse(str);
}

var str:String;
Expand Down
5 changes: 5 additions & 0 deletions std/lua/lib/hxluasimdjson/Json.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package lua.lib.hxluasimdjson;
@:luaRequire("hxsimdjson")
extern class Json {
public static function parse(str:String) : Dynamic;
}
2 changes: 1 addition & 1 deletion tests/runci/targets/Lua.hx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Lua {
// Note: don't use a user config
// runCommand("luarocks", ["config", "--user-config"], false, true);

installLib("haxe-deps", "0.0.1-4");
installLib("haxe-deps", "0.0.1-6");

changeDirectory(unitDir);
runCommand("haxe", ["compile-lua.hxml"].concat(args));
Expand Down

0 comments on commit 5fdb166

Please sign in to comment.