mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
Fixed yet another ugly bug in Ostap
This commit is contained in:
parent
f81a638659
commit
6f72275cfa
2 changed files with 3 additions and 3 deletions
|
|
@ -43,12 +43,12 @@ public fun memo (f) {
|
|||
if log then printf ("Applying memoized parser to %s\n", s.string) fi;
|
||||
case findMap (deref (t), s) of
|
||||
None ->
|
||||
t ::= addMap (deref (t), s, [addSet (emptySet (compare), k), emptySet (compare)]);
|
||||
t ::= addMap (deref (t), s, [addSet (emptySet (compare), k), emptySet (fun (r1, r2) {case [r1, r2] of [Fail (_, _, _), Fail (_, _, _)] -> 0 | _ -> compare (r1, r2) esac })]);
|
||||
f (fun (r) {
|
||||
r := lookupMemo (restab, r);
|
||||
if log then printf ("Running continuation with result %s\n", r.string) fi;
|
||||
case findMap (deref (t), s) of
|
||||
Some ([ks, rs]) ->
|
||||
Some ([ks, rs]) ->
|
||||
if memSet (rs, r)
|
||||
then skip
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue