summaryrefslogtreecommitdiff
path: root/elisp/geiser-syntax.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-04-01 03:32:12 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-04-01 03:32:12 +0200
commite6561280d19f32a9d556f729a5bfefabb950e79f (patch)
tree35baf5131c117528a2ab38b8f0df49acd19d480e /elisp/geiser-syntax.el
parentd96fe6fc9dbad5d65abe271ceb692f732d53e2fe (diff)
downloadgeiser-chez-e6561280d19f32a9d556f729a5bfefabb950e79f.tar.gz
geiser-chez-e6561280d19f32a9d556f729a5bfefabb950e79f.tar.bz2
More lenient scheme reader.
Diffstat (limited to 'elisp/geiser-syntax.el')
-rw-r--r--elisp/geiser-syntax.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index 7bd3cb1..89f9abb 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -125,6 +125,7 @@
(?\\ (cons 'char (geiser-syntax--read/elisp)))
(?\( (geiser-syntax--read/token 'vectorb))
(?\< (geiser-syntax--read/unprintable))
+ ((?' ?` ?,) (char-before) (geiser-syntax--read/next-token))
(t (let ((tok (geiser-syntax--read/elisp)))
(if tok (cons 'atom (intern (format "#%s" tok)))
(geiser-syntax--read/next-token))))))
@@ -143,6 +144,13 @@
(if (memq (car token) tks) token
(error "Unexpected token: %s" token))))
+(defsubst geiser-syntax--read/skip-until (&rest tks)
+ (let (token)
+ (while (and (not (memq (car token) tks))
+ (not (eq (car token) 'eob)))
+ (setq token (geiser-syntax--read/next-token)))
+ token))
+
(defsubst geiser-syntax--read/try (&rest tks)
(let ((p (point))
(tk (ignore-errors (apply 'geiser-syntax--read/match tks))))
@@ -152,7 +160,7 @@
(defun geiser-syntax--read/list ()
(cond ((geiser-syntax--read/try 'dot)
(let ((tail (geiser-syntax--read)))
- (geiser-syntax--read/match 'eob 'rparen)
+ (geiser-syntax--read/skip-until 'eob 'rparen)
tail))
((geiser-syntax--read/try 'rparen 'eob) nil)
(t (cons (geiser-syntax--read)