diff src/urweb.lex @ 1741:d6e233db97c8

Reinitialize lexer state properly
author Adam Chlipala <adam@chlipala.net>
date Fri, 04 May 2012 10:07:27 -0400
parents 4a03aa3251cb
children 8f28c3295148
line wrap: on
line diff
--- a/src/urweb.lex	Thu May 03 10:29:12 2012 -0400
+++ b/src/urweb.lex	Fri May 04 10:07:27 2012 -0400
@@ -40,6 +40,10 @@
   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 @@
 	    braceLevels := (s, i-1) :: rest
       | _ => ()
 
-fun initialize () = (xmlTag := [];
+fun initialize () = (reset ();
+                     xmlTag := [];
 		     xmlString := false)