kahl

R⁷RS Scheme parser combinator library for decoding BARE messages

git clone https://git.8pit.net/kahl.git

 1;; This file has been manually generated from schema.bare
 2
 3(define parse-public-key (parse-data 128))
 4(define parse-time parse-string)
 5
 6(define parse-department
 7  (parse-enum
 8    (list 0 1 2 3 4 99)))
 9
10(define parse-address
11  (parse-struct
12    (parse-list parse-string 4)
13    parse-string
14    parse-string
15    parse-string))
16
17(define parse-customer
18  (parse-struct
19    parse-string
20    parse-string
21    parse-address
22    (parse-list
23      (parse-struct
24        parse-i64
25        parse-i32))
26    (parse-map parse-string parse-data)))
27
28(define parse-employee
29  (parse-struct
30    parse-string
31    parse-string
32    parse-address
33    parse-department
34    parse-time
35    (parse-optional
36      parse-public-key)
37    (parse-map parse-string parse-data)))
38
39(define parse-terminated-employee parse-void)
40
41(define parse-person
42  (parse-union
43    (vector
44      parse-customer
45      parse-employee
46      parse-terminated-employee)))