`elide` token added with no functional changes; all tests still pass
parent
894c9780d8
commit
831d5cca35
Binary file not shown.
@ -0,0 +1,16 @@
|
||||
#lang br/ragg
|
||||
|
||||
;; Simple baby example of JSON structure
|
||||
json: number | string
|
||||
| array
|
||||
| object
|
||||
|
||||
number: NUMBER
|
||||
|
||||
string: STRING
|
||||
|
||||
array: "[" [json ("," json)*] "]"
|
||||
|
||||
object: "{" [kvpair ("," kvpair)*] "}"
|
||||
|
||||
kvpair: ID <":"> json
|
@ -0,0 +1,25 @@
|
||||
#lang racket/base
|
||||
(require "json-elider.rkt"
|
||||
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'")))
|
||||
"}")))
|
||||
|
||||
|
||||
#;(check-equal?
|
||||
(syntax->datum
|
||||
(parse "[[[{}]],[],[[{}]]]"))
|
||||
'(json (array #\[ (json (array #\[ (json (array #\[ (json (object #\{ #\})) #\])) #\])) #\, (json (array #\[ #\])) #\, (json (array #\[ (json (array #\[ (json (object #\{ #\})) #\])) #\])) #\])))
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue