summaryrefslogtreecommitdiff
path: root/xmake/core/language/language.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-12-15 00:41:39 +0800
committerruki <[email protected]>2018-12-14 22:09:54 +0800
commit95f46b973794b37ccd62edbcc3bfb010b0f23dcc (patch)
treeabbd878e0e78c0511c7da072ad43b70f03eeea47 /xmake/core/language/language.lua
parent107f81a48da61d37ecbffac4e2f816b9cfedb21c (diff)
improve interpreter
Diffstat (limited to 'xmake/core/language/language.lua')
-rw-r--r--xmake/core/language/language.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/xmake/core/language/language.lua b/xmake/core/language/language.lua
index b1f8fcc24..f06bc94bd 100644
--- a/xmake/core/language/language.lua
+++ b/xmake/core/language/language.lua
@@ -293,8 +293,17 @@ function language.load(name)
return nil, string.format("the language %s not found!", name)
end
+ -- get interpreter
+ local interp = language._interpreter()
+
+ -- load script
+ local ok, errors = interp:load(scriptpath)
+ if not ok then
+ return nil, errors
+ end
+
-- load language
- local results, errors = language._interpreter():load(scriptpath, "language", true, false)
+ local results, errors = interp:make("language", true, false)
if not results and os.isfile(scriptpath) then
return nil, errors
end