You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
beautiful-racket/beautiful-racket-ragg/br/ragg/test/test-baby-json.rkt

32 lines
927 B
Racket

9 years ago
#lang racket/base
(require br/ragg/examples/baby-json
br/ragg/support
rackunit)
(check-equal?
(syntax->datum
(parse (list "{"
(token 'ID "message")
":"
(token 'STRING "'hello world'")
"}")))
'(json (object "{"
(kvpair "message" ":" (json (string "'hello world'")))
"}")))
9 years ago
(require sugar/debug)
(syntax-property (report (cadr (syntax->list (cadr (syntax->list (parse (list "{"
(token 'ID "message")
":"
(token 'STRING "'hello world'")
"}"))))))) 'foo)
9 years ago
9 years ago
#;(check-equal?
9 years ago
(syntax->datum
(parse "[[[{}]],[],[[{}]]]"))
'(json (array #\[ (json (array #\[ (json (array #\[ (json (object #\{ #\})) #\])) #\])) #\, (json (array #\[ #\])) #\, (json (array #\[ (json (array #\[ (json (object #\{ #\})) #\])) #\])) #\])))