diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-12-14 19:52:24 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-12-14 19:52:24 -0800 |
commit | e3390f1ed75d58f78218acf22c2a9209a88a14a2 (patch) | |
tree | 684ddb7f1845ec0076fa5523704facdc8976a742 /txr.1 | |
parent | 89baf71c475f494c139df7c7f29a593b5a0f7d61 (diff) | |
download | txr-e3390f1ed75d58f78218acf22c2a9209a88a14a2.tar.gz txr-e3390f1ed75d58f78218acf22c2a9209a88a14a2.tar.bz2 txr-e3390f1ed75d58f78218acf22c2a9209a88a14a2.zip |
@# comments are becoming obsolescent. @# comments
can now be used. Within nested forms,
Lisp-compatible ; comments are suported.
* parser.l: Support @# and ; comments.
* txr.1: Documentation updated.
* txr.vim: Updated.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 28 |
1 files changed, 22 insertions, 6 deletions
@@ -170,9 +170,9 @@ Example: a=1 b=2 -The @# comment syntax can be used for better formatting: +The @; comment syntax can be used for better formatting: - txr -c "@# + txr -c "@; @a @b" @@ -258,15 +258,15 @@ or more @(output) directive directed to standard output. .SS Comments -A query may contain comments which are delimited by the sequence @# and -extend to the end of the line. No whitespace can occur between the @ and #. +A query may contain comments which are delimited by the sequence @; and +extend to the end of the line. No whitespace can occur between the @ and ;. A comment which begins on a line swallows that entire line, as well as the newline which terminates it. In essence, the entire comment disappears. If the comment follows some material in a line, then it does not consume the newline. Thus, the following two queries are equivalent: - 1. @a@# comment: match whole line against variable @a - @# this comment disappears entirely + 1. @a@; comment: match whole line against variable @a + @; this comment disappears entirely @b 2. @a @@ -277,6 +277,10 @@ comment which follows does. Without this intuitive behavior, line comment would give rise to empty lines that must match empty lines in the data, leading to spurious mismatches. +Instead of the ; character, the # character can be used. This is +an obsolescent feature. + + .SS Hash Bang Support If the first line of a query begins with the characters #!, @@ -1062,6 +1066,18 @@ There is no \e@ escape. A number is made up of digits 0 through 9, optionally preceded by a + or - sign. +.SS Comments + +Comments of the form @; were already covered. Inside directives, +comments are introduced just by a ; character. + +Example: + + @(foo ; this is a comment + bar) ; this is another comment + +This is equivalent to @(foo bar). + .SS Directives-driven Syntax Some directives not only denote an expression, but are also involved in |