summaryrefslogtreecommitdiff
path: root/module/language/ecmascript/compile-ghil.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-02-19 17:25:52 +0100
committerAndy Wingo <wingo@pobox.com>2009-02-19 17:25:52 +0100
commitcdad2166e73b91b8fce2c99d7c6878f65b349f99 (patch)
tree4e9851407642033214c49158f912082325ae9ca3 /module/language/ecmascript/compile-ghil.scm
parentb72880eb170ccec1177a6c93b1694014ee54a453 (diff)
downloadguile-cdad2166e73b91b8fce2c99d7c6878f65b349f99.tar.gz
support foo["bar"] in addition to foo.bar
* module/language/ecmascript/parse.scm (parse-ecmascript): And update the function declaration forms for the new var syntax. * module/language/ecmascript/compile-ghil.scm (comp): Support foo["bar"] in addition to foo.bar. * module/language/ecmascript/impl.scm (pget, pput): Some fixes for when we get non-symbols -- it can happen, yo. I suppose we should allow for non-string keys too..
Diffstat (limited to 'module/language/ecmascript/compile-ghil.scm')
-rw-r--r--module/language/ecmascript/compile-ghil.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/module/language/ecmascript/compile-ghil.scm b/module/language/ecmascript/compile-ghil.scm
index 880c79e35..825599d05 100644
--- a/module/language/ecmascript/compile-ghil.scm
+++ b/module/language/ecmascript/compile-ghil.scm
@@ -114,10 +114,14 @@
args)))
((pref ,obj ,prop)
(@impl e l pget (list (comp obj e) (make-ghil-quote e l prop))))
+ ((aref ,obj ,index)
+ (@impl e l pget (list (comp obj e) (comp index e))))
((= (ref ,name) ,val)
(make-ghil-set e l (ghil-var-for-set! e name) (comp val e)))
((= (pref ,obj ,prop) ,val)
(@impl e l pput (list (comp obj e) (make-ghil-quote e l prop) (comp val e))))
+ ((= (aref ,obj ,prop) ,val)
+ (@impl e l pput (list (comp obj e) (comp prop e) (comp val e))))
(else
(error "compilation not yet implemented:" x)))))