Engine:CCMD run: Difference between revisions

144 bytes added ,  16 October 2023
 
(2 intermediate revisions by the same user not shown)
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. Quotes are not removed normally as they may be important to the context's command processing.
: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. Back ticks are special in that they will be removed from the start and end of the script statement. Without this special behavior, there would be no way to run a multi-line command block for an associated context, without switching to it first.
<kua>
<kua>
> lua `print "bob"`
> lua `print "bob"`
bob
bob
</kua>
 
:Back ticks are special in that they will be removed from the start and end of the script statement. Without this special behavior, there would be no way to run a multi-line command block for an associated context, without switching to it first.
<kua>
> lua `
> lua `
   print "bob"
   print "bob"
Line 170: Line 168:
bob
bob
bob
bob
> lua '
  print "bob"
  print "bob"
'
Error in : [string "'print "bob"'"]:1: unexpected symbol near ''print "bob"'' (3)
</kua>
</kua>


Without back ticks:
== More examples ==
Direct context with out back ticks:
<kua>
<kua>
> lua print "bob"
> lua print "bob"