An opinionated formatter for Pine Script.
[format] lexes and parses the source, then renders the AST back through a
Prettier-style document layout. It preserves // comments (carried as lexer
trivia) and normalizes spacing, indentation, and line wrapping. Formatting
requires the source to parse; a lex or parse error is returned unchanged.
Example
let src = "x=close+1\n";
assert_eq!;