001 schema directed parse

✓ Passing This code compiles and runs correctly.

Code

input.k

Actual

ada
lovelace|36|paris|nick=null|tags=3
bob 7 lyon nick=null tags=0
cid 9 oslo nick=present tags=1
BAD4 9: unterminated string
BAD5 14: missing field 'age'
valid [1,{"a":true},null,"x"]
BAD7 5: expected a number
flag=true pi=3.25 v=2

Expected output

ada
lovelace|36|paris|nick=null|tags=3
bob 7 lyon nick=null tags=0
cid 9 oslo nick=present tags=1
BAD4 9: unterminated string
BAD5 14: missing field 'age'
valid [1,{"a":true},null,"x"]
BAD7 5: expected a number
flag=true pi=3.25 v=2

Flows

flow ~parse click a branch to expand · @labels scroll to their anchor
parse (input: "{\"name\":\"ada\\nlovelace\",\"age\":36,\"addr\":{\"city\":\"paris\",\"zip\":\"75001\"},\"tags\":[\"a\",\"b\",\"c\"],\"nick\":null,\"extra\":{\"deep\":[1,{\"x\":2}]},\"junk\":[true,false,null,1.5e2]}")
flow ~parse click a branch to expand · @labels scroll to their anchor
parse (input: "{\"name\":\"bob\",\"age\":7,\"addr\":{\"city\":\"lyon\"},\"tags\":[]}")
flow ~parse click a branch to expand · @labels scroll to their anchor
parse (input: "{\"name\":\"cid\",\"age\":9,\"addr\":{\"city\":\"oslo\"},\"tags\":[\"x\"],\"nick\":\"ciddy\"}")
flow ~parse click a branch to expand · @labels scroll to their anchor
parse (input: "{\"name\":\"unterminated")
flow ~parse click a branch to expand · @labels scroll to their anchor
parse (input: "{\"name\":\"zed\"}")
flow ~parse click a branch to expand · @labels scroll to their anchor
parse (input: "[1,{\"a\":true},null,\"x\"]")
flow ~parse click a branch to expand · @labels scroll to their anchor
parse (input: "{\"a\":}")
flow ~parse click a branch to expand · @labels scroll to their anchor
parse (input: "{\"flag\":true,\"pi\":3.25,\"v\":1,\"v\":2}")

Test Configuration

MUST_RUN