projectfluent / fluent-rs

Rust implementation of Project Fluent
https://projectfluent.org
Apache License 2.0
1.08k stars 97 forks source link

Consider the need for `DisplayableNode` #122

Closed zbraniecki closed 4 years ago

zbraniecki commented 5 years ago

Originally DisplayableNode was useful because it covered two use cases at once - it provided a hashable unit for tracking of cycles, and for displaying error information.

With the recent move to hash on references to patterns, we may be able to simplify that or even fold into FluentValue::Error.

zbraniecki commented 5 years ago

I think I'll keep it for 0.7 at least.

It still serves two purposes - it can be a value of FluentValue::Error which makes it perfect for lazy formatting into a string (think "{-term.attr}" fallback) and it can generate an error.

The big win here is that it is lazy, so it uses minimal amount of memory (one enum and max two refs) and can be passed around with an intention to be used as an error format/reason in case an error scenario is encountered (in track for example).

I'd like to revisit that when we work on reference resolver and unify between JS resolver and Rust.

zbraniecki commented 4 years ago

This has been removed by #199.