diff -Nru cl-interpol-0.2.5/CHANGELOG cl-interpol-0.2.6/CHANGELOG --- cl-interpol-0.2.5/CHANGELOG 2015-11-22 08:23:51.000000000 +0000 +++ cl-interpol-0.2.6/CHANGELOG 2016-08-26 06:15:21.000000000 +0000 @@ -1,3 +1,11 @@ +Version 0.2.6 +2016-08-26 +Merge pull request #5 from agrostis/master (Hans Hübner) +Followup to 100efc6: added documentation and tests. (Boris Smilga) +Followup to 100efc6: ignore non-newline whitespaces only, as per CLHS 22.3.9.3. (Boris Smilga) +Merge pull request #4 from agrostis/master (Hans Hübner) +Backspace + newline as an escape sequence emulating tilde + newline in CL:FORMAT. (Boris Smilga) + Version 0.2.5 2015-11-22 Fix docstring as suggested by Stas (Hans Hübner) @@ -32,7 +40,7 @@ Version 0.1.1 2003-12-21 -Fixed an embarrassing bug where COLLECTOR was re-used in read.lisp (reported by Hans Hübner) +Fixed an embarrassing bug where COLLECTOR was re-used in read.lisp (reported by Hans Hübner) More tests, better failure reporting Tried to increase readability of docs Mentioned Debian and Gentoo in docs diff -Nru cl-interpol-0.2.5/cl-interpol.asd cl-interpol-0.2.6/cl-interpol.asd --- cl-interpol-0.2.5/cl-interpol.asd 2015-11-22 08:23:51.000000000 +0000 +++ cl-interpol-0.2.6/cl-interpol.asd 2016-08-26 06:15:21.000000000 +0000 @@ -35,7 +35,7 @@ (in-package :cl-interpol-asd) (defsystem :cl-interpol - :version "0.2.5" + :version "0.2.6" :serial t :depends-on (:cl-unicode) :components ((:file "packages") diff -Nru cl-interpol-0.2.5/debian/changelog cl-interpol-0.2.6/debian/changelog --- cl-interpol-0.2.5/debian/changelog 2016-01-17 16:31:28.000000000 +0000 +++ cl-interpol-0.2.6/debian/changelog 2016-11-20 16:45:33.000000000 +0000 @@ -1,3 +1,9 @@ +cl-interpol (0.2.6-1) unstable; urgency=medium + + * Quicklisp release update. + + -- Dimitri Fontaine Sun, 20 Nov 2016 19:45:33 +0300 + cl-interpol (0.2.5-1) unstable; urgency=medium * Quicklisp release update. diff -Nru cl-interpol-0.2.5/doc/index.html cl-interpol-0.2.6/doc/index.html --- cl-interpol-0.2.5/doc/index.html 2015-11-22 08:23:51.000000000 +0000 +++ cl-interpol-0.2.6/doc/index.html 2016-08-26 06:15:21.000000000 +0000 @@ -217,11 +217,10 @@ is intended to be usable with CL-PPCRE. -

Backslashes

-Here's a short summary of what might occur after a backslash, copied -verbatim from man perlop. Details below - you can -click on the entries in this table to go to the corresponding -paragraph. +

Backslashes

Here's a short +summary of what might occur after a backslash, originally copied +from man perlop. Details below - you can +click on the entries in this table to go to the corresponding paragraph.
   \t          tab             (HT, TAB)
@@ -243,6 +242,8 @@
   \U          uppercase till \E
   \E          end case modification
   \Q          quote non-word characters till \E
+
+  \          ignore the newline and following whitespaces
 

If a backslash is followed by @@ -417,6 +418,29 @@ Quoting characters with \Q is especially helpful if you want to interpolate a string verbatim into a regular expression. + +

+ If a backslash is placed at the end of a line, it works as the tilde newline directive to Common Lisp's FORMAT function. That is, the newline immediately following the backslash and any non-newline whitespace characters after the newline are ignored. This escape sequence allows to break long string literals into several lines of code, so as to maintain convenient line width and indentation of code. +

+* #?"@@ -1,11 +1,12 @@\n Th\n-e\n+at\n  quick b\n\
+     @@ -22,18 +22,17 @@\n jump\n-s\n+ed\n  over \n\
+     -the\n+a\n  laz\n"
+"@@ -1,11 +1,12 @@
+ Th
+-e
++at
+  quick b
+@@ -22,18 +22,17 @@
+ jump
+-s
++ed
+  over 
+-the
++a
+  laz
+"
+
+

All other characters following a backslash are left as is and inserted into the string. This is also true for the backslash itself, for $, @, and - as mentioned above - for the outer closing delimiter.

diff -Nru cl-interpol-0.2.5/read.lisp cl-interpol-0.2.6/read.lisp
--- cl-interpol-0.2.5/read.lisp	2015-11-22 08:23:51.000000000 +0000
+++ cl-interpol-0.2.6/read.lisp	2016-08-26 06:15:21.000000000 +0000
@@ -137,6 +137,12 @@
                         ;; now \x should be followed by an octal char
                         ;; code, three digits or less
                         (make-char-from-code (get-number :radix 8 :max 3)))))
+              ((#\Newline)
+                (read-while
+                  (lambda (c)
+                    (or (char= c #\Space)
+                        (not (or (graphic-char-p c) (char= c #\Newline))))))
+                "")
               ;; the following five character names are
               ;; 'semi-standard' according to the CLHS but I'm not
               ;; aware of any implementation that doesn't implement
diff -Nru cl-interpol-0.2.5/test/simple cl-interpol-0.2.6/test/simple
--- cl-interpol-0.2.5/test/simple	2015-11-22 08:23:51.000000000 +0000
+++ cl-interpol-0.2.6/test/simple	2016-08-26 06:15:21.000000000 +0000
@@ -78,6 +78,10 @@
 
 (char= (char #?"\N{Newline}" 0) #\Newline)
 
+;; ignored newline
+(string= #?"abc\
+   def" "abcdef")
+
 (string= #?/\1/ "\\1")
 (string= #?r"\1" "\\1")
 (string= #?r"\k" "\\k")