-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
FUTUREIdeas and requests to consider after Fluent 1.0Ideas and requests to consider after Fluent 1.0syntax
Description
Zero-copy parsing can be extremely fast and brings significant memory savings.
What's more, ability to zero-copy parse does not prevent the AST from taking ownership over the data allowing for the original string to be discarded and the AST to be transferred, when needed.
In order to allow for zero-copy parsing, we'll need to introduce two changes:
- Comments will become a vector of ropes (Rust:
Vec<&str>
) which will omit the comment sigil and store empty lines as""
) - Pattern::TextElement will store unescaped strings and the only escaping needed on the parser level is
\{
which will not terminate the TextElement.
This would mean that we'd need a separate step to process the text element in pattern and comment when necessary. @Manishearth suggested using COW [0] to lazily resolve/process those two data structures into an owner, unescaped and processed structures when needed.
Metadata
Metadata
Assignees
Labels
FUTUREIdeas and requests to consider after Fluent 1.0Ideas and requests to consider after Fluent 1.0syntax