Skip to main content

Module diagnose

Module diagnose 

Source
Expand description

Located formula errors, terminal-free: the span of text a [ParseError] is about, its message, and a hint for the common cases (a misspelled name, the wrong number of arguments, an unclosed ().

Structsยง

Diagnostic
A parse error located in the formula text.

Functionsยง

call_name ๐Ÿ”’
The last name( before before, as the range of the name.
diagnose
Locate err (from parsing text) and add a hint where one helps.
did_you_mean ๐Ÿ”’
โ€œdid you mean X?โ€ for the names closest to name by edit distance: functions when it is called, else categories (and measures, unless only a category fits there).
distance ๐Ÿ”’
Levenshtein distance between two strings, by chars.
token_span ๐Ÿ”’
The token starting at byte pos: a quoted name, a word, a number, or one character. Past the end, the last character.
unclosed_paren ๐Ÿ”’
Byte offset of the innermost ( left open at the end of text; parentheses in strings and quoted names do not count.