aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lread.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/lread.c b/src/lread.c
index 8a85d84159e..f281c92abab 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1180,6 +1180,46 @@ read1 (readcharfun, pch, first_in_list)
1180 1180
1181 case '#': 1181 case '#':
1182 c = READCHAR; 1182 c = READCHAR;
1183 if (c == '^')
1184 {
1185 c = READCHAR;
1186 if (c == '[')
1187 {
1188 Lisp_Object tmp;
1189 tmp = read_vector (readcharfun);
1190 if (XVECTOR (tmp)->size < CHAR_TABLE_STANDARD_SLOTS
1191 || XVECTOR (tmp)->size > CHAR_TABLE_STANDARD_SLOTS + 10)
1192 error ("Invalid size char-table");
1193 XSETCHAR_TABLE (tmp, XCHAR_TABLE (tmp));
1194 return tmp;
1195 }
1196 Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#^", 2), Qnil));
1197 }
1198 if (c == '&')
1199 {
1200 Lisp_Object length;
1201 length = read1 (readcharfun, pch, first_in_list);
1202 c = READCHAR;
1203 if (c == '"')
1204 {
1205 Lisp_Object tmp, val;
1206 int bits_per_char = INTBITS / sizeof (int);
1207 int size_in_chars = ((XFASTINT (length) + bits_per_char)
1208 / bits_per_char);
1209
1210 UNREAD (c);
1211 tmp = read1 (readcharfun, pch, first_in_list);
1212 if (size_in_chars != XSTRING (tmp)->size)
1213 Fsignal (Qinvalid_read_syntax,
1214 Fcons (make_string ("#&", 2), Qnil));
1215
1216 val = Fmake_bool_vector (length, Qnil);
1217 bcopy (XSTRING (tmp)->data, XBOOL_VECTOR (val)->data,
1218 size_in_chars);
1219 return val;
1220 }
1221 Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#&", 2), Qnil));
1222 }
1183 if (c == '[') 1223 if (c == '[')
1184 { 1224 {
1185 /* Accept compiled functions at read-time so that we don't have to 1225 /* Accept compiled functions at read-time so that we don't have to