Engine:CCMD run: Difference between revisions

174 bytes added ,  15 October 2023
Line 17: Line 17:


=== Script statement syntax ===
=== Script statement syntax ===
In the 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' delimeters is considered a single line.
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.
: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 33: Line 33:
:5. Comment text, empty statements or lines, or statements or lines with only white-space, will be skipped.
:5. Comment text, empty statements or lines, or statements or lines with only white-space, will be skipped.
:6. Command names must be at least 2 and less than 63 characters. Statements with invalid command names will be skipped.
:6. Command names must be at least 2 and less than 63 characters. Statements with invalid command names will be skipped.
:7. Other text may contain quoted text, where '<nowiki>'</nowiki>' or '"' are valid quote begin and end quote characters.
::<kua>co</kua>
::<kua>commandcommand...63</kua>
:7. 'Other text' may contain quoted text, where '<nowiki>'</nowiki>' or '"' are valid quote begin and end quote characters.
::<kua>command 'other' "text"</kua>
:8. If quoted text is found, any semi-colons, line-ends, or comment starts will be ignored, until next matching quote character.
:8. If quoted text is found, any semi-colons, line-ends, or comment starts will be ignored, until next matching quote character.
::<kua>command 'other;' "//text"</kua>
:9. No other checking or processing is done on any 'other text' after the command name, and any actual meaning is context-dependent and determined when the actual statement is run.
:9. No other checking or processing is done on any 'other text' after the command name, and any actual meaning is context-dependent and determined when the actual statement is run.
:10. If embedded in text a NULL, or '\0', or any character less than ' ', will be considered as a white-space character. This means that a '\0' delimits a command name, stays included in other-text as is, and is otherwise ignored. This also means that these characters can not be used in command names.
:10. If embedded in text a NULL, or '\0', or any character less than ' ', will be considered as a white-space character. This means that a '\0' delimits a command name, stays included in 'other text' as is, and is otherwise ignored. This also means that these characters cannot be used in command names.
:11. Command names in this context can contain any character except white-space and ';', and cannot contain '//'. Command names can also have quote characters in the name and are not checked for closing quotes and treated as is as a part of the name. Valid command names: bob/"bob"/bob, "bob", bob", "bob.
:11. Command names in this context can contain any character except white-space and ';' and cannot contain '//'. Command names can also have quote characters in the name and are not checked for closing quotes and treated as is as a part of the name. Valid command names: bob/"bob"/bob, "bob", "bob, bob".
:12. 'Executable statements' are composed of both the parsed 'command name' and 'other text' components, excluding comments, and each are the product of this function which gets run.
::<kua>+zoom</kua>
12. 'Executable statements' are composed of both the parsed 'command name' and 'other text' components, excluding comments


== Examples ==
== Examples ==