mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-23 21:13:18 -08:00
format: fix addition of fill style newlines in ~< ... ~:@> directive
Only add fill style newline for blanks that don't follow a ~ newline directive (see the format.logical-block.23 test in the ansi-test suite).
This commit is contained in:
parent
df339485eb
commit
c38739f3bb
1 changed files with 8 additions and 4 deletions
|
|
@ -2628,19 +2628,23 @@
|
|||
insides
|
||||
suffix)))
|
||||
|
||||
(defun add-fill-style-newlines (list string offset)
|
||||
(defun add-fill-style-newlines (list string offset &optional previous-directive-is-newline)
|
||||
(declare (si::c-local))
|
||||
(if list
|
||||
(let ((directive (car list)))
|
||||
(if (simple-string-p directive)
|
||||
(if (and (simple-string-p directive)
|
||||
(not previous-directive-is-newline))
|
||||
(nconc (add-fill-style-newlines-aux directive string offset)
|
||||
(add-fill-style-newlines (cdr list)
|
||||
string
|
||||
(+ offset (length directive))))
|
||||
(+ offset (length directive))
|
||||
nil))
|
||||
(cons directive
|
||||
(add-fill-style-newlines (cdr list)
|
||||
string
|
||||
(format-directive-end directive)))))
|
||||
(format-directive-end directive)
|
||||
(char= (format-directive-character directive)
|
||||
#\newline)))))
|
||||
nil))
|
||||
|
||||
(defun add-fill-style-newlines-aux (literal string offset)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue