Next: , Previous: , Up: Statements   [Contents][Index]

7.18 Ignoring Input

There are two ways in which you can have LUX ignore text. If you wish for LUX to ignore part of a line, then prepend a semicolon (;) to the part you want to be ignored. LUX considers a semicolon (outside of a literal string – Strings) and everything that follows it through the end of the line a comment. Such comments are totally ignored: LUX acts as if they are not there.

If you want LUX to ignore many subsequent lines, then use the ignore statement as the first statement on a line just before the ones you want ignored, and use the resume statement as the first statement on a line just after the ones you want ignored. All lines between matching ignore - resume statements are totally ignored.

ignore and resume are the only statements in LUX that are sensitive to position: they only work if they are the first statement on the line. In any other position they are not recognized as statements, and will, if still used as such, generate errors. This relatively peculiar behavior is necessary because you might sometimes want to use the words "ignore" or "resume" in a literal string or in a comment, and if LUX is truly ignoring text up to the next matching resume then it cannot figure out if the next resume it encounters is intended as a regular resume statement or rather is part of a literal string or a comment. One alternative is to check code between ignores and matching resumes anyway, so it is clear if a found resume is a statement or not, but then to ignore the skipped code by not executing it. However, then the ignored code would have to be flawless LUX code or else LUX would get confused anyway. With the current implementation, ignored lines are like comments.

ignore and resume are not strictly reserved keywords (Reserved Keywords) and may be used as names for variables or keywords – as long as they are not the first word on a line.

See also: Error Messages, Reserved Keywords, Syntax

Next: , Previous: , Up: Statements   [Contents][Index]