Static analysis for Pine Script ASTs.
pine-lint walks a parsed [pine_ast::Program] and reports likely bugs and
non-idiomatic constructs as [Diagnostic]s. It is organized around three
pieces:
- [
Visitor] + thewalk_*functions — the reusable traversal core. - [
LintPass] — one check; a visitor that collects diagnostics. - [
lint] — the driver that runs every registered pass over a program.
Example
use Program;
use Lexer;
use Parser;
let src = "x = close == na\n";
let tokens = new.tokenize.unwrap;
let program = new;
let diagnostics = lint;
assert_eq!;
assert_eq!;