Semantic analysis for Pine Script — a static pre-check that runs after parsing and before execution.
Example
use Program;
use Lexer;
use Parser;
let src = "x = clse + 1\n"; // typo: `clse`
let tokens = new.tokenize.unwrap;
let program = new;
use HashMap;
use DefaultPineOutput;
use Value;
// The built-ins the runtime registers; here just `close`.
let mut builtins: = new;
builtins.insert;
let errors = analyze;
assert_eq!;
assert_eq!;