some printing improvements
This commit is contained in:
		
							parent
							
								
									fdfaacfbe5
								
							
						
					
					
						commit
						e2b7652e36
					
				| 
						 | 
					@ -360,6 +360,7 @@ void fl_print_child(ios_t *f, value_t v, int princ)
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (isbuiltin(v)) {
 | 
					        if (isbuiltin(v)) {
 | 
				
			||||||
 | 
					            if (!princ)
 | 
				
			||||||
                outs("#.", f);
 | 
					                outs("#.", f);
 | 
				
			||||||
            outs(builtin_names[uintval(v)], f);
 | 
					            outs(builtin_names[uintval(v)], f);
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
| 
						 | 
					@ -370,6 +371,9 @@ void fl_print_child(ios_t *f, value_t v, int princ)
 | 
				
			||||||
                               (unsigned long)(builtin_t)ptr(v));
 | 
					                               (unsigned long)(builtin_t)ptr(v));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
 | 
					            if (princ)
 | 
				
			||||||
 | 
					                outs(symbol_name(label), f);
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
                HPOS += ios_printf(f, "#builtin(%s)", symbol_name(label));
 | 
					                HPOS += ios_printf(f, "#builtin(%s)", symbol_name(label));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
| 
						 | 
					@ -534,12 +538,9 @@ static void cvalue_printdata(ios_t *f, void *data, size_t len, value_t type,
 | 
				
			||||||
            snprint_real(buf, sizeof(buf), d, 0, ndec, 3, 10);
 | 
					            snprint_real(buf, sizeof(buf), d, 0, ndec, 3, 10);
 | 
				
			||||||
            int hasdec = (strpbrk(buf, ".eE") != NULL);
 | 
					            int hasdec = (strpbrk(buf, ".eE") != NULL);
 | 
				
			||||||
            outs(buf, f);
 | 
					            outs(buf, f);
 | 
				
			||||||
            if (weak || princ || hasdec) {
 | 
					 | 
				
			||||||
                if (type == floatsym) outc('f', f);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else {
 | 
					 | 
				
			||||||
            if (!hasdec) outs(".0", f);
 | 
					            if (!hasdec) outs(".0", f);
 | 
				
			||||||
                if (type==floatsym) outc('f', f);
 | 
					            if (!princ && !weak) {
 | 
				
			||||||
 | 
					                if (type == floatsym) outc('f', f);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -146,7 +146,7 @@ value_t fl_string(value_t *args, u_int32_t nargs)
 | 
				
			||||||
            sz += cv_len((cvalue_t*)ptr(cv));
 | 
					            sz += cv_len((cvalue_t*)ptr(cv));
 | 
				
			||||||
            continue;
 | 
					            continue;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        args[i] = print_to_string(args[i], iscprim(args[i]));
 | 
					        args[i] = print_to_string(args[i], iscprim(args[i])||isbuiltinish(args[i]));
 | 
				
			||||||
        if (nargs == 1)  // convert single value to string
 | 
					        if (nargs == 1)  // convert single value to string
 | 
				
			||||||
            return args[i];
 | 
					            return args[i];
 | 
				
			||||||
        sz += cv_len((cvalue_t*)ptr(args[i]));
 | 
					        sz += cv_len((cvalue_t*)ptr(args[i]));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue