From cbfab92584072ba0e1c4119612a8438db61ecbf6 Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 24 Mar 2022 00:51:33 +0000 Subject: Support for #{...}# extended symbol syntax Should fix issue #41, possibly the oldest still standing! My thanks and apologies to @ghost, wherever you are! --- elisp/geiser-syntax.el | 8 ++++++++ 1 file changed, 8 insertions(+) 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)) -- cgit v1.2.3