Skip to main content

Module parser

Module parser 

Source
Expand description

Pratt parser: tokens → Expr.

Structs§

ParseError

Constants§

MAX_FORMULA_LEN
Longest formula accepted, in characters: Excel’s limit for formula contents. It also bounds the depth of the trees long operator chains build (1+1+…), which dropping and evaluating walk recursively; without it a formula of a few hundred kilobytes in a file overflows the stack.

Functions§

normalize_function_name
_xlfn.XLOOKUP → XLOOKUP. _xludf. is kept (_xludf.SUM): it marks a user-defined function, never the built-in of the same name, and files need it back.
parse
Parses formula text. A leading = (or +/- as Lotus users type) is accepted and skipped for =.
parse_closing_parens
Parses formula text as typed into a cell with parse, closing up to eight missing ) at the end as Excel does (SUM(1,2 enters SUM(1,2)). When no number of ) makes it parse, the error describes the text as typed: 1+ is “unexpected end of formula”, not “unexpected )”.
parse_name
Parses a defined name’s formula. Unlike a cell formula, a comma at the top level is the union operator: Excel stores and shows a name over several ranges as Sheet1!$A$1,Sheet1!$C$1.
parse_struct
Parses the inside of Table[...]. Text between the bracketed items may only be the , and : separators, except one unbracketed column after [#This Row], ([[#This Row],Units], how some writers spell [@Units]); anything else is an error rather than dropped.