mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-25 07:28:20 +00:00
Fix circular read syntax for records.
* lread.c (substitute_object_recurse): Work with records. * lread-tests.el (lread-record-1): New test.
This commit is contained in:
parent
a2b3fea957
commit
4fbfd7ad53
@ -3400,7 +3400,8 @@ substitute_object_recurse (Lisp_Object object, Lisp_Object placeholder, Lisp_Obj
|
||||
if (BOOL_VECTOR_P (subtree))
|
||||
return subtree; /* No sub-objects anyway. */
|
||||
else if (CHAR_TABLE_P (subtree) || SUB_CHAR_TABLE_P (subtree)
|
||||
|| COMPILEDP (subtree) || HASH_TABLE_P (subtree))
|
||||
|| COMPILEDP (subtree) || HASH_TABLE_P (subtree)
|
||||
|| RECORDP (subtree))
|
||||
length = ASIZE (subtree) & PSEUDOVECTOR_SIZE_MASK;
|
||||
else if (VECTORP (subtree))
|
||||
length = ASIZE (subtree);
|
||||
|
@ -112,4 +112,8 @@
|
||||
(should-error (read "#24r") :type 'invalid-read-syntax)
|
||||
(should-error (read "#") :type 'invalid-read-syntax))
|
||||
|
||||
(ert-deftest lread-record-1 ()
|
||||
(should (equal '(#s(foo) #s(foo))
|
||||
(read "(#1=#s(foo) #1#)"))))
|
||||
|
||||
;;; lread-tests.el ends here
|
||||
|
Loading…
Reference in New Issue
Block a user