Rename pr.opts.pretty into pr.opts.indent

This commit is contained in:
Lassi Kortela 2019-08-25 17:29:18 +03:00
parent fe4b63b9a3
commit 844b2e219c
1 changed files with 5 additions and 8 deletions

View File

@ -1,12 +1,8 @@
extern void *memrchr(const void *s, int c, size_t n); extern void *memrchr(const void *s, int c, size_t n);
struct printer_options { struct printer_options {
int display; // Use `display` repr instead of `write` repr int display; // Use `display` repr instead of `write` repr
int indent; // Write indented lines instead of one long line.
// *print-pretty* -- indent instead of printing everything on one
// *long line
int pretty;
// *print-width* -- maximum line length when indenting, ignored when not // *print-width* -- maximum line length when indenting, ignored when not
int width; int width;
@ -332,7 +328,7 @@ static void print_pair(struct ios *f, value_t v)
break; break;
} }
if (!pr.opts.pretty || ((head == LAMBDA) && n == 0)) { if (!pr.opts.indent || ((head == LAMBDA) && n == 0)) {
// never break line before lambda-list // never break line before lambda-list
ind = 0; ind = 0;
} else { } else {
@ -494,7 +490,7 @@ void fl_print_child(struct ios *f, value_t v)
} }
fl_print_child(f, vector_elt(v, i)); fl_print_child(f, vector_elt(v, i));
if (i < sz - 1) { if (i < sz - 1) {
if (!pr.opts.pretty) { if (!pr.opts.indent) {
outc(' ', f); outc(' ', f);
} else { } else {
est = lengthestimate(vector_elt(v, i + 1)); est = lengthestimate(vector_elt(v, i + 1));
@ -899,7 +895,8 @@ void fl_print(struct ios *f, value_t v)
// *print-readably* // *print-readably*
opts.display = (symbol_value(printreadablysym) == FL_F); opts.display = (symbol_value(printreadablysym) == FL_F);
opts.pretty = (symbol_value(printprettysym) != FL_F); // *print-pretty*
opts.indent = (symbol_value(printprettysym) != FL_F);
pl = symbol_value(printlengthsym); pl = symbol_value(printlengthsym);
if (isfixnum(pl)) if (isfixnum(pl))