mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
Cosmetics
This commit is contained in:
parent
6f72275cfa
commit
81be668d4e
2 changed files with 7 additions and 2 deletions
|
|
@ -1 +1 @@
|
||||||
let version = "Version 1.00, f81a63865, Wed Aug 26 00:27:42 2020 +0300"
|
let version = "Version 1.00, 6f72275cf, Thu Aug 27 07:24:46 2020 +0300"
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,12 @@ public fun memo (f) {
|
||||||
if log then printf ("Applying memoized parser to %s\n", s.string) fi;
|
if log then printf ("Applying memoized parser to %s\n", s.string) fi;
|
||||||
case findMap (deref (t), s) of
|
case findMap (deref (t), s) of
|
||||||
None ->
|
None ->
|
||||||
t ::= addMap (deref (t), s, [addSet (emptySet (compare), k), emptySet (fun (r1, r2) {case [r1, r2] of [Fail (_, _, _), Fail (_, _, _)] -> 0 | _ -> compare (r1, r2) esac })]);
|
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) {
|
f (fun (r) {
|
||||||
r := lookupMemo (restab, r);
|
r := lookupMemo (restab, r);
|
||||||
if log then printf ("Running continuation with result %s\n", r.string) fi;
|
if log then printf ("Running continuation with result %s\n", r.string) fi;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue