artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
@ -0,0 +1,10 @@
|
||||
# DECISIONS (append-only, shared)
|
||||
|
||||
## D-LEX-1: Token representation
|
||||
Chose `__slots__`-based class over dataclass or namedtuple. Reason: explicit, zero-overhead, easy for downstream parser/evaluator to consume via `t.kind` / `t.value` without import coupling.
|
||||
|
||||
## D-LEX-2: Number regex
|
||||
`r"\d+\.?\d*|\.\d+"` handles integers, trailing-dot floats (`10.`), leading-dot floats (`.5`), and standard floats (`3.14`). The alternation order matters: `\d+\.?\d*` before `\.\d+` so integers match first.
|
||||
|
||||
## D-LEX-3: int vs float distinction
|
||||
`int(raw)` when no `.` in the matched string; `float(raw)` otherwise. Preserves the plan's requirement that `42` yields int value and `3.14` yields float value.
|
||||
Reference in New Issue
Block a user