diff options
| author | Mattias EngdegÄrd | 2022-06-02 11:46:18 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2022-06-02 16:57:02 +0200 |
| commit | 52e527a02f40686f355d18ab2ba2d1d7c9fa0fbc (patch) | |
| tree | 9ab242f73ebfc7c55bc93ea89dc986bc248548e6 /test/src/lread-tests.el | |
| parent | 4bacd2a64575ccd55fd9ef8b4648f440243d597a (diff) | |
| download | emacs-52e527a02f40686f355d18ab2ba2d1d7c9fa0fbc.tar.gz emacs-52e527a02f40686f355d18ab2ba2d1d7c9fa0fbc.zip | |
Make ?\LF generate 10, not -1 (bug#55738)
The old -1 value was an artefact of the reader implementation.
* src/lread.c (read_escape): Remove the `stringp` argument; assume
character literal syntax. Never return -1.
(read_string_literal): Handle string-specific escape semantics here
and simplify.
* test/src/lread-tests.el (lread-escaped-lf): New test.
Diffstat (limited to 'test/src/lread-tests.el')
| -rw-r--r-- | test/src/lread-tests.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el index 47351c1d116..99eec9d5487 100644 --- a/test/src/lread-tests.el +++ b/test/src/lread-tests.el | |||
| @@ -317,4 +317,9 @@ literals (Bug#20852)." | |||
| 317 | (should (equal (read-from-string "#_") | 317 | (should (equal (read-from-string "#_") |
| 318 | '(## . 2)))) | 318 | '(## . 2)))) |
| 319 | 319 | ||
| 320 | (ert-deftest lread-escaped-lf () | ||
| 321 | ;; ?\LF should produce LF (only inside string literals do we ignore \LF). | ||
| 322 | (should (equal (read-from-string "?\\\n") '(?\n . 3))) | ||
| 323 | (should (equal (read-from-string "\"a\\\nb\"") '("ab" . 6)))) | ||
| 324 | |||
| 320 | ;;; lread-tests.el ends here | 325 | ;;; lread-tests.el ends here |