summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-05-23 20:47:36 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-05-23 20:47:36 -0700
commit7b577e8a23f522d51fef4c2f60edf1a25e2923a4 (patch)
treeef8df7141b748ab329fc79a2f71001d56e6e3581
parent5aacefa978182e8fabfa8c5c703ffb19108c44ce (diff)
downloadtxr-7b577e8a23f522d51fef4c2f60edf1a25e2923a4.tar.gz
txr-7b577e8a23f522d51fef4c2f60edf1a25e2923a4.tar.bz2
txr-7b577e8a23f522d51fef4c2f60edf1a25e2923a4.zip
Allow whitespace between @ and ; in comments.
* parser.l (grammar): Recognize {WS}* between @ and ; (or the legacy #) in comments. * txr.1: Documentation updated.
-rw-r--r--parser.l4
-rw-r--r--txr.12
2 files changed, 3 insertions, 3 deletions
diff --git a/parser.l b/parser.l
index 9ac79228..e1cfe82f 100644
--- a/parser.l
+++ b/parser.l
@@ -908,12 +908,12 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
yy_push_state(SPECIAL, yyscanner);
}
-<INITIAL>^@[#;].*{NL} {
+<INITIAL>^@{WS}*[#;].*{NL} {
/* eat whole line comment */
yyextra->lineno++;
}
-<INITIAL>@[#;].* {
+<INITIAL>@{WS}*[#;].* {
/* comment to end of line */
}
diff --git a/txr.1 b/txr.1
index b7fa864c..91520a8e 100644
--- a/txr.1
+++ b/txr.1
@@ -909,7 +909,7 @@ are output on standard output.
.SS* Comments
A query may contain comments which are delimited by the sequence
.code @;
-and extend to the end of the line. No whitespace can occur between the
+and extend to the end of the line. Whitespace can occur between the
.code @
and
.codn ; .