Mercurial > urweb
comparison 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 |
comparison
equal
deleted
inserted
replaced
1740:d2ec62c5ad81 | 1741:d6e233db97c8 |
---|---|
38 | 38 |
39 local | 39 local |
40 val commentLevel = ref 0 | 40 val commentLevel = ref 0 |
41 val commentPos = ref 0 | 41 val commentPos = ref 0 |
42 in | 42 in |
43 fun reset () = | |
44 (commentLevel := 0; | |
45 commentPos := 0) | |
46 | |
43 fun enterComment pos = | 47 fun enterComment pos = |
44 (if !commentLevel = 0 then | 48 (if !commentLevel = 0 then |
45 commentPos := pos | 49 commentPos := pos |
46 else | 50 else |
47 (); | 51 (); |
107 s ()) | 111 s ()) |
108 else | 112 else |
109 braceLevels := (s, i-1) :: rest | 113 braceLevels := (s, i-1) :: rest |
110 | _ => () | 114 | _ => () |
111 | 115 |
112 fun initialize () = (xmlTag := []; | 116 fun initialize () = (reset (); |
117 xmlTag := []; | |
113 xmlString := false) | 118 xmlString := false) |
114 | 119 |
115 | 120 |
116 structure StringMap = BinaryMapFn(struct | 121 structure StringMap = BinaryMapFn(struct |
117 type ord_key = string | 122 type ord_key = string |