rumil_expressions 0.4.0 copy "rumil_expressions: ^0.4.0" to clipboard
rumil_expressions: ^0.4.0 copied to clipboard

Formula evaluator built on Rumil: arithmetic, boolean logic, string ops, variables, custom functions, and precise error locations.

rumil_expressions #

Formula evaluator built on Rumil: arithmetic, boolean logic, string operations, variables, and custom functions.

Parses into a typed, inspectable Expr AST with error locations, then evaluates. Supports chainl1 for natural operator precedence.

Usage #

import 'package:rumil_expressions/rumil_expressions.dart';

// Simple evaluation
evaluate('2 + 3 * 4');  // 14.0

// Variables and functions
final env = Environment.standard(
  variables: {'price': 100.0, 'tax': 0.25},
);
evaluate('price * (1 + tax)', env);  // 125.0

// Parse without evaluating — inspect or transform the AST
final ast = parse('a + b * c');

See the main README for full documentation.

0
likes
160
points
307
downloads

Documentation

API reference

Publisher

verified publisherardaproject.org

Weekly Downloads

Formula evaluator built on Rumil: arithmetic, boolean logic, string ops, variables, custom functions, and precise error locations.

Repository (GitHub)
View/report issues

Topics

#parser #expression #evaluator

License

MIT (license)

Dependencies

rumil

More

Packages that depend on rumil_expressions