Mercurial > hg > xemacs-beta
comparison src/lread.c @ 4969:cbe181529c34
Automatic merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Wed, 03 Feb 2010 21:46:21 -0600 |
parents | 0d4c9d0f6a8d 8ee3c10d1ed5 |
children | 2ade80e8c640 |
comparison
equal
deleted
inserted
replaced
4968:4d35e52790f8 | 4969:cbe181529c34 |
---|---|
1 /* Lisp parsing and input streams. | 1 /* Lisp parsing and input streams. |
2 Copyright (C) 1985-1989, 1992-1995 Free Software Foundation, Inc. | 2 Copyright (C) 1985-1989, 1992-1995 Free Software Foundation, Inc. |
3 Copyright (C) 1995 Tinker Systems. | 3 Copyright (C) 1995 Tinker Systems. |
4 Copyright (C) 1996, 2001, 2002, 2003 Ben Wing. | 4 Copyright (C) 1996, 2001, 2002, 2003, 2010 Ben Wing. |
5 | 5 |
6 This file is part of XEmacs. | 6 This file is part of XEmacs. |
7 | 7 |
8 XEmacs is free software; you can redistribute it and/or modify it | 8 XEmacs is free software; you can redistribute it and/or modify it |
9 under the terms of the GNU General Public License as published by the | 9 under the terms of the GNU General Public License as published by the |
145 problems with recursive loading. */ | 145 problems with recursive loading. */ |
146 static Lisp_Object Vload_force_doc_string_list; | 146 static Lisp_Object Vload_force_doc_string_list; |
147 | 147 |
148 /* A resizing-buffer stream used to temporarily hold data while reading */ | 148 /* A resizing-buffer stream used to temporarily hold data while reading */ |
149 static Lisp_Object Vread_buffer_stream; | 149 static Lisp_Object Vread_buffer_stream; |
150 | |
151 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK | |
152 Lisp_Object Vcurrent_compiled_function_annotation; | |
153 #endif | |
154 | 150 |
155 static int load_byte_code_version; | 151 static int load_byte_code_version; |
156 | 152 |
157 /* An array describing all known built-in structure types */ | 153 /* An array describing all known built-in structure types */ |
158 static structure_type_dynarr *the_structure_type_dynarr; | 154 static structure_type_dynarr *the_structure_type_dynarr; |
1449 READCHARFUN (which can be a stream) to Lisp. --hniksic */ | 1445 READCHARFUN (which can be a stream) to Lisp. --hniksic */ |
1450 /*specbind (Qstandard_input, readcharfun);*/ | 1446 /*specbind (Qstandard_input, readcharfun);*/ |
1451 | 1447 |
1452 internal_bind_lisp_object (&Vcurrent_load_list, Qnil); | 1448 internal_bind_lisp_object (&Vcurrent_load_list, Qnil); |
1453 | 1449 |
1454 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK | |
1455 Vcurrent_compiled_function_annotation = Qnil; | |
1456 #endif | |
1457 GCPRO2 (val, sourcename); | 1450 GCPRO2 (val, sourcename); |
1458 | 1451 |
1459 LOADHIST_ATTACH (sourcename); | 1452 LOADHIST_ATTACH (sourcename); |
1460 | 1453 |
1461 while (1) | 1454 while (1) |
1617 if (EQ (stream, Qt)) | 1610 if (EQ (stream, Qt)) |
1618 stream = Qread_char; | 1611 stream = Qread_char; |
1619 | 1612 |
1620 Vread_objects = Qnil; | 1613 Vread_objects = Qnil; |
1621 | 1614 |
1622 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK | |
1623 Vcurrent_compiled_function_annotation = Qnil; | |
1624 #endif | |
1625 if (EQ (stream, Qread_char)) | 1615 if (EQ (stream, Qread_char)) |
1626 { | 1616 { |
1627 Lisp_Object val = call1 (Qread_from_minibuffer, | 1617 Lisp_Object val = call1 (Qread_from_minibuffer, |
1628 build_msg_string ("Lisp expression: ")); | 1618 build_msg_string ("Lisp expression: ")); |
1629 return Fcar (Fread_from_string (val, Qnil, Qnil)); | 1619 return Fcar (Fread_from_string (val, Qnil, Qnil)); |
1646 Bytecount startval, endval; | 1636 Bytecount startval, endval; |
1647 Lisp_Object tem; | 1637 Lisp_Object tem; |
1648 Lisp_Object lispstream = Qnil; | 1638 Lisp_Object lispstream = Qnil; |
1649 struct gcpro gcpro1; | 1639 struct gcpro gcpro1; |
1650 | 1640 |
1651 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK | |
1652 Vcurrent_compiled_function_annotation = Qnil; | |
1653 #endif | |
1654 GCPRO1 (lispstream); | 1641 GCPRO1 (lispstream); |
1655 CHECK_STRING (string); | 1642 CHECK_STRING (string); |
1656 get_string_range_byte (string, start, end, &startval, &endval, | 1643 get_string_range_byte (string, start, end, &startval, &endval, |
1657 GB_HISTORICAL_STRING_BEHAVIOR); | 1644 GB_HISTORICAL_STRING_BEHAVIOR); |
1658 lispstream = make_lisp_string_input_stream (string, startval, | 1645 lispstream = make_lisp_string_input_stream (string, startval, |
3009 } | 2996 } |
3010 read_syntax_error (". in wrong context"); | 2997 read_syntax_error (". in wrong context"); |
3011 } | 2998 } |
3012 } | 2999 } |
3013 | 3000 |
3014 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK | |
3015 if (s->length == 1 && s->allow_dotted_lists && EQ (XCAR (s->head), Qfset)) | |
3016 { | |
3017 if (CONSP (elt) && EQ (XCAR (elt), Qquote) && CONSP (XCDR (elt))) | |
3018 Vcurrent_compiled_function_annotation = XCAR (XCDR (elt)); | |
3019 else | |
3020 Vcurrent_compiled_function_annotation = elt; | |
3021 } | |
3022 #endif | |
3023 | |
3024 elt = Fcons (elt, Qnil); | 3001 elt = Fcons (elt, Qnil); |
3025 if (!NILP (s->tail)) | 3002 if (!NILP (s->tail)) |
3026 XCDR (s->tail) = elt; | 3003 XCDR (s->tail) = elt; |
3027 else | 3004 else |
3028 s->head = elt; | 3005 s->head = elt; |
3054 int allow_dotted_lists, | 3031 int allow_dotted_lists, |
3055 int check_for_doc_references) | 3032 int check_for_doc_references) |
3056 { | 3033 { |
3057 struct read_list_state s; | 3034 struct read_list_state s; |
3058 struct gcpro gcpro1, gcpro2; | 3035 struct gcpro gcpro1, gcpro2; |
3059 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK | |
3060 Lisp_Object old_compiled_function_annotation = | |
3061 Vcurrent_compiled_function_annotation; | |
3062 #endif | |
3063 | 3036 |
3064 s.head = Qnil; | 3037 s.head = Qnil; |
3065 s.tail = Qnil; | 3038 s.tail = Qnil; |
3066 s.length = 0; | 3039 s.length = 0; |
3067 s.allow_dotted_lists = allow_dotted_lists; | 3040 s.allow_dotted_lists = allow_dotted_lists; |
3068 s.terminator = terminator; | 3041 s.terminator = terminator; |
3069 GCPRO2 (s.head, s.tail); | 3042 GCPRO2 (s.head, s.tail); |
3070 | 3043 |
3071 sequence_reader (readcharfun, terminator, &s, read_list_conser); | 3044 sequence_reader (readcharfun, terminator, &s, read_list_conser); |
3072 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK | |
3073 Vcurrent_compiled_function_annotation = old_compiled_function_annotation; | |
3074 #endif | |
3075 | 3045 |
3076 if ((purify_flag || load_force_doc_strings) && check_for_doc_references) | 3046 if ((purify_flag || load_force_doc_strings) && check_for_doc_references) |
3077 { | 3047 { |
3078 /* check now for any doc string references and record them | 3048 /* check now for any doc string references and record them |
3079 for later. */ | 3049 for later. */ |
3477 staticpro (&Vload_force_doc_string_list); | 3447 staticpro (&Vload_force_doc_string_list); |
3478 | 3448 |
3479 Vload_file_name_internal = Qnil; | 3449 Vload_file_name_internal = Qnil; |
3480 staticpro (&Vload_file_name_internal); | 3450 staticpro (&Vload_file_name_internal); |
3481 | 3451 |
3482 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK | |
3483 Vcurrent_compiled_function_annotation = Qnil; | |
3484 staticpro (&Vcurrent_compiled_function_annotation); | |
3485 #endif | |
3486 | |
3487 /* So that early-early stuff will work */ | 3452 /* So that early-early stuff will work */ |
3488 Ffset (Qload, Qload_internal); | 3453 Ffset (Qload, Qload_internal); |
3489 | 3454 |
3490 #ifdef FEATUREP_SYNTAX | 3455 #ifdef FEATUREP_SYNTAX |
3491 DEFSYMBOL (Qfeaturep); | 3456 DEFSYMBOL (Qfeaturep); |