mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
unboxed -> val, boxed -> box
This commit is contained in:
parent
919cda5556
commit
5ae88f820d
8 changed files with 16 additions and 16 deletions
|
|
@ -311,7 +311,7 @@ public fun lookupMemo (mm@[p, m], v) {
|
|||
| _ -> x ()
|
||||
esac}
|
||||
(fun () {case v of
|
||||
#unboxed -> v
|
||||
#val -> v
|
||||
| _ ->
|
||||
case findMap (m, v) of
|
||||
Some (w) -> w
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ public infix =?= at < (x, y) {
|
|||
esac;
|
||||
|
||||
case r of
|
||||
[#unboxed] -> r
|
||||
| [x] -> walkrec (r, p1, x)
|
||||
[#val] -> r
|
||||
| [x] -> walkrec (r, p1, x)
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -198,13 +198,13 @@ fun createResult () {
|
|||
fun k (x) {
|
||||
if log then printf ("Result: %s\n", x.string) fi;
|
||||
case x of
|
||||
Succ (val, s) ->
|
||||
Succ (v, s) ->
|
||||
if log then printf ("Result stream: %s\n", showMatcher (s)) fi;
|
||||
if deref (hasValue)
|
||||
then failure (sprintf ("Ostap: ambiguous parsing (%s vs. %s)", deref (value).string, val.string))
|
||||
then failure (sprintf ("Ostap: ambiguous parsing (%s vs. %s)", deref (value).string, v.string))
|
||||
else
|
||||
hasValue ::= true;
|
||||
value ::= val
|
||||
value ::= v
|
||||
fi
|
||||
| Fail (err, l, c) ->
|
||||
if deref (hasError)
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ fun collect_ints_acc (v, tail) {
|
|||
local i;
|
||||
|
||||
case v of
|
||||
a@#unboxed -> Cons (a, tail)
|
||||
| #string -> tail
|
||||
a@#val -> Cons (a, tail)
|
||||
| #string -> tail
|
||||
| _ ->
|
||||
for i := 0, i < v.length, i := i + 1 do
|
||||
tail := collect_ints_acc (v[i], tail)
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ fun genCyclicArrays (n, eq, cross) {
|
|||
|
||||
if 1 - eq && deref (f) then
|
||||
case b[i] of
|
||||
#unboxed -> b[i] := b[i] + 1
|
||||
| _ -> b[i] := 0
|
||||
#val -> b[i] := b[i] + 1
|
||||
| _ -> b[i] := 0
|
||||
esac;
|
||||
f ::= true
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue