298 to reconstruct the input. *) |
298 to reconstruct the input. *) |
299 (* TODO: see if duplicating isar_output/parse_thy can help here *) |
299 (* TODO: see if duplicating isar_output/parse_thy can help here *) |
300 |
300 |
301 fun match_tokens ([],us,vs) = (rev vs,us) (* used, unused *) |
301 fun match_tokens ([],us,vs) = (rev vs,us) (* used, unused *) |
302 | match_tokens (t::ts, w::ws, vs) = |
302 | match_tokens (t::ts, w::ws, vs) = |
303 if OuterLex.eq_token (t, w) |
303 if (t: OuterLex.token) = w (* FIXME !? *) |
304 then match_tokens (ts, ws, w::vs) |
304 then match_tokens (ts, ws, w::vs) |
305 else match_tokens (t::ts, ws, w::vs) |
305 else match_tokens (t::ts, ws, w::vs) |
306 | match_tokens _ = error ("match_tokens: mismatched input parse") |
306 | match_tokens _ = error ("match_tokens: mismatched input parse") |
307 in |
307 in |
308 fun pgip_parser str = |
308 fun pgip_parser str = |