ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/cli
Yuya Nishihara 71c2006c9b templater: introduce Formatter wrapper to switch strict/lax evaluations
This allows us to propagate property evaluation error to a string property. For
instance, "s.contains(x ++ y)" will be an error if "y" failed to evaluate,
whereas bare "x ++ y" shouldn't.

The other implementation ideas:

 a. add Template::into_string_property() to enable strict evaluation
    => it's tedious to implement it for each printable type
 b. pass (formatter, error_handler) arguments separately
    => works, but most implementors don't need error_handler argument
 c. pass strict=bool flag around build_*() functions
    => didn't tried, but it would be more complicated than this patch

Because Template trait is now implementation detail of the templater, it
should be okay to use a non-standard formatter wrapper.
2024-03-29 19:15:02 +09:00
..
examples templater: leverage TemplateProperty::map/and_then() helpers 2024-03-23 16:22:17 +09:00
src templater: introduce Formatter wrapper to switch strict/lax evaluations 2024-03-29 19:15:02 +09:00
testing revset: substitute '~(::x)' to 'x..' 2024-03-17 14:50:48 +09:00
tests rebase: do not modify commit IDs if commit is unchanged after rebase 2024-03-29 15:22:50 +08:00
build.rs
Cargo.toml test_conflicts and test_resolve_command: use indoc! to indent conflict markers in tests 2024-03-22 23:27:25 -07:00
LICENSE cargo: add LICENSE file to each crate we publish 2023-09-22 21:48:28 -07:00