Add prefab structs to match grammar
This commit is contained in:
parent
fe2e480ef1
commit
9f682a3f11
|
@ -50,6 +50,7 @@ qp ::= literal @match literal
|
|||
| (qp ooo . qp) @match qps beginning with repeated qp
|
||||
| #(qp ...) @match vector of qps
|
||||
| #&qp @match boxed qp
|
||||
| #s(prefab-key qp ...) @match prefab struct with qp fields
|
||||
| ,pat @match pat
|
||||
| ,@(LIST lvp ...) @match lvps, spliced
|
||||
| ,@(LIST-REST lvp ... pat) @match lvps plus pat, spliced
|
||||
|
|
|
@ -58,6 +58,10 @@
|
|||
(list->vector (map fixup-sexp (vector->list s)))]
|
||||
[(box? s)
|
||||
(box (fixup-sexp (unbox s)))]
|
||||
[(struct? s)
|
||||
(apply make-prefab-struct
|
||||
(prefab-struct-key s)
|
||||
(cdr (map fixup-sexp (vector->list (struct->vector s)))))]
|
||||
[(symbol? s)
|
||||
(case s
|
||||
[(lvp pat qp literal ooo datum struct-id
|
||||
|
|
Loading…
Reference in New Issue
Block a user