aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-06-10 18:07:02 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-06-10 18:07:02 +0200
commitd8ab4168b1dc4e56c51c17a5c68c34df3014aeec (patch)
tree53a9b7339f1c13fd050d965dfd73ac39a0d7790d
parent392fc74a77b94cc78e9bfe349dcdfa0ab8fc8f5c (diff)
downloadlightroff-d8ab4168b1dc4e56c51c17a5c68c34df3014aeec.tar.gz
Support XML-style comments.
-rw-r--r--xroff.lex4
1 files changed, 3 insertions, 1 deletions
diff --git a/xroff.lex b/xroff.lex
index 6282ca1..72ab379 100644
--- a/xroff.lex
+++ b/xroff.lex
@@ -10,6 +10,7 @@
\\ BEGIN(ESC);
\n BEGIN(NEW);
\<!\[ BEGIN(RAW);
+\<!--.*--> /* Ignore comment. */
^< printf("."); BEGIN(REQ); /* Beginning of file. */
\< printf("\\c\n."); BEGIN(REQ);
. ECHO;
@@ -18,7 +19,8 @@
<NEW>\n /* Ignore consecutive newlines. */
<NEW>\\ printf("\n"); BEGIN(ESC);
-<NEW>\<!\[\n? printf("\n"); BEGIN(RAW);
+<NEW><!\[\n? printf("\n"); BEGIN(RAW);
+<NEW><!--.*--> /* Ignore comment. */
<NEW>< printf("\n."); BEGIN(REQ);
<NEW>\. printf("\n\\&."); BEGIN(0);
<NEW>. printf("\n"); BEGIN(0); REJECT;