1
0
forked from alex-eg/sex

space toplevel forms the way the source does

Every toplevel form was followed by a blank line whether or not one
was written, so the prelude's run of typedefs arrived at twice the
height. A function had no location of its own to measure from either,
having lost it where its header and body are stitched together.
This commit is contained in:
2026-10-05 02:08:15 +03:00
parent 7f3f22e853
commit 95f39e4b44
8 changed files with 72 additions and 25 deletions

View File

@@ -38,11 +38,13 @@
(define (peek port)
(peek-char port))
;;; Record where a form started. Called with the line of the opening
;;; delimiter, sampled before it is consumed
;;; Record where a form started and where it ended. Called with the
;;; line of the opening delimiter, sampled before it is consumed, once
;;; the form itself has been read -- so the current line is the one its
;;; closing delimiter sits on
(define (stamp form line)
(when (pair? form)
(set-form-source! form (current-source-file) line))
(set-form-source! form (current-source-file) line (current-line)))
form)
(define (delimiter? c)