bugGNU gettext - Bugs: bug #57927, "warning: RegExp literal...

 
 

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

bug #57927: "warning: RegExp literal terminated too early" when parsing some JSX files

Submitter:  Vaclav Slavik <vslavik>
Submitted:  Sat 29 Feb 2020 02:58:03 PM UTC
   
 
Category:  JavaScript Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed

Mon 27 Jul 2020 05:45:14 PM UTC, comment #2: 

The fix is contained in gettext 0.21.

Bruno Haible <haible>
Group administrator
Mon 06 Apr 2020 09:33:12 PM UTC, comment #1: 

Fixed through
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=f6fd2276ef2dab61f6120055f5b06c8d5aa899b1

Thank you for the report with a very-to-the-point test case!

Bruno Haible <haible>
Group administrator
Sat 29 Feb 2020 02:58:03 PM UTC, original submission:  

I struggle to describe the circumstances more meaningfully. Originally I assumed JSX syntax isn't supported at all, which I now know is not the case, but some tiny changes to otherwise parseable JSX files cause xgettext to complain that "RegExp literal terminated too early" and ignore all subsequent extractable strings.

On this file (both also attached), xgettext throws the above error:

--------
export function funcName() {
    return <a>{ 'x' }</a>;
}
_('one');
--------

On this one, however, it does not, it is working:

--------
export function funcName() {
    a = <a>{ 'x' }</a>;
}
_('one');
--------

(Changing the 2nd line to read "a <a>{ 'x' }</a>;" again causes the error, but that wouldn't be valid JS code; it does seem to indicate that the '=' token is relevant to the bug, though.)

It is not the same underlying cause as #56848 - I reproduced with that fix applied too.

Originally reported at https://github.com/vslavik/poedit/issues/601 by Micha Rohde who did all the work on minimizing the reproduction samples.

Vaclav Slavik <vslavik>

 

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

Attached Files
file #48524:  broken.js added by vslavik (68B - application/x-javascript)
file #48525:  working.js added by vslavik (65B - application/x-javascript)

 

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 vslavik (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2020-04-06 haible StatusNone Fixed
        Assigned toNone haible
        Open/ClosedOpen Closed
    2020-02-29 vslavik Attached File- Added broken.js, #48524
        Attached File- Added working.js, #48525

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code