Jai_Format module

format_apply_setting

procedureextensionsince 0.29.0Source

Sets one setting from key=value, the value written as in the TOML file (4, true, "preserve"): how a caller that already resolved the settings passes them on. Unlike the file parser, a key the formatter does not have is an error.

Example↗
config: Format_Config;
ok, error := format_apply_setting(*config, "indent_width=8");
assert(ok && config.indent_width == 8);
ok, error = format_apply_setting(*config, "colour=red");
assert(!ok);
format_apply_setting :: (
    config: *Format_Config,
    assignment: string
) -> (ok: bool, error: string)

Parameters

config: *Format_Config
assignment: string

Returns

ok: bool
error: string

See also