Open
Bug 1397233
Opened 7 years ago
Updated 6 years ago
Serializer should throw an error when the first TextElement of a Pattern contains leading whitespace
Categories
(L20n :: Python Library, enhancement)
L20n
Python Library
Tracking
(Not tracked)
NEW
People
(Reporter: stas, Unassigned)
References
Details
The parser ignores the leading whitespace in values. The following two snippets are AST-equal: foo = Foo foo = Foo As such it is not possible for an AST which is a result of parsing to contain Patterns whose first element is a TextElement with leading whitespace. We should make this explicit in the Serializer to prevent hand-created AST from serializing to something they are not. I think the way to go is to throw an error.
Comment 1•6 years ago
|
||
This probably affects pontoon primarily. Matjaz, do you have an opinion? In migrations, we already mark up leading and trailing whitespace in explicit expressions in Transform.pattern_of
Flags: needinfo?(m)
Comment 2•6 years ago
|
||
Pontoon doesn't hand-create ASTs, so I don't think it's affected by that. It also parses and serializes strings that are changing through the source editor.
Flags: needinfo?(m)
You need to log in
before you can comment on or make changes to this bug.
Description
•