unboxed -> val, boxed -> box

This commit is contained in:
Dmitry Boulytchev 2021-01-31 21:07:17 +03:00
parent 919cda5556
commit 5ae88f820d
8 changed files with 16 additions and 16 deletions

View file

@ -3,7 +3,7 @@ local n;
fun collect_ints_acc (v, tail) {
local i;
case v of
a@#unboxed -> Cons (a, tail)
a@#val -> Cons (a, tail)
| #string -> tail
| _ ->
for i := 0, i < v.length, i := i + 1 do

View file

@ -326,8 +326,8 @@ module Pattern =
| c:CHAR {Const (Char.code c)}
| %"true" {Const 1}
| %"false" {Const 0}
| "#" %"boxed" {Boxed}
| "#" %"unboxed" {UnBoxed}
| "#" %"box" {Boxed}
| "#" %"val" {UnBoxed}
| "#" %"string" {StringTag}
| "#" %"sexp" {SexpTag}
| "#" %"array" {ArrayTag}
@ -1270,7 +1270,7 @@ let run_parser cmd =
"length";
"string";
"case"; "of"; "esac"; "when";
"boxed"; "unboxed"; "string"; "sexp"; "array";
"box"; "val"; "string"; "sexp"; "array";
"infix"; "infixl"; "infixr"; "at"; "before"; "after";
"true"; "false"; "lazy"; "eta"; "syntax"]
in

View file

@ -1 +1 @@
let version = "Version 1.10, 297139c72, Sun Jan 31 19:11:03 2021 +0300"
let version = "Version 1.10, 919cda555, Sun Jan 31 19:27:00 2021 +0300"

View file

@ -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

View file

@ -20,7 +20,7 @@ public infix =?= at < (x, y) {
esac;
case r of
[#unboxed] -> r
[#val] -> r
| [x] -> walkrec (r, p1, x)
esac
}

View file

@ -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)

View file

@ -2,7 +2,7 @@ fun collect_ints_acc (v, tail) {
local i;
case v of
a@#unboxed -> Cons (a, tail)
a@#val -> Cons (a, tail)
| #string -> tail
| _ ->
for i := 0, i < v.length, i := i + 1 do

View file

@ -62,7 +62,7 @@ fun genCyclicArrays (n, eq, cross) {
if 1 - eq && deref (f) then
case b[i] of
#unboxed -> b[i] := b[i] + 1
#val -> b[i] := b[i] + 1
| _ -> b[i] := 0
esac;
f ::= true