fixed ! not working

master
AiTechEye 2019-01-05 09:00:27 +01:00 committed by GitHub
parent fabf7643e7
commit 0d7eebda29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 7 deletions

View File

@ -210,7 +210,7 @@ was.run_function=function(func_name,data,VAR,i,ii,userdata)
table.insert(d,data[i].content)
elseif data[i].type=="symbol" and was.symbols[data[i].content] then
local a=was.symbols[data[i].content](userdata.var,userdata.variables,userdata.user)
local a=was.symbols[data[i].content](userdata.var,userdata.variables,userdata.user,func_name)
if a then
table.insert(d, a)
end

View File

@ -23,6 +23,8 @@ end
if(1=="asd" or a~=b and 87.3>=c nor a<=3 not "aasd"==!)
..code..
else
..code..
end
========REGISTRY=FUNCTIONS=======
@ -41,6 +43,6 @@ was.register_function("name"{
========REGISTRY=SYMBOLS=======
was.register_symbol("#",function(current_var,all_variables,userdata)
was.register_symbol("#",function(current_var,all_variables,username,run_func_name),"info"
end
})

View File

@ -14,7 +14,11 @@ was={
user={},
username="",
symbols={
["!"]=function() return end,
["!"]=function(var,vars,user,run_func_name)
if run_func_name and run_func_name=="if" then
return "!"
end
end,
[">"]=function() return ">" end,
["<"]=function() return "<" end,
["=="]=function() return "==" end,
@ -103,7 +107,7 @@ was.gui=function(name,msg,other)
local text=was.user[name].text
local funcs=""
local symbs="TOKENS,"
local symbs="SYMBOLS,"
for f,v in pairs(was.symbols) do
symbs=symbs .. f ..","
@ -187,7 +191,7 @@ minetest.register_on_player_receive_fields(function(user, form, pressed)
end
minetest.close_formspec(name,form)
was.gui(name,info)
elseif pressed.slist and pressed.slist~="TOKENS" then
elseif pressed.slist and pressed.slist~="SYMBOLS" then
if was.user[name].inserttext=="true" then
was.user[name].text=was.user[name].text .. pressed.slist
end

View File

@ -118,8 +118,11 @@ was.register_function("if",{
while i<#arg do
local a=arg[i]
if a=="!" then
arg[i]=nil
if arg[i-1]=="!" then
arg[i-1]=nil
end
if arg[i+1]=="!" then
arg[i+1]=nil
end
if a=="==" then