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

154 commits

Author SHA1 Message Date
Daniel Kraft
9e90010f07 Replaced generated elisp parser with hand-written one to fix source properties.
* module/language/elisp/parser.scm: Hand-written parser.
* test-suite/tests/elisp-reader.test: Test for source properties.
2009-08-27 17:15:57 +02:00
Daniel Kraft
15eeabfd53 Don't accept backquote/unquote/unquote-splicing any longer in elisp.
The real names \`, \, and \,@ should be used instead and are returned
now by the real reader.

* module/language/elisp/compile-tree-il.scm: Only accept correct names.
2009-08-27 16:19:03 +02:00
Daniel Kraft
98c2d75a15 Error in lexer when 'empty' symbol would have been read. 2009-08-26 22:03:01 +02:00
Daniel Kraft
e840cc6540 Parser for elisp and use it as reader.
* module/language/elisp/parser.scm: New parser file.
* module/language/elisp/lexer.scm: Fix lexer/1 and add unquote-splicing support.
* module/language/elisp/spec.scm: Use new elisp-reader.
* module/language/elisp/README: Document we've got a reader now.
* test-suite/tests/elisp-reader.test: Test the parser.
2009-08-26 21:36:37 +02:00
Daniel Kraft
ddb4364b1a get-lexer/1 for elisp that finishes after the first full expression is read.
* module/language/elisp/lexer.scm: Add get-lexer/1.
* test-suite/tests/elisp-reader.test: Test lexer/1.
2009-08-26 21:03:06 +02:00
Daniel Kraft
5b1ee3bef1 Character and string literal support for the elisp lexer.
* module/language/elisp/lexer.scm: Handle character and string literals.
* test-suite/tests/elisp-reader.test: Test it.
2009-08-26 19:48:06 +02:00
Daniel Kraft
25512a940b A first, rough lexer for elisp still missing some stuff.
* module/language/elisp/lexer.scm: New lexer file.
* test-suite/Makefile.am: Register elisp-reader.test as new test.
* test-suite/tests/elisp-reader.test: New test-case.
2009-08-26 14:32:48 +02:00
Daniel Kraft
1b1195f29b Abstracted dynamic binding a little off the fluids.
* module/language/elisp/compile-tree-il.scm: Move dynamic binding to one place
  and changed names that refer to `fluids' for dynamic binding.
* module/language/elisp/bindings.scm: Changed names referring to `fluids'.
2009-08-04 09:23:02 +02:00
Daniel Kraft
f4dc86f137 Implement catch and unwind-protect as macros.
* module/language/elisp/compile-tree-il.scm: Remove catch and unwind-protect.
* module/language/elisp/runtime/macro-slot.scm: Re-implement them here.
2009-08-03 18:22:12 +02:00
Daniel Kraft
dfbc6e9d54 Allow lexical binding of lambda arguments.
* module/language/elisp/compile-tree-il.scm: Rework lambda compiler to allow
  opional lexical binding of (some) lambda arguments.
* test-suite/tests/elisp-compiler.test: Check this.
2009-08-01 13:00:27 +02:00
Daniel Kraft
c808c926fd Compiler option to always bind certain symbols lexically.
Affects so far let-bound symbols, lambda arguments to come in the future.

* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Add :always-lexical option.
* test-suite/tests/elisp-compiler.test: Test it.
2009-07-31 18:00:01 +02:00
Daniel Kraft
bfd472a7d3 Use explicit guile-primitive forms in the macro expansion of dotimes and dolist. 2009-07-30 21:49:00 +02:00
Daniel Kraft
e6042c08b7 Implement some elisp constructs in macros instead of hard-coded compiler code.
* module/language/elisp/compile-tree-il.scm: Remove implementation of prog1,
  and, or, cond, dolist.
* module/language/elisp/runtime/macro-slot.scm: Implement them here instead.
2009-07-30 21:43:24 +02:00
Daniel Kraft
f3df67e203 without-void-checks as new extension for fine-control
* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Handle without-void-checks.
* test-suite/tests/elisp-compiler.test: Test it.
2009-07-30 13:51:45 +02:00
Daniel Kraft
e96a9591ce funcall, apply and eval built-ins.
* module/language/elisp/README: Document new features.
* module/language/elisp/runtime/function-slot.scm: Implement funcall, apply and
  eval by using the existing compiler code.
* test-suite/tests/elisp-compiler.test: Test those.
2009-07-29 16:27:45 +02:00
Daniel Kraft
c61ec8e29e Added guile-primitive construct for references to primitives from Elisp.
* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Implement guile-primitive.
* test-suite/tests/elisp-compiler.test: Switched a usage of guile-ref to
  the now available guile-primitive.
2009-07-29 14:25:33 +02:00
Daniel Kraft
c2c7c27755 Added length built-in.
* module/language/elisp/runtime/function-slot.scm: Add length built-in.
* test-suite/tests/elisp-compiler.test: Test length.
2009-07-29 13:45:40 +02:00
Daniel Kraft
a6a5cf03d4 Implemented lexical-let and lexical-let* for elisp.
* module/language/elisp/README: Document it.
* module/language/elisp/bindings.scm: New fields in bindings data structure
  to keep track of lexical bindings for symbols.
* module/language/elisp/compile-tree-il.scm: Implement lexical-let(*).
* test-suite/tests/elisp-compiler.test: Test lexical scoping with lexical-let.
2009-07-29 12:09:43 +02:00
Daniel Kraft
a089997441 Compiler option to disable void-checks in elisp.
* module/language/elisp/README: Document the change.
* module/language/elisp/compile-tree-il.scm: Add disable-void-check option.
* test-suite/tests/elisp-compiler.test: Test it.
2009-07-24 11:09:57 +02:00
Daniel Kraft
a90d9c855d Don't pass the bindings-data all around in compile-tree-il, but use fluids for this dynamic binding.
* module/language/elisp/compile-tree-il.scm: Use fluid for bindings-data.
2009-07-24 10:40:07 +02:00
Daniel Kraft
e8f18b3f63 Implemented the flet and flet* extensions.
* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Implement flet and flet*.
* test-suite/tests/elisp-compiler.test: Test flet and flet*.
2009-07-24 09:56:13 +02:00
Daniel Kraft
3709984696 Implemented dynamic symbol access built-ins (set, fset, symbol-value, makunbound...)
* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Moved ensure-fluid! to runtime function.
* module/language/elisp/runtime.scm: Runtime functions to support dynamic value access.
* module/language/elisp/runtime/function-slot.scm: Defined the built-ins.
* test-suite/tests/elisp-compiler.test: Test them.
2009-07-23 14:09:55 +02:00
Daniel Kraft
33da12eeff Added guile-ref extension construct, change throw implementation to easier one using a built-in function and implement unwind-protect.
* module/language/elisp/README: Document the changes.
* module/language/elisp/compile-tree-il.scm: Implement unwind-protect.
* module/language/elisp/runtime/function-slot.scm: throw as built-in.
* test-suite/tests/elisp-compiler.test: Test unwind-protect.
2009-07-22 12:50:56 +02:00
Daniel Kraft
35b2e41d6d Implemented catch and throw in elisp.
* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement catch and throw.
* test-suite/tests/elisp-compiler.test: Test catch/throw.
2009-07-22 12:23:03 +02:00
Daniel Kraft
5d221ca375 Don't ensure fluids all over the place but scan for variables needed and ensure just before the compiled code all those.
* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement it here, pass bindings all around the compilation.
* module/language/elisp/bindings.scm: New module with symbol-tracking abilities needed for this.
2009-07-21 16:45:10 +02:00
Daniel Kraft
fb66a47a8e Implemented prog1, prog2, dotimes, dolist control structures.
* module/language/elisp/README: Document it and some further ideas written down.
* module/language/elisp/compile-tree-il.scm: Implement prog1, dolist.
* module/language/elisp/runtime/macro-slot.scm: prog2 and dotimes.
* test-suite/tests/elisp-compiler.test: Test prog1, prog2, dotimes, dolist.
2009-07-20 20:52:00 +02:00
Daniel Kraft
f614ca12cd Implemented some important list built-ins.
* module/language/elisp/runtime.scm: Updated/added convenience macros.
* module/language/elisp/runtime/function-slot.scm: Implement list built-ins.
* module/language/elisp/runtime/macro-slot.scm: Implement list built-ins.
* test-suite/tests/elisp-compiler.test: Test the implemented built-ins.
2009-07-18 20:10:24 +02:00
Daniel Kraft
7d1a978289 Implemented unless, when and dotimes using built-in macros.
* module/language/elisp/README: Document that.
* module/language/elisp/runtime.scm: Defined built-in-macro macro.
* module/language/elisp/runtime/macro-slot.scm: Implement unless, when, dotimes.
* test-suite/tests/elisp-compiler.test: Test for those constructs.
2009-07-18 18:38:42 +02:00
Daniel Kraft
570c12aca7 Return correct value for setq form.
* module/language/elisp/compile-tree-il.scm: Fix implementation of setq.
* test-suite/tests/elisp-compiler.test: Check for value of setq form.
2009-07-18 17:58:01 +02:00
Daniel Kraft
9b5ff6a6e1 Implemented real quotation (added support for backquotation).
* module/language/elisp/README: Document that.
* module/language/elisp/compile-tree-il.scm: Implement backquote.
* test-suite/tests/elisp-compiler.test: Test quotation and backquotes.
2009-07-18 17:32:59 +02:00
Daniel Kraft
e905e490fa Implemented eq and equal built-in predicates.
* module/language/elisp/runtime/function-slot.scm: Implement eq and equal.
* test-suite/tests/elisp-compiler.test: Test them.
2009-07-18 17:21:55 +02:00
Daniel Kraft
74c009dadc Implemented macros in elisp compiler.
* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Implement defmacro and expansion.
* module/language/elisp/runtime/macro-slot.scm: New module to keep definitions.
* test-suite/Makefile.am: Add elisp-compiler.test to list of tests.
* test-suite/tests/elisp-compiler.test: Basic macro tests.
2009-07-16 15:23:38 +02:00
Daniel Kraft
b6b9d59604 Extended test-suite to cover already implemented built-ins and fixed errors found.
* module/language/elisp/runtime/function-slot.scm: Fixed errors in number preds.
* test-suite/tests/elisp-compiler.test: Test built-ins already implemented.
2009-07-16 14:28:07 +02:00
Daniel Kraft
d158fa62ab Test-suite for elisp compiler so far, excluding the built-ins.
* test-suite/tests/elisp-compiler.test: Tests for compiler so far.
2009-07-15 22:08:36 +02:00
Daniel Kraft
09241ea7f7 Removed wrong not in zerop built-in.
* module/language/elisp/runtime/function-slot.scm: Fix zerop.
2009-07-15 13:51:19 +02:00
Daniel Kraft
de9f26b5f0 Implemented defconst, defvar, defun special forms for elisp.
* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement defconst/defvar/defun.
2009-07-14 21:18:07 +02:00
Daniel Kraft
1e018f6c67 Some bug fixes on the way and mainly implemented some built-ins (arithmetic).
* module/language/elisp/README: Document changes.
* module/language/elisp/compile-tree-il.scm: Bug fixes to fluid-creation.
* module/language/elisp/runtime.scm: Some helping definitions for built-ins.
* module/language/elisp/runtime/function-slot.scm: Defined artihmetic built-ins.
2009-07-13 18:35:57 +02:00
Daniel Kraft
f28de79197 Automatically create fluids when necessary.
* module/language/elisp/README: Document that.
* module/language/elisp/compile-tree-il.scm: Create fluids when necessary.
* module/language/elisp/runtime/function-slot.scm: Fix module name.
2009-07-13 17:26:07 +02:00
Daniel Kraft
cef997e82a Fixed lambda expressions and implemented function calls using the basic list notation.
* module/language/elisp/README: Document that.
* module/language/elisp/compile-tree-il.scm: Implement function calls.
2009-07-13 16:51:05 +02:00
Daniel Kraft
50abfe7649 Lambda expressions in elisp, but not yet function calls.
* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement lambda expressions.
2009-07-13 15:43:53 +02:00
Daniel Kraft
3a4b86357e Implemented let and let* in elisp.
* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Implement let and let*.
2009-07-07 19:38:25 +02:00
Daniel Kraft
d221c18bc0 Implemented while construct in elisp.
* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement while construct.
2009-07-07 17:26:22 +02:00
Daniel Kraft
344927c3f8 Implemented fluid-based variable references and setting using setq.
* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement variable references, setq
* module/language/elisp/runtime.scm: New file for runtime definitions.
* module/language/elisp/runtime/function-slot.scm: Ditto.
* module/language/elisp/runtime/value-slot.scm: Ditto.
2009-07-03 23:00:12 +02:00
Daniel Kraft
fdfb36de84 Implemented elisp's or form.
* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement or.
2009-07-02 21:22:25 +02:00
Daniel Kraft
a431673924 For elisp's (cond ...) and (condition) forms without body, return the condition as value.
* compile-tree-il.scm: Fix compilation of (cond ...) for bodyless conditions.
2009-07-02 21:10:38 +02:00
Daniel Kraft
4530432e01 Added make-nil instruction to VM and use it for Emacs' nil in the compiler.
* doc/ref/vm.texi: Document new instruction.
* libguile/vm-i-system.c: Add it to the VM.
* module/language/assembly.scm: Compile (const %nil) to (make-nil) assembly.
* module/language/glil/decompile-assembly.scm: Handle (make-nil)
* module/language/elisp/compile-tree-il.scm: Use (const %nil) for nil.
2009-06-29 13:16:27 +02:00
Daniel Kraft
46abd569d5 Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp 2009-06-27 20:07:11 +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
Daniel Kraft
51248e6e25 First code for elisp compilation, handling a very limited set of operations (but not really usable yet).
* module/language/elisp/README: New file containing some notes.
* module/language/elisp/compile-tree-il.scm: New file with compilation code.
* module/language/elisp/spec.scm: Updated language definition.
2009-06-09 21:37:13 +02:00
Andy Wingo
f698d111b4 remove .cvsignore files 2008-11-10 12:17:18 +01:00