summaryrefslogtreecommitdiff
path: root/lib/json
diff options
context:
space:
mode:
Diffstat (limited to 'lib/json')
-rw-r--r--lib/json/fmt.myr6
-rw-r--r--lib/json/parse.myr8
-rw-r--r--lib/json/test/parse.myr4
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/json/fmt.myr b/lib/json/fmt.myr
index 04867f2..fe29688 100644
--- a/lib/json/fmt.myr
+++ b/lib/json/fmt.myr
@@ -32,7 +32,7 @@ const eltfmt = {sb, e, ind
const jstrfmt = {sb, str
std.sbputs(sb, "\"")
- for c in str
+ for c : str
match (c : char)
| '\x0c': std.sbputs(sb, "\\f")
| '\\': std.sbputs(sb, "\\\\")
@@ -50,7 +50,7 @@ const arrfmt = {sb, arr, ind
sep = ""
std.sbputs(sb, "[\n")
- for e in arr
+ for e : arr
std.sbputs(sb, sep)
indent(sb, ind + 1)
eltfmt(sb, e, ind + 1)
@@ -66,7 +66,7 @@ const objfmt = {sb, obj, ind
sep = ""
std.sbputs(sb, "{\n")
- for (k, v) in obj
+ for (k, v) : obj
std.sbputs(sb, sep)
indent(sb, ind + 1)
jstrfmt(sb, k)
diff --git a/lib/json/parse.myr b/lib/json/parse.myr
index ec22d91..d57d991 100644
--- a/lib/json/parse.myr
+++ b/lib/json/parse.myr
@@ -51,11 +51,11 @@ const free = {j
| &(`Num _): /* nothing */
| &(`Str s): std.slfree(s)
| &(`Arr a):
- for e in a
+ for e : a
free(e)
;;
| &(`Obj o):
- for (k, v) in o
+ for (k, v) : o
std.slfree(k)
free(v)
;;
@@ -124,7 +124,7 @@ const parseobj = {p
exit(p)
-> `std.Ok std.mk(`Obj membs)
:error
- for (k, v) in membs
+ for (k, v) : membs
std.slfree(k)
free(v)
;;
@@ -196,7 +196,7 @@ const parsearr = {p -> std.result(elt#, err)
exit(p)
-> `std.Ok std.mk(`Arr elts)
:error
- for e in elts
+ for e : elts
free(e)
;;
std.slfree(elts)
diff --git a/lib/json/test/parse.myr b/lib/json/test/parse.myr
index 4ed65dc..893398d 100644
--- a/lib/json/test/parse.myr
+++ b/lib/json/test/parse.myr
@@ -94,7 +94,7 @@ const filetest = {
var dir, data, path
dir = std.try(std.diropen("test/inputs"))
- for f in std.byentry(dir)
+ for f : std.byentry(dir)
path = std.pathcat("test/inputs", f)
data = std.try(std.slurp(path))
/* 'n' indicates expected failure, 'y' indicates expected success, 'i' indicates implementation defined */
@@ -104,7 +104,7 @@ const filetest = {
[.name=f, .fn={ctx
match json.parse(data)
| `std.Err e: /* ok */
- | `std.Ok r: testr.fail(ctx, "succeeded in parsing malformed json: {}\n", r)
+ | `std.Ok r: testr.fail(ctx, "succeeded : parsing malformed json: {}\n", r)
std.die("hah")
;;
}]