/[gcl]/gcl/o/read.d
ViewVC logotype

Diff of /gcl/o/read.d

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by camm, Wed Feb 26 22:21:37 2003 UTC revision 1.15 by camm, Tue Jul 15 18:03:38 2003 UTC
# Line 392  too_long_token(void); Line 392  too_long_token(void);
392          Read_object(in) reads an object from stream in.          Read_object(in) reads an object from stream in.
393          This routine corresponds to COMMON Lisp function READ.          This routine corresponds to COMMON Lisp function READ.
394  */  */
395    
396    /* FIXME What should this be? Apparently no reliable way to use value stack */
397    #define MAX_PACKAGE_STACK 1024
398    static object P0[MAX_PACKAGE_STACK],*PP0=P0,LP;
399    
400  object  object
401  read_object(in)  read_object(in)
402  object in;  object in;
# Line 428  BEGIN: Line 433  BEGIN:
433          });          });
434                  a = cat(c);                  a = cat(c);
435          } while (a == cat_whitespace);          } while (a == cat_whitespace);
436            if (c->ch.ch_code == '(') { /* Loose package extension */
437              LP=LP || PP0==P0 ? LP : PP0[-1]; /* push loose packages into nested lists */
438              if (LP) {
439                if (PP0-P0>=MAX_PACKAGE_STACK)
440                  FEerror("Too many nested package specifiers",0);
441                *PP0++=LP;
442                LP=NULL;
443              }
444            } else if (LP)
445                FEerror("Loose package prefix must be followed by a list",0);
446            if (c->ch.ch_code==')' && PP0>P0) PP0--; /* regardless of error behavior,
447                                                        will pop stack to beginning as parens
448                                                        must match before the reader starts */
449          delimiting_char = vs_head;          delimiting_char = vs_head;
450          if (delimiting_char != OBJNULL && c == delimiting_char) {          if (delimiting_char != OBJNULL && c == delimiting_char) {
451                  delimiting_char = OBJNULL;                  delimiting_char = OBJNULL;
# Line 499  BEGIN: Line 517  BEGIN:
517                                  token_buffer[(tok_leng++,length++)] = char_code(c);                                  token_buffer[(tok_leng++,length++)] = char_code(c);
518                          }                          }
519                          goto K;                          goto K;
520                  } else if (a == cat_whitespace || a == cat_terminating)                  } else if (a == cat_terminating) {
521                          break;                          break;
522                    } else if (a == cat_whitespace) {
523                      /* skip all whitespace after trailing colon if no escape seen */
524                      if (colon+colon_type==length && !escape_flag)
525                        goto K;
526                      else
527                        break;
528                    }
529                  else if ('a' <= char_code(c) && char_code(c) <= 'z')                  else if ('a' <= char_code(c) && char_code(c) <= 'z')
530                          c = code_char(char_code(c) - ('a' - 'A'));                          c = code_char(char_code(c) - ('a' - 'A'));
531                  else if (char_code(c) == ':') {                  else if (char_code(c) == ':') {
# Line 587  SYMBOL: Line 612  SYMBOL:
612                  token->st.st_fillp = length - (colon + 2);                  token->st.st_fillp = length - (colon + 2);
613          } else          } else
614                  p = current_package();                  p = current_package();
615            /* loose package is an empty token following a non-beginning
616               colon with no escape, to allow for ||*/
617            if (!token->st.st_fillp && colon && !escape_flag) {
618              LP=p;
619              goto BEGIN;
620            }
621            /* unless package specified for this symbol, use loose package if present */
622            if (PP0>P0 && !colon_type)
623              p=PP0[-1];
624          vs_push(p);          vs_push(p);
625          x = intern(token, p);          x = intern(token, p);
626          vs_push(x);          vs_push(x);
# Line 2742  read_fasl_vector1(in) Line 2776  read_fasl_vector1(in)
2776  object in;  object in;
2777  {  {
2778          int dimcount, dim;          int dimcount, dim;
2779          object *vsp;                      object *vsp,vspo;
2780          VOL object x;          VOL object x;
2781          int i;          int i;
2782          bool e;          bool e;
# Line 2755  object in; Line 2789  object in;
2789                  old_sharp_eq_context[SHARP_EQ_CONTEXT_SIZE];                  old_sharp_eq_context[SHARP_EQ_CONTEXT_SIZE];
2790          int old_backq_level;          int old_backq_level;
2791    
2792          vsp=(object *)&vsp;          vsp=&vspo;
2793          old_READtable = READtable;          old_READtable = READtable;
2794          old_READdefault_float_format = READdefault_float_format;          old_READdefault_float_format = READdefault_float_format;
2795          old_READbase = READbase;          old_READbase = READbase;

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26