From b0d0d9cad25573761dddaf4e0232998918686a6a Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 18 Sep 2021 12:38:02 -0500 Subject: [PATCH] Address #809 - treat first docstring line different from others. Only do this if the docstring starts with an open parentheses. --- CHANGELOG.md | 7 ++++--- src/boot/boot.janet | 14 +++++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec07594f..cf7adffc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,17 +2,18 @@ All notable changes to this project will be documented in this file. ## Unlreleased - ??? +- Fix formatting in doc-format to better handle special characters in signatures. - Fix some marshalling bugs. - Add optional Makefile target to install jpm as well. -- Supervisor channels in threads will no longer include a wastful copy of the fiber in every +- Supervisor channels in threads will no longer include a wasteful copy of the fiber in every message across a thread. - Allow passing a closure to `ev/thead` as well as a whole fiber. - Allow passing a closure directly to `ev/go` to spawn fibers on the event loop. ## 1.17.1 - 2021-08-29 - Fix docstring typos -- Add `make install-jpm-git` to make jpm co-install simpler if using makefile. -- Fix bugs with starting ev/threads and fiber marshling. +- Add `make install-jpm-git` to make jpm co-install simpler if using the Makefile. +- Fix bugs with starting ev/threads and fiber marshaling. ## 1.17.0 - 2021-08-21 - Add the `-E` flag for one-liners with the `short-fn` syntax for argument passing. diff --git a/src/boot/boot.janet b/src/boot/boot.janet index b6029391..5c0414ea 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -2786,8 +2786,8 @@ (def delimiters (if has-color {:underline ["\e[4m" "\e[24m"] - :code ["\e[3;97m" "\e[39;23m"] - :italics ["\e[3m" "\e[23m"] + :code ["\e[97m" "\e[39m"] + :italics ["\e[4m" "\e[24m"] :bold ["\e[1m" "\e[22m"]} {:underline ["_" "_"] :code ["`" "`"] @@ -2820,7 +2820,7 @@ (c++) (- cursor x)) - # Detection helpers - return number of characters natched + # Detection helpers - return number of characters matched (defn ul? [] (let [x (c) x1 (cn 1)] (and @@ -2954,6 +2954,14 @@ (finish-p) new-indent)) + # Handle first line specially for defn, defmacro, etc. + (when (= (chr "(") (in str 0)) + (skipline) + (def first-line (string/slice str 0 (- cursor 1))) + (def fl-open (if has-color "\e[97m" "")) + (def fl-close (if has-color "\e[39m" "")) + (push [[(string fl-open first-line fl-close) (length first-line)]])) + (parse-blocks 0) # Emission state