diff options
author | Vladimir Azarov <avm@intermediate-node.net> | 2025-06-04 20:45:08 +0200 |
---|---|---|
committer | Vladimir Azarov <avm@intermediate-node.net> | 2025-06-04 20:45:08 +0200 |
commit | 9ccb3fce8e390f09fa5b812a77f7a65c10c5e4b1 (patch) | |
tree | bdbbce79c18fdb2e68592ed828f43da0b03ecf8f /ppc.fun | |
parent | 546a5861526192a908f2aa2bfc3cfe4f3f3baf43 (diff) |
Registration of declarations
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 = |