From 6f605f81411d83e3917e512e5fd93043901c7e0d Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 13 Mar 2021 17:43:19 -0600 Subject: [PATCH] Update pretty printing default depth. --- CHANGELOG.md | 6 ++++++ src/core/pp.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9db8ed4d..8af6e278 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog All notable changes to this project will be documented in this file. +## Unreleased - ??? +- Increase default nesting depth of pretty printing to `JANET_RECURSION_GUARD` +- Update meson.build +- Add option to automatically add shebang line in installed scripts with `jpm`. +- Add `partition-by` and `group-by` to the core. + ## 1.15.3 - 2021-02-28 - Fix a fiber bug that occured in deeply nested fibers - Add `unref` combinator to pegs. diff --git a/src/core/pp.c b/src/core/pp.c index b21b66b9..f503407a 100644 --- a/src/core/pp.c +++ b/src/core/pp.c @@ -822,7 +822,7 @@ void janet_formatbv(JanetBuffer *b, const char *format, va_list args) { case 'P': case 'p': { /* janet pretty , precision = depth */ int depth = atoi(precision); - if (depth < 1) depth = 4; + if (depth < 1) depth = JANET_RECURSION_GUARD; char d = c[-1]; int has_color = (d == 'P') || (d == 'Q') || (d == 'M') || (d == 'N'); int has_oneline = (d == 'Q') || (d == 'q') || (d == 'N') || (d == 'n'); @@ -974,7 +974,7 @@ void janet_buffer_format( case 'P': case 'p': { /* janet pretty , precision = depth */ int depth = atoi(precision); - if (depth < 1) depth = 4; + if (depth < 1) depth = JANET_RECURSION_GUARD; char d = strfrmt[-1]; int has_color = (d == 'P') || (d == 'Q') || (d == 'M') || (d == 'N'); int has_oneline = (d == 'Q') || (d == 'q') || (d == 'N') || (d == 'n');