summaryrefslogtreecommitdiff
path: root/module/language/ecmascript/compile-ghil.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-02-19 16:09:00 +0100
committerAndy Wingo <wingo@pobox.com>2009-02-19 16:09:00 +0100
commit10e1bd278fca5d65fba7fc977a14e4a37a572cc7 (patch)
tree22500a4c4d5dfc1ce4acf8fd9b65a1421b16a3db /module/language/ecmascript/compile-ghil.scm
parent131f7d6c71d0a0fe4f60b49a39efcd4f8ace6b0c (diff)
downloadguile-10e1bd278fca5d65fba7fc977a14e4a37a572cc7.tar.gz
add array support
* module/language/ecmascript/compile-ghil.scm (@impl): Whoops, fix this macro. (comp): Handle array literals. * module/language/ecmascript/impl.scm: Add support for arrays.
Diffstat (limited to 'module/language/ecmascript/compile-ghil.scm')
-rw-r--r--module/language/ecmascript/compile-ghil.scm10
1 files changed, 7 insertions, 3 deletions
diff --git a/module/language/ecmascript/compile-ghil.scm b/module/language/ecmascript/compile-ghil.scm
index 3bd6aee13..8c1cfc877 100644
--- a/module/language/ecmascript/compile-ghil.scm
+++ b/module/language/ecmascript/compile-ghil.scm
@@ -38,10 +38,12 @@
(and (not (null? props))
props))))
-(define-macro (@impl e l sym . args)
+(define-macro (@impl e l sym args)
`(make-ghil-call ,e ,l
- (ghil-var-at-module! ,e '(language ecmascript impl) ',sym #t)
- (list ,@(map (lambda (x) `(comp x ,e)) ,args))))
+ (make-ghil-ref
+ ,e ,l
+ (ghil-var-at-module! ,e '(language ecmascript impl) ',sym #t))
+ (map (lambda (x) (comp x ,e)) ,args)))
(define (comp x e)
(let ((l (location x)))
@@ -81,6 +83,8 @@
(make-ghil-call e l (comp proc e) (map (lambda (x) (comp x e)) args)))
((return ,expr)
(make-ghil-inline e l 'return (list (comp expr e))))
+ ((array . ,args)
+ (@impl e l new-array args))
(else
(error "compilation not yet implemented:" x)))))