Jai_Format module

format_source

procedure · 1 overloadSource

Formats Jai source. On success result is newly allocated (free it with free); on failure it is empty and error (temporary storage) says why, with a line:column: prefix when it points at the input: text that does not lex, unbalanced brackets, or the internal token check.

format_source :: (
    text: string,
    config: Format_Config = .{}
) -> (result: string, ok: bool, error: string)

Formats Jai source. On success result is newly allocated (free it with free); on failure it is empty and error (temporary storage) says why, with a line:column: prefix when it points at the input: text that does not lex, unbalanced brackets, or the internal token check.

Parameters

text: string

Returns

result: string
ok: bool
error: string

See also