This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Expression is an Elixir library implementing the FLOIP Expressions language - an Excel-like expression parser and evaluator used for templating with variable substitution.
# Install dependencies
mix deps.get
# Run all tests
mix test
# Run a single test file
mix test test/expression_test.exs
# Run a specific test by line number
mix test test/expression_test.exs:42
# Watch tests during development
mix test.watch
# Format code
mix format
# Check formatting (CI uses this)
mix format --check-formatted
# Lint with Credo
mix credo --strict
# Type checking with Dialyzer (generate PLT first time)
mix dialyzer --plt
mix dialyzer --format dialyxirThe parser and evaluator live under lib/expression/parser.ex and
lib/expression/eval.ex. Parsing uses
NimbleParsec.
(The experimental V2 parser/evaluator was removed in v3.0.0.)
Expression(lib/expression.ex) - Main API:evaluate!/3,evaluate_as_string!/3,parse!/1Expression.Parser- Converts expression strings to ASTExpression.Eval- Evaluates AST with given contextExpression.Context- Builds context for variable substitutionExpression.Callbacks- Behavior for function handlers (pluggable)Expression.Callbacks.Standard- Standard FLOIP function implementations (300+ functions)
- Variables:
@nameor@contact.name(dot notation for nested access) - Functions:
@(FUNCTION(args))or@FUNCTION(contact.name) - Escape
@with@@ - Email addresses like
info@support.comare preserved if@supportdoesn't resolve
Expressions preserve types through evaluation (integers, floats, booleans, DateTime, Date, Time, lists). Use evaluate_as_string!/3 when string output is needed.
CI tests against Elixir 1.15/OTP 26, 1.18/OTP 27, and 1.19/OTP 28. Format checking runs only on 1.19/OTP 28.