Here's a bit of trickiness. cli_execute is either a keyword or a function name, depending on context. The function just takes a string argument and all is peachy, but the keyword works like this:
Code:
cli_execute {
# Yes!
echo Hello world!
// No
echo Goodbye, cruel world
}
That is a block delimited by {}, and it would be nice to indent the lines in it appropriately, but the CLI commands are just comments, as far as ASH is concerned.
Try typing it in by hand and watch how it autoindents (and how it reindents when you type a tab) currently...
Edit: And Bale, those are not all keywords. Many are just functions. Keywords:
Code:
static
{
// Constants
reservedWords.add( "true" );
reservedWords.add( "false" );
// Operators
reservedWords.add( "contains" );
reservedWords.add( "remove" );
reservedWords.add( "new" );
// Control flow
reservedWords.add( "if" );
reservedWords.add( "else" );
reservedWords.add( "foreach" );
reservedWords.add( "in" );
reservedWords.add( "for" );
reservedWords.add( "from" );
reservedWords.add( "upto" );
reservedWords.add( "downto" );
reservedWords.add( "by" );
reservedWords.add( "while" );
reservedWords.add( "repeat" );
reservedWords.add( "until" );
reservedWords.add( "break" );
reservedWords.add( "continue" );
reservedWords.add( "return" );
reservedWords.add( "exit" );
reservedWords.add( "switch" );
reservedWords.add( "case" );
reservedWords.add( "default" );
// Data types
reservedWords.add( "void" );
reservedWords.add( "boolean" );
reservedWords.add( "int" );
reservedWords.add( "float" );
reservedWords.add( "string" );
reservedWords.add( "buffer" );
reservedWords.add( "matcher" );
reservedWords.add( "item" );
reservedWords.add( "location" );
reservedWords.add( "class" );
reservedWords.add( "stat" );
reservedWords.add( "skill" );
reservedWords.add( "effect" );
reservedWords.add( "familiar" );
reservedWords.add( "slot" );
reservedWords.add( "monster" );
reservedWords.add( "element" );
reservedWords.add( "record" );
reservedWords.add( "typedef" );
}
Edit 2: I think we've not always declare keywords to be be reserved words...
Code:
for i from 1 to 10 by 2
print( i );
How about "to"?