summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-12-14 19:52:24 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-12-14 19:52:24 -0800
commite3390f1ed75d58f78218acf22c2a9209a88a14a2 (patch)
tree684ddb7f1845ec0076fa5523704facdc8976a742 /parser.l
parent89baf71c475f494c139df7c7f29a593b5a0f7d61 (diff)
downloadtxr-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 'parser.l')
-rw-r--r--parser.l11
1 files changed, 7 insertions, 4 deletions
diff --git a/parser.l b/parser.l
index e7881a30..0ade291d 100644
--- a/parser.l
+++ b/parser.l
@@ -439,6 +439,9 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
return TEXT;
}
+<SPECIAL,NESTED>[;].* {
+ /* comment */
+ }
<SPECIAL,NESTED>{UANYN} {
yyerrprepf(lit("bad character in directive: '~a'"),
string_utf8(yytext), nao);
@@ -536,14 +539,14 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
yy_push_state(SPECIAL);
}
-<INITIAL>^@#.*\n {
+<INITIAL>^@[#;].*\n {
/* eat whole line comment */
lineno++;
}
-<INITIAL>@#.* {
- /* comment to end of line */
- }
+<INITIAL>@[#;].* {
+ /* comment to end of line */
+ }
<STRLIT>\" {
yy_pop_state();