diff options
Diffstat (limited to 'server-beta/src/core')
-rw-r--r-- | server-beta/src/core/engineer.lua | 2 | ||||
-rw-r--r-- | server-beta/src/core/goto.lua | 13 | ||||
-rw-r--r-- | server-beta/src/core/label.lua | 3 |
3 files changed, 18 insertions, 0 deletions
diff --git a/server-beta/src/core/engineer.lua b/server-beta/src/core/engineer.lua index 036095dc..9171af39 100644 --- a/server-beta/src/core/engineer.lua +++ b/server-beta/src/core/engineer.lua @@ -25,6 +25,8 @@ mt['boolean'] = require 'core.boolean' mt['string'] = require 'core.string' mt['table'] = require 'core.table' mt['select'] = require 'core.select' +mt['goto'] = require 'core.goto' +mt['label'] = require 'core.label' local specials = { ['_G'] = true, diff --git a/server-beta/src/core/goto.lua b/server-beta/src/core/goto.lua new file mode 100644 index 00000000..4652f8be --- /dev/null +++ b/server-beta/src/core/goto.lua @@ -0,0 +1,13 @@ +local guide = require 'parser.guide' + +local m = {} + +function m:def(source, callback) + local name = source[1] + local label = guide.getLabel(source, name) + if label then + callback(label) + end +end + +return m diff --git a/server-beta/src/core/label.lua b/server-beta/src/core/label.lua new file mode 100644 index 00000000..f05a57e6 --- /dev/null +++ b/server-beta/src/core/label.lua @@ -0,0 +1,3 @@ +local m = {} + +return m |