mirror of
https://github.com/false-schemers/skint.git
synced 2025-02-02 07:57:06 +01:00
qq extension `(,@3) => 3; cond-expand fix
This commit is contained in:
parent
36c26cea58
commit
8a3963ddb1
4 changed files with 18 additions and 17 deletions
|
@ -174,6 +174,7 @@
|
||||||
(define-syntax quasiquote
|
(define-syntax quasiquote
|
||||||
(syntax-rules (unquote unquote-splicing quasiquote)
|
(syntax-rules (unquote unquote-splicing quasiquote)
|
||||||
[(_ ,x) x]
|
[(_ ,x) x]
|
||||||
|
[(_ (,@x)) x] ; popular extension/optimization
|
||||||
[(_ (,@x . y)) (append x `y)]
|
[(_ (,@x . y)) (append x `y)]
|
||||||
[(_ `x . d) (cons 'quasiquote (quasiquote (x) d))]
|
[(_ `x . d) (cons 'quasiquote (quasiquote (x) d))]
|
||||||
[(_ ,x d) (cons 'unquote (quasiquote (x) . d))]
|
[(_ ,x d) (cons 'unquote (quasiquote (x) . d))]
|
||||||
|
|
|
@ -997,7 +997,7 @@
|
||||||
(define (make-cond-expand-transformer)
|
(define (make-cond-expand-transformer)
|
||||||
(lambda (sexp env)
|
(lambda (sexp env)
|
||||||
(define (lit=? id sym) ; match literal as free identifier
|
(define (lit=? id sym) ; match literal as free identifier
|
||||||
(and (id? id) (free-id=? id env sym root-environment sym)))
|
(and (id? id) (free-id=? id env sym root-environment)))
|
||||||
(cons begin-id (preprocess-cond-expand lit=? sexp env))))
|
(cons begin-id (preprocess-cond-expand lit=? sexp env))))
|
||||||
|
|
||||||
|
|
||||||
|
|
26
s.c
26
s.c
|
@ -125,19 +125,19 @@ char *s_code[] = {
|
||||||
";y4:step;y3:...;;y3:...;;;;;;",
|
";y4:step;y3:...;;y3:...;;;;;;",
|
||||||
|
|
||||||
"S", "quasiquote",
|
"S", "quasiquote",
|
||||||
"l11:y12:syntax-rules;l3:y7:unquote;y16:unquote-splicing;y10:quasiquote"
|
"l12:y12:syntax-rules;l3:y7:unquote;y16:unquote-splicing;y10:quasiquote"
|
||||||
";;l2:l2:y1:_;l2:y7:unquote;y1:x;;;y1:x;;l2:l2:y1:_;pl2:y16:unquote-spl"
|
";;l2:l2:y1:_;l2:y7:unquote;y1:x;;;y1:x;;l2:l2:y1:_;l1:l2:y16:unquote-s"
|
||||||
"icing;y1:x;;y1:y;;;l3:y6:append;y1:x;l2:y10:quasiquote;y1:y;;;;l2:py1:"
|
"plicing;y1:x;;;;y1:x;;l2:l2:y1:_;pl2:y16:unquote-splicing;y1:x;;y1:y;;"
|
||||||
"_;pl2:y10:quasiquote;y1:x;;y1:d;;;l3:y4:cons;l2:y5:quote;y10:quasiquot"
|
";l3:y6:append;y1:x;l2:y10:quasiquote;y1:y;;;;l2:py1:_;pl2:y10:quasiquo"
|
||||||
"e;;l3:y10:quasiquote;l1:y1:x;;y1:d;;;;l2:l3:y1:_;l2:y7:unquote;y1:x;;y"
|
"te;y1:x;;y1:d;;;l3:y4:cons;l2:y5:quote;y10:quasiquote;;l3:y10:quasiquo"
|
||||||
"1:d;;l3:y4:cons;l2:y5:quote;y7:unquote;;py10:quasiquote;pl1:y1:x;;y1:d"
|
"te;l1:y1:x;;y1:d;;;;l2:l3:y1:_;l2:y7:unquote;y1:x;;y1:d;;l3:y4:cons;l2"
|
||||||
";;;;;l2:l3:y1:_;l2:y16:unquote-splicing;y1:x;;y1:d;;l3:y4:cons;l2:y5:q"
|
":y5:quote;y7:unquote;;py10:quasiquote;pl1:y1:x;;y1:d;;;;;l2:l3:y1:_;l2"
|
||||||
"uote;y16:unquote-splicing;;py10:quasiquote;pl1:y1:x;;y1:d;;;;;l2:py1:_"
|
":y16:unquote-splicing;y1:x;;y1:d;;l3:y4:cons;l2:y5:quote;y16:unquote-s"
|
||||||
";ppy1:x;y1:y;;y1:d;;;l3:y4:cons;py10:quasiquote;py1:x;y1:d;;;py10:quas"
|
"plicing;;py10:quasiquote;pl1:y1:x;;y1:d;;;;;l2:py1:_;ppy1:x;y1:y;;y1:d"
|
||||||
"iquote;py1:y;y1:d;;;;;l2:py1:_;pv2:y1:x;y3:...;;y1:d;;;l2:y12:list->ve"
|
";;;l3:y4:cons;py10:quasiquote;py1:x;y1:d;;;py10:quasiquote;py1:y;y1:d;"
|
||||||
"ctor;py10:quasiquote;pl2:y1:x;y3:...;;y1:d;;;;;l2:py1:_;pzy1:x;;y1:d;;"
|
";;;;l2:py1:_;pv2:y1:x;y3:...;;y1:d;;;l2:y12:list->vector;py10:quasiquo"
|
||||||
";l2:y3:box;py10:quasiquote;py1:x;y1:d;;;;;l2:py1:_;py1:x;y1:d;;;l2:y5:"
|
"te;pl2:y1:x;y3:...;;y1:d;;;;;l2:py1:_;pzy1:x;;y1:d;;;l2:y3:box;py10:qu"
|
||||||
"quote;y1:x;;;",
|
"asiquote;py1:x;y1:d;;;;;l2:py1:_;py1:x;y1:d;;;l2:y5:quote;y1:x;;;",
|
||||||
|
|
||||||
"S", "when",
|
"S", "when",
|
||||||
"l3:y12:syntax-rules;n;l2:py1:_;py4:test;y4:rest;;;l3:y2:if;y4:test;py4"
|
"l3:y12:syntax-rules;n;l2:py1:_;py4:test;y4:rest;;;l3:y2:if;y4:test;py4"
|
||||||
|
|
6
t.c
6
t.c
|
@ -576,9 +576,9 @@ char *t_code[] = {
|
||||||
"1,&2{%0:1d,:0^[01},.1,&1{%0:0ad]0},.2aa,:0^[13}.!0.0^_1[41",
|
"1,&2{%0:1d,:0^[01},.1,&1{%0:0ad]0},.2aa,:0^[13}.!0.0^_1[41",
|
||||||
|
|
||||||
"P", "make-cond-expand-transformer",
|
"P", "make-cond-expand-transformer",
|
||||||
"%0&0{%2,#0.2,&1{%2${.2,@(y3:id?)[01}?{.1,@(y16:root-environment),.3,:0"
|
"%0&0{%2,#0.2,&1{%2${.2,@(y3:id?)[01}?{@(y16:root-environment),.2,:0,.3"
|
||||||
",.4,@(y9:free-id=?)[25}f]2}.!0${.4,.4,.4^,@(y22:preprocess-cond-expand"
|
",@(y9:free-id=?)[24}f]2}.!0${.4,.4,.4^,@(y22:preprocess-cond-expand)[0"
|
||||||
")[03},@(y8:begin-id)c]3}]0",
|
"3},@(y8:begin-id)c]3}]0",
|
||||||
|
|
||||||
"P", "adjoin-code",
|
"P", "adjoin-code",
|
||||||
"%2'(l1:y5:begin;),.1e?{.1]2}'(l1:y5:begin;),.2e?{.0]2}${.2,'(l3:y5:beg"
|
"%2'(l1:y5:begin;),.1e?{.1]2}'(l1:y5:begin;),.2e?{.0]2}${.2,'(l3:y5:beg"
|
||||||
|
|
Loading…
Add table
Reference in a new issue