Skip to main content

Module formula

Module formula 

Source
Expand description

The Excel formula language: tokenizer, parser, syntax tree, printer (A1 and R1C1) and reference adjustment for copy/fill and structural edits.

Re-exports§

pub use ast::Anchor;
pub use ast::BinOp;
pub use ast::Expr;
pub use ast::RefKind;
pub use ast::Reference;
pub use ast::SheetSel;
pub use ast::StructItem;
pub use ast::StructRef;
pub use ast::TrimMode;
pub use ast::UnOp;
pub use parser::MAX_FORMULA_LEN;
pub use parser::ParseError;
pub use parser::normalize_function_name;
pub use parser::parse;
pub use parser::parse_closing_parens;
pub use parser::parse_name;
pub use printer::print;
pub use printer::print_r1c1;
pub use printer::quote_sheet;

Modules§

adjust
Reference adjustment: copying formulas, inserting/deleting rows and columns, moving cells, renaming and deleting sheets.
ast
Formula syntax tree.
lexer
Tokenizer for Excel formulas (A1 style, canonical or selected UI separators).
parser
Pratt parser: tokens → Expr.
printer
Expr → formula text (without =), A1 or R1C1.

Enums§

FormulaLocale
Formula-entry syntax selected by the interface language. Other interface languages currently use the canonical English function table until a translation table is supplied.

Functions§

fold_name
The case-folded form of a name: two names are same_name when their folded forms are equal.
parse_input
Parses UI input using the selected function table and separators. Existing names and LET/LAMBDA bindings take precedence over aliases. File and API syntax uses crate::formula::parse.
print_input
Prints canonical expressions for editing. Name collisions retain the canonical spelling so displaying then committing a formula never changes a defined-name reference.
same_name
Whether two LET/LAMBDA names are the same: case-insensitive in any script, as in Excel (dług = DŁUG, ß = ẞ). Close to Unicode’s default case folding: lower case, plus the folds lower-casing misses for letters a name may hold (ß/ẞ -> ss, ſ -> s, ς -> σ). Dotless ı stays distinct from i, as outside Turkic languages.