Jai_Format module

parse_config

procedureextensionSource

Parses the [format] section of jacket.toml text (see the docs for the keys). Other tables are skipped; without a [format] section the result is the default config. Bad values are errors, reported as line N: ...; unknown keys are dropped and listed in unknown_keys.

Example↗
config, ok, error := parse_config("[format]\nindent_width = 2\nbrace_style = \"preserve\"\n");
assert(ok);
assert(config.indent_width == 2 && config.brace_style == .PRESERVE);
parse_config :: (
    text: string
) -> (config: Format_Config, ok: bool, error: string)

Parameters

text: string

Returns

ok: bool
error: string

See also