1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-18 10:10:23 +02:00

read nil/t as #nil/#t

(Best-ability ChangeLog annotation added by Christine Lemmer-Webber.)

* module/language/elisp/lexer.scm (lex): Update to handle #nil / #t.
This commit is contained in:
Robin Templeton 2014-06-19 23:37:36 -04:00 committed by Christine Lemmer-Webber
parent cf5e02f1a6
commit 1099c7c6b6
No known key found for this signature in database
GPG key ID: 4BC025925FF8F4D3

View file

@ -370,6 +370,12 @@
(lambda (type str) (lambda (type str)
(case type (case type
((symbol) ((symbol)
(cond
((equal? str "nil")
(return 'symbol #nil))
((equal? str "t")
(return 'symbol #t))
(else
;; str could be empty if the first character is already ;; str could be empty if the first character is already
;; something not allowed in a symbol (and not escaped)! ;; something not allowed in a symbol (and not escaped)!
;; Take care about that, it is an error because that ;; Take care about that, it is an error because that
@ -381,7 +387,7 @@
;; infinite loop with further reading attempts. ;; infinite loop with further reading attempts.
(read-char port) (read-char port)
(error "invalid character in input" c)) (error "invalid character in input" c))
(return 'symbol (string->symbol str)))) (return 'symbol (string->symbol str))))))
((integer) ((integer)
;; In elisp, something like "1." is an integer, while ;; In elisp, something like "1." is an integer, while
;; string->number returns an inexact real. Thus we need ;; string->number returns an inexact real. Thus we need