oke.
This commit is contained in:
@@ -108,6 +108,13 @@
|
||||
[(_ obj field) (string-append (js1 obj) "." (js-id field))]
|
||||
[(_ obj field rest ...) (js-dot* (js-dot* obj field) rest ...)]))
|
||||
|
||||
(define-syntax js-ref*
|
||||
(syntax-rules ()
|
||||
[(_ obj key) (string-append (js1 obj) "[" (js1 key) "]")]
|
||||
[(_ obj key rest ...)
|
||||
(string-append (js-ref* obj key)
|
||||
(string-append "[" (js1 rest) "]") ...)]))
|
||||
|
||||
(define-syntax js-send
|
||||
(syntax-rules ()
|
||||
[(_ obj method) (string-append (js1 obj) "." (js-id method) "()")]
|
||||
@@ -295,6 +302,7 @@
|
||||
[(eq? d 'list) #'(js-array arg ...)]
|
||||
[(eq? d 'cons) #'(js-cons arg ...)]
|
||||
[(or (eq? d 'js-dot) (eq? d 'dot)) #'(js-dot* arg ...)]
|
||||
[(eq? d 'js-ref) #'(js-ref* arg ...)]
|
||||
[(eq? d 'new) #'(js-new arg ...)]
|
||||
[(identifier? #'op) #'(js-call op arg ...)]
|
||||
[else (raise-syntax-error 'js1 "unsupported compound expression" stx #'op)]))]
|
||||
|
||||
Reference in New Issue
Block a user