From 3bc0cf8839fde579dea398c04250a0c86f112e9e Mon Sep 17 00:00:00 2001 From: Florian Pelz Date: Tue, 16 Sep 2025 00:29:33 +0200 Subject: [PATCH] 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 --- guix/build/po.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guix/build/po.scm b/guix/build/po.scm index 62362e933e4c0e67a6d27b2bb698fe7f2f2c4456..4d153478c9a329a8428c3381efc8e9b4911ea76d 100644 --- a/guix/build/po.scm +++ b/guix/build/po.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019, 2021 Julien Lepiller ;;; Copyright © 2020 Ludovic Courtès -;;; Copyright © 2023 Florian Pelz +;;; Copyright © 2023, 2025 Florian Pelz ;;; ;;; This file is part of GNU Guix. ;;; @@ -38,9 +38,9 @@ (and (* (or flags comment (ignore (* whitespace)))) (ignore "msgid ") msgid (ignore (* whitespace)) (ignore "msgstr ") msgstr)) -(define-peg-pattern escape body (or "\\\\" "\\\"" "\\n")) -(define-peg-pattern str-chr body (or " " "!" (and (ignore "\\") "\"") - "\\n" (and (ignore "\\") "\\") +(define-peg-pattern str-chr body (or " " "!" + "\\\\" + "\\\"" (range #\# #\頋))) (define-peg-pattern msgid all content) (define-peg-pattern msgstr all content)