Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Glish has a simple rule for when the ; terminating a statement can be left out. In general, if a line ends with a token that suggests continuation (such as a comma or a binary operator) the statement continues onto the next line. A semi-colon is inserted if it ends with something that could come at the end of a statement. Those tokens that can end a statement are:
)
character, unless it's part of the test in a if,
for, or while statement, or the argument list in a function definition;
]
character;
Glish inserts ;'s only at the end of a line or just before a ``{". You cannot use these rules to jam two statements onto one line:
print a b := 3is illegal, though both
print a; b := 3and
{ print a } b := 3are perfectly okay.
You can prevent Glish from inserting a ;
by using an escape (\
)
as the last character of a line. For example,
print a \ , bis okay, and equivalent to
print a, bor
print a, bA final
\
doesn't work after a comment. For example:
print a # oops, syntax error next line \ , bis interpreted as two separate statements, the second statement produces a syntax error.