diff options
Diffstat (limited to 'ppc.fun')
-rw-r--r-- | ppc.fun | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -255,8 +255,9 @@ struct fun handleMacroEnd id ppc = let - val f = fn (_, pos, macro) => (SOME (false, pos, macro), ()) - val ((), tree) = macrosLookup (#macros ppc) id (f, ()) + fun f NONE = (raise Unreachable, NONE) + | f (SOME (_, pos, macro)) = ((), SOME (false, pos, macro)) + val ((), tree) = macrosLookup (#macros ppc) id f in updatePpc ppc s#macros tree % end @@ -923,10 +924,12 @@ struct and handleRegularToken tk pos ppc = let - fun checkAndMark (true, _, _) = (NONE, NONE) - | checkAndMark (false, pos, macro) = - (SOME (true, pos, macro), SOME macro) - fun getMacro tree id = macrosLookup tree id (checkAndMark, NONE) + fun checkAndMark NONE = (NONE, NONE) + | checkAndMark (SOME (true, _, _)) = (NONE, NONE) + | checkAndMark (SOME (false, pos, macro)) = + (SOME macro, SOME (true, pos, macro)) + + fun getMacro tree id = macrosLookup tree id checkAndMark fun def () = (tk, pos, ppc) fun handleMacro id = |