summaryrefslogtreecommitdiff
path: root/module/language/ecmascript
AgeCommit message (Collapse)AuthorFilesLines
2009-02-21implement more operationsAndy Wingo4-13/+122
* module/language/ecmascript/base.scm: Implement some more robust property getters that convert strings to symbols. Implement has-property?. * module/language/ecmascript/compile-ghil.scm (comp): Implement lots more mathematical operators. We now do all expressions; on to statements. * module/language/ecmascript/impl.scm: Define some math helpers. They probably need to call ->number on some things. * module/language/ecmascript/parse.scm (parse-ecmascript): Fix a typo.
2009-02-21clean up ++ and -- a little bitAndy Wingo1-116/+125
* module/language/ecmascript/compile-ghil.scm (comp): Define let1 and begin1 helpers. Use them in pre- and post- increment and decrement.
2009-02-21implement ++, --, new, delete, void, typeofAndy Wingo2-7/+158
* module/language/ecmascript/compile-ghil.scm (@impl): Implement with @implv. (comp): Implement ++ and -- (pre- and post-). Quite a pain. I'll be looking for ways to simplify this notation. Also implement new, delete, and void. * module/language/ecmascript/impl.scm: Implement typeof.
2009-02-21handle "this" in ecmascriptAndy Wingo4-4/+27
* module/language/ecmascript/base.scm: * module/language/ecmascript/compile-ghil.scm: * module/language/ecmascript/impl.scm: * module/language/ecmascript/parse.scm: Compile "method calls" in such a way that "this" gets propagated correctly.
2009-02-21implement more of the standard runtimeAndy Wingo4-212/+428
* module/language/Makefile.am: * module/language/ecmascript/impl.scm: * module/language/ecmascript/array.scm: * module/language/ecmascript/base.scm: * module/language/ecmascript/function.scm: Split out the runtime into different files. Implement more of the spec's runtime.
2009-02-19support foo["bar"] in addition to foo.barAndy Wingo3-25/+28
* 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-19implement object literalsAndy Wingo3-6/+25
* 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-19var at toplevel works tooAndy Wingo1-3/+19
* module/language/ecmascript/compile-ghil.scm (comp): Fix the var form at toplevel.
2009-02-19property gets and puts implemented, yaysAndy Wingo3-9/+18
* 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-19add array supportAndy Wingo3-10/+58
* 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-19further ecmascript workAndy Wingo4-12/+264
* 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-18add more ecmascript compilation -- functions work nowAndy Wingo2-6/+19
* 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-18world's stupidest ecmascript compilerAndy Wingo2-0/+107
* module/language/ecmascript/spec.scm: Add language spec for ecmascript. * module/language/ecmascript/compile-ghil.scm: Add a stupid compiler. * module/language/Makefile.am: Buildage.
2009-02-18add ecmascript parserAndy Wingo3-0/+2529
* 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.