annotate samples/json.tp @ 245:3590ecca6bc9

Fix handling of unescaped tabs in string literals in new parser
author Mike Pavone <pavone@retrodev.com>
date Mon, 06 Jan 2014 01:03:18 -0800
parents 6e579a75a0a9
children
rev   line source
pavone@154 1 #{
pavone@154 2 main <- {
pavone@154 3 arr <- json decode: "[\"foo\", \"bar\", 13245, \"baz\" ]"
pavone@154 4 foreach: arr :idx val {
pavone@154 5 print: (string: idx) . ": " . (string: val) . "\n"
pavone@154 6 }
pavone@154 7 obj <- json decode: "{\"foo\": \"bar\", \"baz\": \"qux\", \"meaningOfLife\": 42 }"
pavone@154 8 foreach: obj :idx val {
pavone@154 9 print: (string: idx) . ": " . (string: val) . "\n"
pavone@154 10 }
pavone@154 11 }
pavone@154 12 }