Jai_Format module

format_tokens_equivalent

procedureextensionSource

Whether before and after are the same program as far as the compiler can tell: the same tokens, comments and the line breaks and adjacency the parser depends on. format_source already checks its own output with this.

Example↗
ok, why := format_tokens_equivalent("x:=1;", "x := 1;");
assert(ok);
ok, why = format_tokens_equivalent("x := 1;", "x := 2;");
assert(!ok && why.count > 0);
format_tokens_equivalent :: (
    before: string,
    after: string
) -> (ok: bool, why: string)

Parameters

before: string
after: string

Returns

ok: bool
why: string

See also