Logiweb(TM)

2.7 Comments

Prev Up Next Page 10 of 800 Search internet


When the lgc compiler meets a ""; escape sequence, it ignores all text from the escape sequence to the end of the line, including the newline character at the end of the line.

Comments work everywhere - even inside strings and in the middle of words. Here is an obscure example:

if x != EOF th""; this is ignored
en "Hello world" else "Goo""; this is ignored
dby world"

When the lgc compiler meets a ""{ escape sequence, it ignores all text from the escape sequence to the next ""} escape sequence. This allows to produce multiline comments or to 'comment out' source code. The latter may be particularly useful during debugging. This kind of comment also works inside strings and in the middle of keywords.

As mentioned, an escape sequence consists of two or more double quote characters followed by a non-quote. The number of double quote characters is insignificant, so e.g. """""; starts a comment just like ""; does.

The only exception is the ""{ escape sequence. A comment started with a ""..."{ escape sequence runs until the first occurrence of a ""..."} escape sequence with the same number of quotes. This allows to comment out code which contains comments. Here is an obscure example:

"""{ This is ignored, including ""} and ""{ escapes """}

Prev Up Next Page 10 of 800 Search logiweb.eu

Copyright © 2010 Klaus Grue, GRD-2010-01-05