Engine:CCMD run: Difference between revisions

no edit summary
No edit summary
Line 40: Line 40:
: In this case: echos 'fred' to console, runs a Lua statement that adds '1 + 3' and prints the result, creates an alias 'bob', creates 'fred' variable that the alias 'bob' will show the value of, runs the 'bob' alias that effectively prints the value of 'fred' that is 'james'.
: In this case: echos 'fred' to console, runs a Lua statement that adds '1 + 3' and prints the result, creates an alias 'bob', creates 'fred' variable that the alias 'bob' will show the value of, runs the 'bob' alias that effectively prints the value of 'fred' that is 'james'.


== Script details ==
== Script syntax ==
In the pseudo-syntax examples in these descriptions, a space ' ' is the same as any whitespace except newline, and all of the newline chars are represented by just '\n', to make easier to read. Text with no line '\n' delimiters is considered a single line. The examples are illustrative and not exact, the descriptions are correct.
In the pseudo-syntax examples in these descriptions, a space ' ' is the same as any whitespace except newline, and all of the newline chars are represented by just '\n', to make easier to read. Text with no line '\n' delimiters is considered a single line. The examples are illustrative and not exact, the descriptions are correct.


Line 48: Line 48:
<kua>print bob; bind U +attack // changing binding</kua>
<kua>print bob; bind U +attack // changing binding</kua>


Addendum I:
=== Addendum I: ===
:1. Matching '{' and '}' can be used as third set of quotes to delimit other-text, as in main section item 8.
:1. Matching '{' and '}' can be used as third set of quotes to delimit other-text, as in main section item 8.


Statement rules:
=== Statement rules: ===
:1. 'Statement' is a text block that begins with a command name, and is followed by any other text, and ends with line-end or semi-colon. A new statement can begin adjacent to the previous statements ending delimiter.
:1. 'Statement' is a text block that begins with a command name, and is followed by any other text, and ends with line-end or semi-colon. A new statement can begin adjacent to the previous statements ending delimiter.
::<kua>statement[\n;]statement[\n;]...</kua>
::<kua>statement[\n;]statement[\n;]...</kua>
Line 80: Line 80:
:12. 'Executable statements' are composed of both the parsed 'command name' and 'other text' components, excluding comments
:12. 'Executable statements' are composed of both the parsed 'command name' and 'other text' components, excluding comments


== Parameter rules ==
=== Parameter rules: ===
'Statements' intrinsically contain only a 'command' optional 'other text'. Each context or command is basically 'other text' as a whole string, or as divided into multiple parameters.
'Statements' intrinsically contain only a 'command' optional 'other text'. Each context or command is basically 'other text' as a whole string, or as divided into multiple parameters.


== Notes ==
== Notes ==
*
*