added <id> in sexp-match?

This commit is contained in:
ESL 2024-06-18 14:31:37 -04:00
parent 87507dcd6b
commit 857242e8e0
2 changed files with 8 additions and 6 deletions

View file

@ -64,6 +64,7 @@
(define (sexp-match? pat x) (define (sexp-match? pat x)
(or (eq? pat '*) (or (eq? pat '*)
(and (eq? pat '<id>) (or (symbol? x) (procedure? x)))
(and (eq? pat '<symbol>) (symbol? x)) (and (eq? pat '<symbol>) (symbol? x))
(and (eq? pat '<string>) (string? x)) (and (eq? pat '<string>) (string? x))
(eq? x pat) (eq? x pat)

13
t.c
View file

@ -34,12 +34,13 @@ char *t_code[] = {
"3:cdr;y2:id;;;l4:y11:record-case;y2:id;y6:clause;y3:...;;;;", "3:cdr;y2:id;;;l4:y11:record-case;y2:id;y6:clause;y3:...;;;;",
"P", "sexp-match?", "P", "sexp-match?",
"%2'(y1:*),.1q,.0?{.0]3}'(y8:<symbol>),.2q?{.2Y0}{f},.0?{.0]4}'(y8:<str" "%2'(y1:*),.1q,.0?{.0]3}'(y4:<id>),.2q?{.2Y0,.0?{.0}{.3K0}_1}{f},.0?{.0"
"ing>),.3q?{.3S0}{f},.0?{.0]5}.3,.5q,.0?{.0]6}.4p?{'(y3:...),.5aq?{.4dp" "]4}'(y8:<symbol>),.3q?{.3Y0}{f},.0?{.0]5}'(y8:<string>),.4q?{.4S0}{f},"
"?{.4ddu}{f}}{f}?{.4da,.6q]6}.4dp?{'(y3:...),.5daq?{.4ddu}{f}}{f}?{.4a," ".0?{.0]6}.4,.6q,.0?{.0]7}.5p?{'(y3:...),.6aq?{.5dp?{.5ddu}{f}}{f}?{.5d"
"'(y1:*),.1q?{.6L0]7}.6,,#0.0,.3,&2{%1.0u,.0?{.0]2}.1p?{${.3a,:0,@(y11:" "a,.7q]7}.5dp?{'(y3:...),.6daq?{.5ddu}{f}}{f}?{.5a,'(y1:*),.1q?{.7L0]8}"
"sexp-match?)[02}?{.1d,:1^[21}f]2}f]2}.!0.0^_1[71}.5p?{${.7a,.7a,@(y11:" ".7,,#0.0,.3,&2{%1.0u,.0?{.0]2}.1p?{${.3a,:0,@(y11:sexp-match?)[02}?{.1"
"sexp-match?)[02}?{.5d,.5d,@(y11:sexp-match?)[62}f]6}f]6}f]6", "d,:1^[21}f]2}f]2}.!0.0^_1[81}.6p?{${.8a,.8a,@(y11:sexp-match?)[02}?{.6"
"d,.6d,@(y11:sexp-match?)[72}f]7}f]7}f]7",
"S", "sexp-case", "S", "sexp-case",
"l6:y12:syntax-rules;l1:y4:else;;l2:l4:y1:_;l2:y3:key;y3:...;;y7:clause" "l6:y12:syntax-rules;l1:y4:else;;l2:l4:y1:_;l2:y3:key;y3:...;;y7:clause"