Mercurial > hg > xemacs-beta
diff src/lread.c @ 4990:8f0cf4fd3d2c
Automatic merge
| author | Ben Wing <ben@xemacs.org> |
|---|---|
| date | Sat, 06 Feb 2010 04:01:46 -0600 |
| parents | cbe181529c34 |
| children | 2ade80e8c640 |
line wrap: on
line diff
--- a/src/lread.c Sat Feb 06 03:59:18 2010 -0600 +++ b/src/lread.c Sat Feb 06 04:01:46 2010 -0600 @@ -1,7 +1,7 @@ /* Lisp parsing and input streams. Copyright (C) 1985-1989, 1992-1995 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems. - Copyright (C) 1996, 2001, 2002, 2003 Ben Wing. + Copyright (C) 1996, 2001, 2002, 2003, 2010 Ben Wing. This file is part of XEmacs. @@ -148,10 +148,6 @@ /* A resizing-buffer stream used to temporarily hold data while reading */ static Lisp_Object Vread_buffer_stream; -#ifdef COMPILED_FUNCTION_ANNOTATION_HACK -Lisp_Object Vcurrent_compiled_function_annotation; -#endif - static int load_byte_code_version; /* An array describing all known built-in structure types */ @@ -593,7 +589,7 @@ fd = locate_file (Vload_path, file, ((!NILP (nosuffix)) ? Qnil : - build_string (load_ignore_elc_files ? ".el:" : + build_ascstring (load_ignore_elc_files ? ".el:" : ".elc:.el:")), &found, -1); @@ -1097,7 +1093,7 @@ { /* We succeeded; return this descriptor and filename. */ if (closure->storeptr) - *closure->storeptr = build_intstring (fn); + *closure->storeptr = build_istring (fn); return 1; } @@ -1181,7 +1177,7 @@ locate_file_construct_suffixed_files_mapper (Ibyte *fn, void *arg) { Lisp_Object *tail = (Lisp_Object *) arg; - *tail = Fcons (build_intstring (fn), *tail); + *tail = Fcons (build_istring (fn), *tail); return 0; } @@ -1271,7 +1267,7 @@ /* Is it really necessary to gcpro path and str? It shouldn't be unless some caller has fucked up. There are known instances that - call us with build_string("foo:bar") as SUFFIXES, though. */ + call us with build_ascstring("foo:bar") as SUFFIXES, though. */ GCPRO4 (path, str, suffixes, suffixtab); /* if this filename has directory components, it's too complicated @@ -1451,9 +1447,6 @@ internal_bind_lisp_object (&Vcurrent_load_list, Qnil); -#ifdef COMPILED_FUNCTION_ANNOTATION_HACK - Vcurrent_compiled_function_annotation = Qnil; -#endif GCPRO2 (val, sourcename); LOADHIST_ATTACH (sourcename); @@ -1619,9 +1612,6 @@ Vread_objects = Qnil; -#ifdef COMPILED_FUNCTION_ANNOTATION_HACK - Vcurrent_compiled_function_annotation = Qnil; -#endif if (EQ (stream, Qread_char)) { Lisp_Object val = call1 (Qread_from_minibuffer, @@ -1648,9 +1638,6 @@ Lisp_Object lispstream = Qnil; struct gcpro gcpro1; -#ifdef COMPILED_FUNCTION_ANNOTATION_HACK - Vcurrent_compiled_function_annotation = Qnil; -#endif GCPRO1 (lispstream); CHECK_STRING (string); get_string_range_byte (string, start, end, &startval, &endval, @@ -1872,7 +1859,7 @@ else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10; else if (c >= 'A' && c <= 'F') i = (i << 4) + (c - 'A') + 10; - args[0] = build_string ("?\\x%x"); + args[0] = build_ascstring ("?\\x%x"); args[1] = make_int (i); syntax_error ("Overlong hex character escape", Fformat (2, args)); @@ -2129,7 +2116,7 @@ Dynarr_add (dyn, bit); } - val = make_bit_vector_from_byte_vector (Dynarr_atp (dyn, 0), + val = make_bit_vector_from_byte_vector (Dynarr_begin (dyn), Dynarr_length (dyn)); Dynarr_free (dyn); @@ -2394,34 +2381,36 @@ Ichar c; Ichar permit_unicode = 0; - do { - c = reader_nextchar(readcharfun); - switch (c) { - /* #r:engine"my sexy raw string" -- raw string w/ flags*/ - /* case ':': */ - /* #ru"Hi there\u20AC \U000020AC" -- raw string, honouring Unicode. */ - case 'u': - case 'U': - permit_unicode = c; - continue; - - /* #r"my raw string" -- raw string */ - case '\"': - return read_string(readcharfun, '\"', 1, permit_unicode); - /* invalid syntax */ - default: - { - if (permit_unicode) + do + { + c = reader_nextchar (readcharfun); + switch (c) + { + /* #r:engine"my sexy raw string" -- raw string w/ flags*/ + /* case ':': */ + /* #ru"Hi there\u20AC \U000020AC" -- raw string, honouring Unicode. */ + case 'u': + case 'U': + permit_unicode = c; + continue; + + /* #r"my raw string" -- raw string */ + case '\"': + return read_string (readcharfun, '\"', 1, permit_unicode); + /* invalid syntax */ + default: { - unreadchar(readcharfun, permit_unicode); + if (permit_unicode) + { + unreadchar (readcharfun, permit_unicode); + } + unreadchar (readcharfun, c); + return Fsignal (Qinvalid_read_syntax, + list1 (build_msg_string + ("unrecognized raw string syntax"))); } - unreadchar(readcharfun, c); - return Fsignal(Qinvalid_read_syntax, - list1(build_string - ("unrecognized raw string syntax"))); - } - } - } while (1); + } + } while (1); } /* Read the next Lisp object from the stream READCHARFUN and return it. @@ -2580,7 +2569,7 @@ if (CONSP (tmp) && UNBOUNDP (XCAR (tmp))) free_cons (tmp); return Fsignal (Qinvalid_read_syntax, - list1 (build_string ("#"))); + list1 (build_ascstring ("#"))); } GCPRO1 (tmp); /* Read the intervals and their properties. */ @@ -2738,13 +2727,13 @@ make_int (n))); } return Fsignal (Qinvalid_read_syntax, - list1 (build_string ("#"))); + list1 (build_ascstring ("#"))); } default: { unreadchar (readcharfun, c); return Fsignal (Qinvalid_read_syntax, - list1 (build_string ("#"))); + list1 (build_ascstring ("#"))); } } } @@ -3009,16 +2998,6 @@ } } -#ifdef COMPILED_FUNCTION_ANNOTATION_HACK - if (s->length == 1 && s->allow_dotted_lists && EQ (XCAR (s->head), Qfset)) - { - if (CONSP (elt) && EQ (XCAR (elt), Qquote) && CONSP (XCDR (elt))) - Vcurrent_compiled_function_annotation = XCAR (XCDR (elt)); - else - Vcurrent_compiled_function_annotation = elt; - } -#endif - elt = Fcons (elt, Qnil); if (!NILP (s->tail)) XCDR (s->tail) = elt; @@ -3054,10 +3033,6 @@ { struct read_list_state s; struct gcpro gcpro1, gcpro2; -#ifdef COMPILED_FUNCTION_ANNOTATION_HACK - Lisp_Object old_compiled_function_annotation = - Vcurrent_compiled_function_annotation; -#endif s.head = Qnil; s.tail = Qnil; @@ -3067,9 +3042,6 @@ GCPRO2 (s.head, s.tail); sequence_reader (readcharfun, terminator, &s, read_list_conser); -#ifdef COMPILED_FUNCTION_ANNOTATION_HACK - Vcurrent_compiled_function_annotation = old_compiled_function_annotation; -#endif if ((purify_flag || load_force_doc_strings) && check_for_doc_references) { @@ -3120,7 +3092,7 @@ because that would make the directory absolute now. */ XCAR (XCAR (holding_cons)) = - concat2 (build_string ("../lisp/"), + concat2 (build_ascstring ("../lisp/"), Ffile_name_nondirectory (Vload_file_name_internal)); } @@ -3214,7 +3186,7 @@ make_byte_code_args[iii] = Qzero; else XCAR (make_byte_code_args[iii]) = - concat2 (build_string ("../lisp/"), + concat2 (build_ascstring ("../lisp/"), Ffile_name_nondirectory (Vload_file_name_internal)); } @@ -3255,7 +3227,7 @@ /* kludge: locate-file does not work for a null load-path, even if the file name is absolute. */ - Vload_path = Fcons (build_string (""), Qnil); + Vload_path = Fcons (build_ascstring (""), Qnil); /* This used to get initialized in init_lread because all streams got closed when dumping occurs. This is no longer true -- @@ -3405,7 +3377,7 @@ complex dependencies. Ignoring all elc files with `load-ignore-elc-files' would also be safe, but much slower. */ ); - load_ignore_out_of_date_elc_files = 0; + load_ignore_out_of_date_elc_files = 1; DEFVAR_BOOL ("load-always-display-messages", &load_always_display_messages /* @@ -3477,11 +3449,6 @@ Vload_file_name_internal = Qnil; staticpro (&Vload_file_name_internal); -#ifdef COMPILED_FUNCTION_ANNOTATION_HACK - Vcurrent_compiled_function_annotation = Qnil; - staticpro (&Vcurrent_compiled_function_annotation); -#endif - /* So that early-early stuff will work */ Ffset (Qload, Qload_internal);
