mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-25 01:40:18 +01:00
Enable commentaries in the Microcontroller by using :commentary
This commit is contained in:
parent
89edd2ce63
commit
72b00178f9
@ -66,6 +66,7 @@ end
|
||||
function update_yc(pos)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
local code = meta:get_string("code")
|
||||
code = yc_code_remove_commentary(code)
|
||||
code = string.gsub(code, " ", "") --Remove all spaces
|
||||
code = string.gsub(code, " ", "") --Remove all tabs
|
||||
if parse_yccode(code, pos) == nil then
|
||||
@ -75,6 +76,15 @@ function update_yc(pos)
|
||||
end
|
||||
end
|
||||
|
||||
function yc_code_remove_commentary(code)
|
||||
for i = 1, #code do
|
||||
if code:sub(i, i) == ":" then
|
||||
return code:sub(1, i-1)
|
||||
end
|
||||
end
|
||||
return code
|
||||
end
|
||||
|
||||
function parse_yccode(code, pos)
|
||||
local endi = 1
|
||||
local L = yc_get_portstates(pos)
|
||||
|
Loading…
Reference in New Issue
Block a user