comparison src/lread.c @ 50:ee648375d8d6 r19-16b91

Import from CVS: tag r19-16b91
author cvs
date Mon, 13 Aug 2007 08:56:41 +0200
parents 56c54cf7c5b6
children 131b0175ea99
comparison
equal deleted inserted replaced
49:b46643e427ac 50:ee648375d8d6
67 Lisp_Object Qload, Qload_file_name; 67 Lisp_Object Qload, Qload_file_name;
68 Lisp_Object Qlocate_file_hash_table; 68 Lisp_Object Qlocate_file_hash_table;
69 Lisp_Object Qfset; 69 Lisp_Object Qfset;
70 70
71 int puke_on_fsf_keys; 71 int puke_on_fsf_keys;
72
73 /* This symbol is also used in fns.c */
74 #define FEATUREP_SYNTAX
75
76 #ifdef FEATUREP_SYNTAX
77 static Lisp_Object Qfeaturep;
78 #endif
72 79
73 /* non-zero if inside `load' */ 80 /* non-zero if inside `load' */
74 int load_in_progress; 81 int load_in_progress;
75 82
76 /* Whether Fload_internal() should check whether the .el is newer 83 /* Whether Fload_internal() should check whether the .el is newer
2263 { 2270 {
2264 unreadchar (readcharfun, c); 2271 unreadchar (readcharfun, c);
2265 return Fsignal (Qinvalid_read_syntax, 2272 return Fsignal (Qinvalid_read_syntax,
2266 list1 (build_string ("Cannot read unreadable object"))); 2273 list1 (build_string ("Cannot read unreadable object")));
2267 } 2274 }
2275 #ifdef FEATUREP_SYNTAX
2276 case '+':
2277 case '-':
2278 {
2279 Lisp_Object fexp, obj, tem;
2280 struct gcpro gcpro1, gcpro2;
2281
2282 fexp = read0(readcharfun);
2283 obj = read0(readcharfun);
2284
2285 /* the call to `featurep' may GC. */
2286 GCPRO2(fexp, obj);
2287 tem = call1(Qfeaturep, fexp);
2288 UNGCPRO;
2289
2290 if (c == '+' && NILP(tem)) goto retry;
2291 if (c == '-' && !NILP(tem)) goto retry;
2292 return obj;
2293 }
2294 #endif
2268 2295
2269 default: 2296 default:
2270 { 2297 {
2271 unreadchar (readcharfun, c); 2298 unreadchar (readcharfun, c);
2272 return Fsignal (Qinvalid_read_syntax, 2299 return Fsignal (Qinvalid_read_syntax,
2477 2504
2478 if (ch == terminator) 2505 if (ch == terminator)
2479 return (state); 2506 return (state);
2480 else 2507 else
2481 unreadchar (readcharfun, ch); 2508 unreadchar (readcharfun, ch);
2509 #ifdef FEATUREP_SYNTAX
2482 if (ch == ']') 2510 if (ch == ']')
2483 syntax_error ("\"]\" in a list"); 2511 syntax_error ("\"]\" in a list");
2484 else if (ch == ')') 2512 else if (ch == ')')
2485 syntax_error ("\")\" in a vector"); 2513 syntax_error ("\")\" in a vector");
2514 #endif
2486 state = ((conser) (readcharfun, state, len)); 2515 state = ((conser) (readcharfun, state, len));
2487 } 2516 }
2488 } 2517 }
2489 2518
2490 2519
2512 2541
2513 elt = XCDR (elt); 2542 elt = XCDR (elt);
2514 free_cons (XCONS (tem)); 2543 free_cons (XCONS (tem));
2515 tem = Qnil; 2544 tem = Qnil;
2516 ch = XCHAR (elt); 2545 ch = XCHAR (elt);
2546 #ifdef FEATUREP_SYNTAX
2547 if (ch == s->terminator) /* deal with #+, #- reader macros */
2548 {
2549 unreadchar (readcharfun, s->terminator);
2550 goto done;
2551 }
2552 else if (ch == ']')
2553 syntax_error ("']' in a list");
2554 else if (ch == ')')
2555 syntax_error ("')' in a vector");
2556 else
2557 #endif
2517 if (ch != '.') 2558 if (ch != '.')
2518 signal_simple_error ("BUG! Internal reader error", elt); 2559 signal_simple_error ("BUG! Internal reader error", elt);
2519 else if (!s->allow_dotted_lists) 2560 else if (!s->allow_dotted_lists)
2520 syntax_error ("\".\" in a vector"); 2561 syntax_error ("\".\" in a vector");
2521 else 2562 else
3019 #endif 3060 #endif
3020 3061
3021 /* So that early-early stuff will work */ 3062 /* So that early-early stuff will work */
3022 Ffset (Qload, intern ("load-internal")); 3063 Ffset (Qload, intern ("load-internal"));
3023 3064
3065 #ifdef FEATUREP_SYNTAX
3066 Qfeaturep = intern("featurep");
3067 staticpro(&Qfeaturep);
3068 Fprovide(intern("xemacs"));
3069 #endif
3024 #ifdef LISP_BACKQUOTES 3070 #ifdef LISP_BACKQUOTES
3025 old_backquote_flag = new_backquote_flag = 0; 3071 old_backquote_flag = new_backquote_flag = 0;
3026 #endif 3072 #endif
3027 3073
3028 #ifdef I18N3 3074 #ifdef I18N3