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

Diff of /gcl/o/print.d

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

revision 1.28 by camm, Wed Oct 12 14:40:17 2005 UTC revision 1.29 by camm, Thu Oct 13 21:27:07 2005 UTC
# Line 698  constant_case(object x) { Line 698  constant_case(object x) {
698  }  }
699            
700  static int  static int
701    all_dots(object x) {
702      
703      fixnum i;
704    
705      for (i=0;i<x->s.s_fillp && x->s.s_self[i]=='.';i++);
706      
707      return i==x->s.s_fillp;
708    
709    }
710    
711    static int
712  needs_escape (object x) {  needs_escape (object x) {
713    
714    fixnum i;    fixnum i;
715    
716    if (x->s.s_fillp && *x->s.s_self==' ')  /*   if (x->s.s_fillp && *x->s.s_self==' ') */
717      return 1;  /*     return 1; */
718    
719    for (i=0;i<x->s.s_fillp;i++)    for (i=0;i<x->s.s_fillp;i++)
720      switch(x->s.s_self[i]) {      switch(x->s.s_self[i]) {
721        case ' ':
722      case '(':      case '(':
723      case ')':      case ')':
724      case ':':      case ':':
# Line 721  needs_escape (object x) { Line 733  needs_escape (object x) {
733        break;        break;
734      }      }
735    
736    if (!PRINTescape)    if (READ_TABLE_CASE==sKupcase || PRINTreadably) {
     return 0;  
   if (READ_TABLE_CASE==sKupcase) {  
737      for (i=0;i<x->s.s_fillp;i++)      for (i=0;i<x->s.s_fillp;i++)
738        if (isLower(x->s.s_self[i]))        if (isLower(x->s.s_self[i]))
739          return 1;          return 1;
740    } else if (READ_TABLE_CASE==sKdowncase) {    } else if (READ_TABLE_CASE==sKdowncase) {
741      for (i=0;i<x->s.s_fillp;i++)      for (i=0;i<x->s.s_fillp;i++)
742        if (isUpper(x->s.s_self[i]))        if (isUpper(x->s.s_self[i]))
743          return 1;          return 1;
744    }    }
745    
746    return !x->s.s_fillp;    if (potential_number_p(x, PRINTbase)||all_dots(x))
747        return 1;
 }  
   
 static int  
 all_dots(object x) {  
     
   fixnum i;  
748    
749    for (i=0;i<x->s.s_fillp && x->s.s_self[i]=='.';i++);    return !x->s.s_fillp;
     
   return i==x->s.s_fillp;  
750    
751  }  }
752    
# Line 758  print_symbol_name_body(object x,int pp) Line 760  print_symbol_name_body(object x,int pp)
760    
761    cc=constant_case(x);    cc=constant_case(x);
762    k=needs_escape(x);    k=needs_escape(x);
763    pp=pp && (potential_number_p(x, PRINTbase)||all_dots(x)) ? 0 : 1;    k=PRINTescape ? k : 0;
764    pp=k ? 0 : pp;    pp=k*pp ? 0 : 1;
765    
766    
767    if (k)    if (k)
768      write_ch('|');      write_ch('|');
# Line 997  int level; Line 1000  int level;
1000            {            {
1001    
1002              if (PRINTescape) {              if (PRINTescape) {
1003                if (x->s.s_hpack == Cnil) {                if (x->s.s_hpack == Cnil || x->s.s_hpack->p.p_name == Cnil) { /*FIXME???*/
1004                  if (PRINTcircle) {                  if (PRINTcircle) {
1005                    for (vp = PRINTvs_top;  vp < PRINTvs_limit;  vp += 2)                    for (vp = PRINTvs_top;  vp < PRINTvs_limit;  vp += 2)
1006                      if (x == *vp) {                      if (x == *vp) {

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

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