bugGNU gettext - Bugs: bug #59262, Scheme line continuations are not...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #59262: Scheme line continuations are not handled correctly

Submitter:  Florent Angly <fangly>
Submitted:  Tue 13 Oct 2020 12:35:46 PM UTC
   
 
Category:  Scheme Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed

Sun 01 Dec 2024 04:34:11 PM UTC, comment #3: 

The fix is contained in gettext 0.23.

Bruno Haible <haible>
Group administrator
Fri 16 Aug 2024 11:58:03 PM UTC, comment #2: 

Thanks for the report. As Miguel noted, Guile in its default configuration does not discard spaces and tabs after backslash-newline, therefore xgettext must keep a way to follow the Guile behaviour.

I chose to make a distinction between --language=Scheme and --language=Guile. With --language=Scheme, xgettext assumes R6RS or R7RS behaviour; with --language=Guile, it assumes Guile behaviour.

Implemented through
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=ee7dfc338f8ad53d416f7935a914d5cdf7bc5ed0
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=c3d3c5363c51ff43d5c13c6c6152d831c16fe942

Miguel, I did not take your patch because
  - I don't agree with introducing an xgettext option that augments the --language handling. That's what the --language option is for.
  - It does not discard spaces and tabs between the backslash and the newline, as required by R6RS and R7RS.
  - It does not enable R6RS compliant behaviour after #!r6rs.

Bruno Haible <haible>
Group administrator
Tue 22 Dec 2020 12:41:17 AM UTC, comment #1: 

The attached patch adds a --rnrs flag to control the standard used by xgettext.  Both --rnrs 6 and --rnrs 7 enable the feature requested, but it isn't enabled by default as Guile reader follows R5RS when the default configuration is used.

(file #50540)

Miguel Ángel Arruga Vivas <m1gu3l>
Group Member
Tue 13 Oct 2020 12:35:46 PM UTC, original submission:  

Line continuations are described in section 6.7 of the Revised7 Report on the Algorithmic Language
Scheme (R7RS, https://small.r7rs.org/attachment/r7rs.pdf):


A line ending which is preceded by \<intraline whitespace> expands to nothing (along with any trailing intraline whitespace), and can be used to indent strings for improved legibility.

Examples:
[...]
"Here’s text \
   containing just one line"


Here is a test Scheme source file "multiline_test.scm":

(i18n "Here’s text \
       containing just one line")


Using Gettext 0.21 to run the command,

xgettext --from-code=UTF-8 --language=Scheme --keyword=id:i18n ./multiline_test.scm

the result file "messages.po" contains the message:

#: multiline_test.scm:1
msgid "Here’s text        containing just one line"
msgstr ""


The msgid contains too many whitespaces and should be instead:

msgid "Here’s text containing just one line"


Florent Angly <fangly>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #50540:  0001-xgettext-Implement-rnrs-option-for-Scheme.patch added by m1gu3l (6KiB - text/x-patch - v1-rnrs-scheme.patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by m1gu3l (Updated the item)
  • -email is unavailable- added by fangly (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-12-01 haible StatusFixed Fix Released
    2024-08-16 haible StatusReady For Test Fixed
        Assigned tom1gu3l haible
        Open/ClosedOpen Closed
    2020-12-22 m1gu3l Attached File- Added 0001-xgettext-Implement-rnrs-option-for-Scheme.patch, #50540
        CategoryTranslator tools Scheme
        StatusNone Ready For Test
        Assigned toNone m1gu3l

    Back to the top

    Powered by Savane 3.14-9aa3.
    Corresponding source code