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

9 commits

Author SHA1 Message Date
Ludovic Courtès
0ecd70a271 Adapt ECMAScript parser and lexer to `(system base lalr)'.
* 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'.
2010-03-31 00:42:01 +02:00
Ludovic Courtès
e5f5113c21 Remove unused variables in system/language.
* 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-09-21 00:36:31 +02:00
Andy Wingo
eb1482ac46 debitrot the ecmascript compiler
* 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-08-12 00:14:44 +02:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Andy Wingo
68776b1d94 parse division vs regexps properly
* module/language/ecmascript/tokenize.scm (make-tokenizer/1): Whoops, fix
  the cases in which we detect that division is valid.
2009-02-22 17:37:59 +01:00
Andy Wingo
a3e34104db ecmascript tokens have source info
* 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-22 11:37:55 +01:00
Andy Wingo
0b229e81a7 throw SyntaxError on bad syntax
* module/language/ecmascript/parse.scm (syntax-error):
* module/language/ecmascript/tokenize.scm (syntax-error): Throw an error
  on bad syntax.
2009-02-22 11:20:15 +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
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