diff options
author | jao <jao@gnu.org> | 2022-03-24 00:51:33 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-03-24 00:51:33 +0000 |
commit | cbfab92584072ba0e1c4119612a8438db61ecbf6 (patch) | |
tree | f379a3fd55eafa054499c5dd6ba6d7489cdeffb4 /elisp | |
parent | bc0dde310492de733f9ec528d7aeddd57093d05e (diff) | |
download | geiser-cbfab92584072ba0e1c4119612a8438db61ecbf6.tar.gz geiser-cbfab92584072ba0e1c4119612a8438db61ecbf6.tar.bz2 |
Support for #{...}# extended symbol syntax
Should fix issue #41, possibly the oldest still standing! My thanks
and apologies to @ghost, wherever you are!
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-syntax.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el index a5fc54f..d4ea75e 100644 --- a/elisp/geiser-syntax.el +++ b/elisp/geiser-syntax.el @@ -190,6 +190,13 @@ implementation-specific entries for font-lock-keywords.") (geiser-syntax--read/token (cons 'unprintable (geiser-syntax--read/matching "<" ">")))) +(defun geiser-syntax--read/ex-symbol () ;; #{foo bar}# style symbols + (let ((tk (geiser-syntax--read/matching "{" "}"))) + (when-let (c (geiser-syntax--read/next-char)) + (when (char-equal ?\# c) + (geiser-syntax--read/next-char) + (cons 'atom (make-symbol (format "#{%s}#" tk))))))) + (defun geiser-syntax--read/skip-comment () (while (and (geiser-syntax--read/next-char) (nth 8 (syntax-ppss)))) @@ -215,6 +222,7 @@ implementation-specific entries for font-lock-keywords.") (?\( (geiser-syntax--read/token 'vectorb)) (?\< (geiser-syntax--read/unprintable)) ((?' ?` ?,) (geiser-syntax--read/next-token)) + (?\{ (geiser-syntax--read/ex-symbol)) (t (let ((tok (geiser-syntax--read/symbol))) (cond ((equal (symbol-name tok) "t") '(boolean . :t)) ((equal (symbol-name tok) "f") '(boolean . :f)) |