diff options
-rw-r--r-- | src/lread.c | 17 | ||||
-rw-r--r-- | src/print.c | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/lread.c b/src/lread.c index 882b09bf5a3..5b4cd3e748f 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1336,8 +1336,25 @@ read1 (readcharfun, pch, first_in_list) || XVECTOR (tmp)->size > CHAR_TABLE_STANDARD_SLOTS + 10) error ("Invalid size char-table"); XSETCHAR_TABLE (tmp, XCHAR_TABLE (tmp)); + XCHAR_TABLE (tmp)->top = Qt; return tmp; } + else if (c == '^') + { + c = READCHAR; + if (c == '[') + { + Lisp_Object tmp; + tmp = read_vector (readcharfun); + if (XVECTOR (tmp)->size != SUB_CHAR_TABLE_STANDARD_SLOTS) + error ("Invalid size char-table"); + XSETCHAR_TABLE (tmp, XCHAR_TABLE (tmp)); + XCHAR_TABLE (tmp)->top = Qnil; + return tmp; + } + Fsignal (Qinvalid_read_syntax, + Fcons (make_string ("#^^", 3), Qnil)); + } Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#^", 2), Qnil)); } if (c == '&') diff --git a/src/print.c b/src/print.c index 57f6ffdf826..8a218e88105 100644 --- a/src/print.c +++ b/src/print.c @@ -1258,6 +1258,8 @@ print (obj, printcharfun, escapeflag) character slots. But we add #^ as a prefix. */ PRINTCHAR ('#'); PRINTCHAR ('^'); + if (SUB_CHAR_TABLE_P (obj)) + PRINTCHAR ('^'); size &= PSEUDOVECTOR_SIZE_MASK; } if (size & PSEUDOVECTOR_FLAG) |