summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cl-print.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2022-05-24 13:02:14 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2022-05-30 15:56:59 +0200
commitb903507b36c438653a02d7b6291e9744d5221e28 (patch)
tree0d193f92c1ea66b9da0a966d430f7affaa125537 /lisp/emacs-lisp/cl-print.el
parent169797a3002fae1e86ee799475cd4f1b7ef9a3d1 (diff)
downloademacs-b903507b36c438653a02d7b6291e9744d5221e28.tar.gz
emacs-b903507b36c438653a02d7b6291e9744d5221e28.tar.bz2
emacs-b903507b36c438653a02d7b6291e9744d5221e28.zip
Nonrecursive Lisp reader (bug#55676)
Restructure the reader to be nonrecursive so that it is not limited by the C stack or crashes Emacs when reading deeply nested data. This also improves performance. A few minor bugs were fixed: - (a .{NBSP}b) where {NBSP} is a non-breaking space (U+00A0) is now the dotted pair (a . b), not the 3-element list (a \. b), since U+00A0 is treated as whitespace everywhere else. - #_ with no symbol following is now equivalent to ## (empty interned symbol), not #: (empty uninterned symbol). * src/alloc.c (garbage_collect): Call mark_lread. * src/lread.c (readevalloop): Use read0 instead of read_list. (stackbufsize): Increase to 1024, now that read0 isn't recursive. (invalid_radix_integer): Buffer overflow check. (read1, read_list, read_vector): Remove. (read_char_literal, read_string_literal) (hash_table_from_plist, record_from_list, vector_from_rev_list) (bytecode_from_rev_list, char_table_from_rev_list) (sub_char_table_from_rev_list, string_props_from_rev_list) (read_bool_vector, skip_lazy_string, symbol_char_span) (skip_space_and_comments) (enum read_entry_type, struct read_stack_entry, struct read_stack) (rdstack, mark_lread, read_stack_top, read_stack_pop) (read_stack_empty_p, grow_read_stack, read_stack_push): New. (read0): Rewrite to be nonrecursive. * test/src/lread-tests.el (lread-deeply-nested, lread-misc): New tests.
Diffstat (limited to 'lisp/emacs-lisp/cl-print.el')
0 files changed, 0 insertions, 0 deletions