# HG changeset patch # User Adam Chlipala # Date 1336140447 14400 # Node ID d6e233db97c869d95eaafb3d9d988558ac539608 # Parent d2ec62c5ad81a6c42ebe3eede52509a07283a446 Reinitialize lexer state properly diff -r d2ec62c5ad81 -r d6e233db97c8 src/urweb.lex --- 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) diff -r d2ec62c5ad81 -r d6e233db97c8 tests/badcomment.ur --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/badcomment.ur Fri May 04 10:07:27 2012 -0400 @@ -0,0 +1,1 @@ +(* uhoh