summaryrefslogtreecommitdiff
path: root/xmake/core/base/interpreter.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-02-03 12:20:55 +0800
committerruki <[email protected]>2019-02-03 12:20:55 +0800
commit2c7a2ff446fd7ad85922a2990d6452627133c8c3 (patch)
treee1502c769f9e1aa590e37b571d453a6123e9cc53 /xmake/core/base/interpreter.lua
parente35595f73271cb14363c027694183dec3a32e910 (diff)
improve deprecated tips
Diffstat (limited to 'xmake/core/base/interpreter.lua')
-rw-r--r--xmake/core/base/interpreter.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua
index 544c2dd5e..4cf4dc307 100644
--- a/xmake/core/base/interpreter.lua
+++ b/xmake/core/base/interpreter.lua
@@ -396,6 +396,28 @@ function interpreter:_api_within_scope(scope_kind, apiname)
end
end
+-- set api function within scope
+function interpreter:_api_within_scope_set(scope_kind, apiname, apifunc)
+
+ -- the private
+ local priv = self._PRIVATE
+ assert(priv)
+
+ -- the scopes
+ local scopes = priv._SCOPES
+ assert(scopes)
+
+ -- get scope api
+ if scope_kind and priv._APIS then
+
+ -- get api function
+ local api_scope = priv._APIS[scope_kind]
+ if api_scope then
+ api_scope[apiname] = apifunc
+ end
+ end
+end
+
-- clear results
function interpreter:_clear()