summaryrefslogtreecommitdiff
path: root/module/language/ecmascript/tokenize.scm
AgeCommit message (Collapse)AuthorFilesLines
2011-01-26Fix Hex ConstantsNoah Lavine1-1/+1
* module/language/ecmascript/tokenize.scm: hexadecimal constants can now use 'X' in addition to 'x'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2011-01-26Ecmascript SyntaxNoah Lavine1-1/+1
* module/language/ecmascript/tokenize.scm: an unbreakable space counts as whitespace. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2011-01-17Add ECMAScript Unicode literal supportNoah Lavine1-2/+6
* module/language/ecmascript/tokenize.scm: add unicode literals * test-suite/tests/ecmascript.test ("parser"): Add new tests for Latin-1 and Unicode escapes in string literals. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2010-11-18ecmascript tokenization errors report source locationAndy Wingo1-77/+97
* module/language/ecmascript/tokenize.scm (syntax-error): Report source locations. Adapt all callers to pass source locations.
2010-11-18fix ecmascript at the replAndy Wingo1-8/+11
* module/language/ecmascript/tokenize.scm (syntax-error): Reorder args to throw vals in the right order. (make-tokenizer/1): Fix. Broken since the lalr refactor...
2010-11-16ecmascript syntax errors throw to 'syntax-errorAndy Wingo1-1/+1
* module/language/ecmascript/parse.scm (syntax-error): * module/language/ecmascript/tokenize.scm (syntax-error): Throw to 'syntax-error as psyntax does.
2010-03-31Adapt ECMAScript parser and lexer to `(system base lalr)'.Ludovic Courtès1-27/+33
* module/language/ecmascript/tokenize.scm: Use `make-lexical-token' and related procedures instead of pairs as tokens passed to the parser. Pass source location information in the form of `source-location' objects. * module/language/ecmascript/parse.scm (read-ecmascript, read-ecmascript/1): Instantiate a new parser at each call. (parse-ecmascript): Rename to... (make-parser): ... this. Change `->' to `:' in the grammar syntax. * module/language/ecmascript/parse-lalr.scm: Remove. * module/Makefile.am (ECMASCRIPT_LANG_SOURCES): Remove `language/ecmascript/parse-lalr.scm'.
2009-09-21Remove unused variables in system/language.Ludovic Courtès1-2/+3
* module/language/assembly.scm (byte-length): Don't match unused record slots. * module/language/tree-il.scm (tree-il->scheme, post-order!, pre-order!): Likewise. * module/language/tree-il/analyze.scm (analyze-lexicals): Likewise. * module/language/tree-il/compile-glil.scm (flatten): Likewise. * module/language/assembly/disassemble.scm (disassemble-load-program): Don't match unused list elements. * module/language/glil/decompile-assembly.scm (decompile-toplevel, decompile-load-program): Likewise. * module/system/xref.scm (program-callee-rev-vars): Likewise. * module/language/assembly/compile-bytecode.scm (write-bytecode)[write-sized-loader]: Remove. * module/language/assembly/decompile-bytecode.scm (decode-load-program): Factorize `pad' variables. * module/language/ecmascript/base.scm (object->value/string, object->value/number)[v]: Remove. * module/language/ecmascript/tokenize.scm (read-slash)[c0]: Remove. * module/language/objcode/spec.scm (decompile-value)[nargs]: Remove. * module/system/repl/command.scm (time)[vms-start, vms-end]: Remove. * module/system/repl/repl.scm (prompting-meta-read): Use `prompt'.
2009-08-12debitrot the ecmascript compilerAndy Wingo1-1/+1
* module/Makefile.am (ECMASCRIPT_LANG_SOURCES): * module/language/ecmascript/compile-ghil.scm: * module/language/ecmascript/compile-tree-il.scm: SOURCES): Replace the GHIL compiler with a ->tree-il compiler. Not fully functional, but the basics work. * module/language/ecmascript/spec.scm: Only include the tree-il compiler. * module/language/ecmascript/tokenize.scm (read-punctuation): Avoid mutating a constant.
2009-06-17Change Guile license to LGPLv3+Neil Jerram1-14/+13
(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* )
2009-02-22parse division vs regexps properlyAndy Wingo1-1/+4
* module/language/ecmascript/tokenize.scm (make-tokenizer/1): Whoops, fix the cases in which we detect that division is valid.
2009-02-22ecmascript tokens have source infoAndy Wingo1-31/+38
* module/language/ecmascript/tokenize.scm: Attach source information to tokens. We have to enhance the lalr parser to actually let this information propagate through, though...
2009-02-22throw SyntaxError on bad syntaxAndy Wingo1-18/+21
* module/language/ecmascript/parse.scm (syntax-error): * module/language/ecmascript/tokenize.scm (syntax-error): Throw an error on bad syntax.
2009-02-19further ecmascript workAndy Wingo1-1/+1
* 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 ecmascript parserAndy Wingo1-0/+467
* 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.