Skip to main content

rl_lang/docs/entries/stdlib/rl/
check.rs

1use crate::docs::entry::FnEntry;
2
3pub static CHECK: FnEntry = FnEntry {
4    signature: "check(code)",
5    description: "parses and type-checks a string of rl source code without running it; useful for validating snippets before evaluating them",
6    example: "get std::rl::check\n\ncheck(\"dec int x = 1\") // ok(null)\ncheck(\"dec int x = \\\"a\\\"\") // err([\"...type mismatch...\"])",
7    expected_output: None,
8    returns: "Result[null]",
9    errors: Some(
10        "returns an array of type-checker error messages if the code fails to parse or type-check",
11    ),
12    see_also: &["lex", "eval"],
13    since: None,
14};