An interpreter of FEEL, written in Rust, with integrations for PostgreSQL, WASM, Lua, and Python.
feat(core): lex leading-dot & exponent number literals (§10.3.2.3.1)
public
feat(core): lex leading-dot & exponent number literals (§10.3.2.3.1)
FEEL grammar rule 35 allows a numeric literal to start with a dot
(`".872"`) and to carry an optional exponent (`"1.2e3"`). The previous
logos regex only covered digit-led mantissas without exponents.
Widen the Num token regex to:
([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?
The leading-dot branch requires at least one digit after the dot, so it
never overlaps with `..` (DotDot) or a lone `.` (Dot); logos's maximal-
munch resolves any ambiguity without a priority annotation. Negatives
continue to be produced by unary minus over the literal (consistent with
0099-arithmetic-negation).
Add direct unit tests (`number_literals_rule35`) covering `.872`, `-.872`,
exponent forms (`1.2e3`, `1E-3`, `.5e2`), and regression on the digit-led
mantissa. All 91 lib tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>