-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support to haxe language #86
- Loading branch information
1 parent
540bdcc
commit de6baf8
Showing
4 changed files
with
76 additions
and
15 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
local function build(args) | ||
local game_name = args.game | ||
local game_file = io.open(game_name, 'r') | ||
local game_content = game_file and game_file:read('*a') | ||
|
||
if not game_content then | ||
return false, 'game not found!' | ||
end | ||
|
||
local pattern_utf8 = '_G%.require%("lua%-utf8"%)' | ||
local replace_utf8 = 'select(2, pcall(require, "lua-utf8")) or select(2, pcall(require, "utf8")) or string' | ||
local pattern_object = 'std%.(%w+):(%w+)' | ||
local replace_object = 'std.%1.%2' | ||
|
||
game_content = game_content:gsub(pattern_utf8, replace_utf8) | ||
game_content = game_content:gsub(pattern_object, replace_object) | ||
|
||
game_file = io.open(game_name, 'w') | ||
game_file:write(game_content) | ||
return true | ||
end | ||
|
||
local P = { | ||
['tool-haxe-build'] = build | ||
} | ||
|
||
return P |
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