aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/LSL.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/LSL.lua b/lib/LSL.lua
index 58620e7..434113d 100644
--- a/lib/LSL.lua
+++ b/lib/LSL.lua
@@ -1957,7 +1957,7 @@ function LSL.stateChange(x)
1957 Notably, it's not actually legal to do a state change from a function, only from handlers. 1957 Notably, it's not actually legal to do a state change from a function, only from handlers.
1958 There is a hack though, but it's unsupported, so I don't have to worry about it so much. 1958 There is a hack though, but it's unsupported, so I don't have to worry about it so much.
1959 1959
1960 Write out "state new;" as "return _LSL.stateChange(newState);", with stateChange() returning new.state_entry()) which will force two tail calls. 1960 Write out "state new;" as "return(_LSL.stateChange(newState));", with stateChange() returning new.state_entry()) which will force two tail calls.
1961 1961
1962 The caller of stateChange() might be a function rather than an event handler. 1962 The caller of stateChange() might be a function rather than an event handler.
1963 Which will return to the event handler (possibly via other nested function calls) as if the state never changed. 1963 Which will return to the event handler (possibly via other nested function calls) as if the state never changed.
@@ -2003,7 +2003,7 @@ function waitAndProcess(returnWanted, name, ...)
2003 while running do 2003 while running do
2004 local message = Runnr.receive() 2004 local message = Runnr.receive()
2005 if message then 2005 if message then
2006--print(" " .. SID .. "_" .. scriptName .. ' GOT MESSAGE - "' .. message .. '"') 2006-- print(" " .. SID .. "_" .. scriptName .. ' GOT MESSAGE - "' .. message .. '"')
2007 -- TODO - should we be discarding return values while paused? I don't think so, so we need to process those, 2007 -- TODO - should we be discarding return values while paused? I don't think so, so we need to process those,
2008 if paused then 2008 if paused then
2009 if "start()" == message then paused = false end 2009 if "start()" == message then paused = false end
@@ -2027,7 +2027,7 @@ function waitAndProcess(returnWanted, name, ...)
2027 print(text) 2027 print(text)
2028 elseif result1 then 2028 elseif result1 then
2029 -- Check if we are waiting for a return, and got it. 2029 -- Check if we are waiting for a return, and got it.
2030 if returnWanted and string.match(message, "^return ") then 2030 if returnWanted and string.match(message, "^return%(") then
2031-- print("<" .. SID .. "_" .. scriptName, " - RETURNING " .. type(result1) .. " " .. message .. " TO " .. name) 2031-- print("<" .. SID .. "_" .. scriptName, " - RETURNING " .. type(result1) .. " " .. message .. " TO " .. name)
2032 return result1 2032 return result1
2033 else 2033 else
@@ -2040,7 +2040,7 @@ function waitAndProcess(returnWanted, name, ...)
2040-- msg("Error sending results from " .. Type .. ": " .. message .. " ERROR MESSAGE: " .. errorMsg) 2040-- msg("Error sending results from " .. Type .. ": " .. message .. " ERROR MESSAGE: " .. errorMsg)
2041-- end 2041-- end
2042 else 2042 else
2043 if string.match(message, "^return ") then 2043 if string.match(message, "^return%(") then
2044 print("!" .. SID .. "_" .. scriptName, " - IN AN ODD PLACE!!!!!" .. message) 2044 print("!" .. SID .. "_" .. scriptName, " - IN AN ODD PLACE!!!!!" .. message)
2045 else 2045 else
2046-- print("!" .. SID .. "_" .. scriptName, " - " .. message) 2046-- print("!" .. SID .. "_" .. scriptName, " - " .. message)