mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
po: Do not handle escape sequences in PEG patterns.
\n sequences are handled and replaced by the 'interpret-newline-escape' procedure. Replacing cannot be done in PEG. Before, PEG patterns had already dealt with the escaping of backslashes, making it impossible for 'interpret-newline-escape' to distinguish \n escape sequences from situations like \\n when the backslash itself is escaped and thus cannot be part of an \n or \" escape sequence. * guix/build/po.scm (str-chr): Do not escape characters. Change-Id: Iae75dc146c55d21b725822780cfe951ef9ffae1e
This commit is contained in:
parent
6012fc5f7b
commit
3bc0cf8839
1 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2019, 2021 Julien Lepiller <julien@lepiller.eu>
|
;;; Copyright © 2019, 2021 Julien Lepiller <julien@lepiller.eu>
|
||||||
;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2023 Florian Pelz <pelzflorian@pelzflorian.de>
|
;;; Copyright © 2023, 2025 Florian Pelz <pelzflorian@pelzflorian.de>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -38,9 +38,9 @@
|
||||||
(and (* (or flags comment (ignore (* whitespace))))
|
(and (* (or flags comment (ignore (* whitespace))))
|
||||||
(ignore "msgid ") msgid (ignore (* whitespace))
|
(ignore "msgid ") msgid (ignore (* whitespace))
|
||||||
(ignore "msgstr ") msgstr))
|
(ignore "msgstr ") msgstr))
|
||||||
(define-peg-pattern escape body (or "\\\\" "\\\"" "\\n"))
|
(define-peg-pattern str-chr body (or " " "!"
|
||||||
(define-peg-pattern str-chr body (or " " "!" (and (ignore "\\") "\"")
|
"\\\\"
|
||||||
"\\n" (and (ignore "\\") "\\")
|
"\\\""
|
||||||
(range #\# #\頋)))
|
(range #\# #\頋)))
|
||||||
(define-peg-pattern msgid all content)
|
(define-peg-pattern msgid all content)
|
||||||
(define-peg-pattern msgstr all content)
|
(define-peg-pattern msgstr all content)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue