equal
deleted
inserted
replaced
219 |
219 |
220 (* finite scans *) |
220 (* finite scans *) |
221 |
221 |
222 fun finite' (stopper, is_stopper) scan (state, input) = |
222 fun finite' (stopper, is_stopper) scan (state, input) = |
223 let |
223 let |
224 fun lost () = raise ABORT "Scanner bug: lost stopper of finite scan!"; |
224 fun lost () = raise ABORT "Bad scanner: lost stopper of finite scan!"; |
225 |
225 |
226 fun stop [] = lost () |
226 fun stop [] = lost () |
227 | stop lst = |
227 | stop lst = |
228 let val (xs, x) = split_last lst |
228 let val (xs, x) = split_last lst |
229 in if is_stopper x then ((), xs) else lost () end; |
229 in if is_stopper x then ((), xs) else lost () end; |