diff options
author | Vladimir Azarov <avm@intermediate-node.net> | 2025-08-10 22:01:56 +0200 |
---|---|---|
committer | Vladimir Azarov <avm@intermediate-node.net> | 2025-08-10 22:01:56 +0200 |
commit | 66665caf9da212c121c99de95a18e6ae3470cdbc (patch) | |
tree | b623dbaeab84c4c4b5c9a67b49b14a6a80496e92 /parser.fun | |
parent | 413136926c66e97b4dd137b354665e5ae4ebb89e (diff) |
String literal deduplication
Diffstat (limited to 'parser.fun')
-rw-r--r-- | parser.fun | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -272,9 +272,8 @@ functor Parser(structure Tree: TREE; structure P: PPC; strlits: int list } - val intCompare = fn a => fn b => Int.compare (a, b) - val lookup = fn z => Tree.lookup intCompare z - val lookup2 = fn z => Tree.lookup2 intCompare z + val lookup = fn z => Tree.lookup compare z + val lookup2 = fn z => Tree.lookup2 compare z fun updateCtx (Ctx ctx) = fn z => let @@ -2621,7 +2620,7 @@ functor Parser(structure Tree: TREE; structure P: PPC; = let val newBufId = D.length types - val (_, aggrTypeNames) = Tree.insert intCompare aggrTypeNames id newBufId + val (_, aggrTypeNames) = Tree.insert compare aggrTypeNames id newBufId val status = if isSome body then "complete" else "incomplete" @@ -3347,7 +3346,7 @@ functor Parser(structure Tree: TREE; structure P: PPC; val () = D.push localVars ({ name = id, pos, t, onStack = not $ isScalar t }) - val (_, scope) = Tree.insert intCompare scope id varId + val (_, scope) = Tree.insert compare scope id varId in (varId, id, updateCtx (Ctx ctx) u#localScopes (fn scs => scope :: tl scs) %) @@ -3844,7 +3843,7 @@ functor Parser(structure Tree: TREE; structure P: PPC; = let val localVar = { name = id, pos, t, onStack = false } - val (_, scope) = Tree.insert intCompare scope id curVarId + val (_, scope) = Tree.insert compare scope id curVarId in D.push localVars localVar; createLocalVars scope (curVarId + 1) ts params |