summaryrefslogtreecommitdiff
path: root/src/urweb.lex
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-05-04 10:07:27 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-05-04 10:07:27 -0400
commit8b1eaab4e930cb8c23d731c606137e118d9c8d42 (patch)
tree8588b4f96df22035fb8c6cf80ab8d705545141c5 /src/urweb.lex
parent6e8853d922c0a547b65e4e72b9ce285495e512b6 (diff)
Reinitialize lexer state properly
Diffstat (limited to 'src/urweb.lex')
-rw-r--r--src/urweb.lex7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/urweb.lex b/src/urweb.lex
index 55fe4216..5d3d6dbe 100644
--- a/src/urweb.lex
+++ b/src/urweb.lex
@@ -40,6 +40,10 @@ local
val commentLevel = ref 0
val commentPos = ref 0
in
+ fun reset () =
+ (commentLevel := 0;
+ commentPos := 0)
+
fun enterComment pos =
(if !commentLevel = 0 then
commentPos := pos
@@ -109,7 +113,8 @@ fun exitBrace () =
braceLevels := (s, i-1) :: rest
| _ => ()
-fun initialize () = (xmlTag := [];
+fun initialize () = (reset ();
+ xmlTag := [];
xmlString := false)