1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

7 commits

Author SHA1 Message Date
Andy Wingo
cdad2166e7 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..
2009-02-19 17:25:52 +01:00
Andy Wingo
b72880eb17 implement object literals
* module/language/ecmascript/impl.scm:
* module/language/ecmascript/compile-ghil.scm (comp): Object literals.

* module/language/ecmascript/parse.scm (parse-ecmascript): Fix some
  object literal parsing.
2009-02-19 17:14:16 +01:00
Andy Wingo
7fb4230060 property gets and puts implemented, yays
* module/language/ecmascript/compile-ghil.scm (@impl): Ok, don't recurse
  on args here.
  (comp): Implement property gets and puts and lexical assignment.
  (comp-body): Fix scanning of var forms.

* module/language/ecmascript/impl.scm (prop-attrs): Allow for the prop
  attr array to be #f.

* module/language/ecmascript/parse.scm (parse-ecmascript): Fix assignment
  parsing.
2009-02-19 16:40:22 +01:00
Andy Wingo
10e1bd278f 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.
2009-02-19 16:09:00 +01:00
Andy Wingo
131f7d6c71 further ecmascript work
* libguile/vm-i-system.c (drop, return): Declare drop and return as
  popping one arg from the stack.

* module/language/ghil/compile-glil.scm:
* module/language/glil/compile-assembly.scm (make-meta): Adjust so that
  we declare 'drop and 'return calls as popping one arg from the stack.

* module/language/ecmascript/compile-ghil.scm (comp, comp-body): Flesh
  out a bit more. Most significantly, scoping within functions obeys
  javascript semantics better, modulo bits about with() forms.

* module/language/ecmascript/impl.scm: Define some runtime helper
  routines.
* module/language/Makefile.am (SOURCES): Add impl.scm.

* module/language/ecmascript/parse.scm (parse-ecmascript): Minor tweaks.

* module/language/ecmascript/tokenize.scm (read-identifier): Identifiers
  now read as symbols, not strings.
2009-02-19 13:55:55 +01:00
Andy Wingo
8fa6886d7a add more ecmascript compilation -- functions work now
* module/language/ecmascript/parse.scm (parse-ecmascript): Lambdas always
  just have one member in their bodies.

* module/language/ecmascript/compile-ghil.scm (comp): Add some more silly
  compilers.
2009-02-18 01:18:18 +01:00
Andy Wingo
5dcd3e4801 add ecmascript parser
* module/language/ecmascript/parse-lalr.scm: Add the Boucher/Bison lalr
  parser. This is from guile-lib, but with : changed to -> so as not to
  molest `prefix' keywords. Should probably be elsewhere.

* module/language/ecmascript/parse.scm: Add parser for ECMAScript. Rules
  from the spec, 3rd edition.

* module/language/ecmascript/tokenize.scm: Add ECMAScript tokenizer,
  hand-written. Neat stuff.

* module/language/Makefile.am: Autofoo.
2009-02-18 00:07:51 +01:00