Engine:CCMD run: Difference between revisions

231 bytes added ,  16 October 2023
Line 157: Line 157:
</kua>
</kua>
==== Special delimiters ====
==== Special delimiters ====
:1. Back ticks surrounding text passed directly to a context will be stripped. Normally all text is passed verbatim, including quotes. Back ticks effectively treat the rest of the statement as a block for a multi-line statement.
:1. Back ticks surrounding text passed directly to a context will be stripped. Normally all text is passed verbatim, including quotes. Back ticks effectively treat the rest of the statement as a block for a multi-line statement. Quotes are not removed normally as they may be important to the context's command processing.
<kua>
<kua>
> lua `print "bob"`
> lua `print "bob"`
Line 171: Line 171:
bob
bob
</kua>
</kua>
: Quotes are not removed normally as they may be important to the context's command processing.
 
===== Other examples =====
<kua>
<kua>
> lua print "bob"
> lua print "bob"
Line 177: Line 178:
> lua 'print "bob"'
> lua 'print "bob"'
Error in : [string "'print "bob"'"]:1: unexpected symbol near ''print "bob"'' (3)
Error in : [string "'print "bob"'"]:1: unexpected symbol near ''print "bob"'' (3)
</kua>
===== Other examples =====
<kua>
> lua run 'print "bob"'  
> lua run 'print "bob"'  
bob
bob
</kua>
</kua>
: Above calls the 'lua' context 'run' command, and as normal 'print "bob"' is a complete parameter for 'run', that then gets executed in the Lua runtime all together.
: When addressing the context directly, all of the 'other text' that is not the command simply gets passed to the context. At the top, print "bob" gets run in 'lua' context. The second fails as 'print "bob"' is not valid for the context or Lua. The third runs usingthe run command as a normal parameter to 'run'. While it will run multiline Lua scripts, text still won't be running as a set of context commands.  
<kua>
<kua>
> lua `
> lua `