Mercurial > hg > xemacs-beta
comparison src/lread.c @ 140:585fb297b004 r20-2b4
Import from CVS: tag r20-2b4
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:32:43 +0200 |
parents | 7d55a9ba150c |
children | 1856695b1fa9 |
comparison
equal
deleted
inserted
replaced
139:2b5203979d01 | 140:585fb297b004 |
---|---|
70 Lisp_Object Qload, Qload_file_name; | 70 Lisp_Object Qload, Qload_file_name; |
71 Lisp_Object Qlocate_file_hash_table; | 71 Lisp_Object Qlocate_file_hash_table; |
72 Lisp_Object Qfset; | 72 Lisp_Object Qfset; |
73 | 73 |
74 int puke_on_fsf_keys; | 74 int puke_on_fsf_keys; |
75 | |
76 /* This symbol is also used in fns.c */ | |
77 #define FEATUREP_SYNTAX | |
78 | |
79 #ifdef FEATUREP_SYNTAX | |
80 static Lisp_Object Qfeaturep; | |
81 #endif | |
75 | 82 |
76 /* non-zero if inside `load' */ | 83 /* non-zero if inside `load' */ |
77 int load_in_progress; | 84 int load_in_progress; |
78 | 85 |
79 /* Whether Fload_internal() should check whether the .el is newer | 86 /* Whether Fload_internal() should check whether the .el is newer |
2367 { | 2374 { |
2368 unreadchar (readcharfun, c); | 2375 unreadchar (readcharfun, c); |
2369 return Fsignal (Qinvalid_read_syntax, | 2376 return Fsignal (Qinvalid_read_syntax, |
2370 list1 (build_string ("Cannot read unreadable object"))); | 2377 list1 (build_string ("Cannot read unreadable object"))); |
2371 } | 2378 } |
2372 | 2379 #ifdef FEATUREP_SYNTAX |
2380 case '+': | |
2381 case '-': | |
2382 { | |
2383 Lisp_Object fexp, obj, tem; | |
2384 struct gcpro gcpro1, gcpro2; | |
2385 | |
2386 fexp = read0(readcharfun); | |
2387 obj = read0(readcharfun); | |
2388 | |
2389 /* the call to `featurep' may GC. */ | |
2390 GCPRO2(fexp, obj); | |
2391 tem = call1(Qfeaturep, fexp); | |
2392 UNGCPRO; | |
2393 | |
2394 if (c == '+' && NILP(tem)) goto retry; | |
2395 if (c == '-' && !NILP(tem)) goto retry; | |
2396 return obj; | |
2397 } | |
2398 #endif | |
2373 default: | 2399 default: |
2374 { | 2400 { |
2375 unreadchar (readcharfun, c); | 2401 unreadchar (readcharfun, c); |
2376 return Fsignal (Qinvalid_read_syntax, | 2402 return Fsignal (Qinvalid_read_syntax, |
2377 list1 (build_string ("#"))); | 2403 list1 (build_string ("#"))); |
2581 | 2607 |
2582 if (ch == terminator) | 2608 if (ch == terminator) |
2583 return (state); | 2609 return (state); |
2584 else | 2610 else |
2585 unreadchar (readcharfun, ch); | 2611 unreadchar (readcharfun, ch); |
2612 #ifdef FEATUREP_SYNTAX | |
2586 if (ch == ']') | 2613 if (ch == ']') |
2587 syntax_error ("\"]\" in a list"); | 2614 syntax_error ("\"]\" in a list"); |
2588 else if (ch == ')') | 2615 else if (ch == ')') |
2589 syntax_error ("\")\" in a vector"); | 2616 syntax_error ("\")\" in a vector"); |
2617 #endif | |
2590 state = ((conser) (readcharfun, state, len)); | 2618 state = ((conser) (readcharfun, state, len)); |
2591 } | 2619 } |
2592 } | 2620 } |
2593 | 2621 |
2594 | 2622 |
2616 | 2644 |
2617 elt = XCDR (elt); | 2645 elt = XCDR (elt); |
2618 free_cons (XCONS (tem)); | 2646 free_cons (XCONS (tem)); |
2619 tem = Qnil; | 2647 tem = Qnil; |
2620 ch = XCHAR (elt); | 2648 ch = XCHAR (elt); |
2649 #ifdef FEATUREP_SYNTAX | |
2650 if (ch == s->terminator) /* deal with #+, #- reader macros */ | |
2651 { | |
2652 unreadchar (readcharfun, s->terminator); | |
2653 goto done; | |
2654 } | |
2655 else if (ch == ']') | |
2656 syntax_error ("']' in a list"); | |
2657 else if (ch == ')') | |
2658 syntax_error ("')' in a vector"); | |
2659 else | |
2660 #endif | |
2621 if (ch != '.') | 2661 if (ch != '.') |
2622 signal_simple_error ("BUG! Internal reader error", elt); | 2662 signal_simple_error ("BUG! Internal reader error", elt); |
2623 else if (!s->allow_dotted_lists) | 2663 else if (!s->allow_dotted_lists) |
2624 syntax_error ("\".\" in a vector"); | 2664 syntax_error ("\".\" in a vector"); |
2625 else | 2665 else |
3128 #endif | 3168 #endif |
3129 | 3169 |
3130 /* So that early-early stuff will work */ | 3170 /* So that early-early stuff will work */ |
3131 Ffset (Qload, intern ("load-internal")); | 3171 Ffset (Qload, intern ("load-internal")); |
3132 | 3172 |
3173 #ifdef FEATUREP_SYNTAX | |
3174 Qfeaturep = intern("featurep"); | |
3175 staticpro(&Qfeaturep); | |
3176 Fprovide(intern("xemacs")); | |
3177 #endif | |
3178 | |
3133 #ifdef LISP_BACKQUOTES | 3179 #ifdef LISP_BACKQUOTES |
3134 old_backquote_flag = new_backquote_flag = 0; | 3180 old_backquote_flag = new_backquote_flag = 0; |
3135 #endif | 3181 #endif |
3136 | 3182 |
3137 #ifdef I18N3 | 3183 #ifdef I18N3 |