diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-04-01 03:32:12 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-04-01 03:32:12 +0200 |
commit | 51a6838ec13ce2fd8de0b0ecd1fd2bb5a843f511 (patch) | |
tree | 1a1aacc6697feed118adc4420f94370e12adfd2c | |
parent | b033a36da749b14e70b62ede0572557f11d4d47c (diff) | |
download | geiser-51a6838ec13ce2fd8de0b0ecd1fd2bb5a843f511.tar.gz geiser-51a6838ec13ce2fd8de0b0ecd1fd2bb5a843f511.tar.bz2 |
More lenient scheme reader.
-rw-r--r-- | elisp/geiser-syntax.el | 10 |
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) |