Commit Graph

31 Commits

Author SHA1 Message Date
lilleman c2f2e86735 Move how the template language is written into internal/grammar 2026-10-05 12:35:08 +02:00
lilleman 2d9c315e75 Move the seeded randomness and the {seq()} counters into internal/drawstate 2026-10-05 12:03:38 +02:00
lilleman 426517e66d Answer stability round 1, product-owner round 1 and prose round 1: say calc reads names in the Functions table, use shipped data in the examples, plainer comments and item wording, mark items 5 and 90 as decision-cited, and ask whether a field spelling of a calc operand is refused 2026-10-05 01:23:55 +02:00
lilleman 0743a049d7 Answer architecture round 2: refuse by default where a builtin's operand can be a reference, test the flag against each operand grammar, drop a duplicate test, rename allNeverNumeric, rewrap Computation, and order item 91 after item 4 2026-10-05 01:23:55 +02:00
lilleman 94cf741706 Answer architecture round 1: exempt only a calc operand from the read-once refusal, run the name passes from one list, read every operand's leaves, show a name operand in a README example, and plan a path through a name as an operand 2026-10-05 01:23:55 +02:00
lilleman b4052f77f9 Accept a name as a calc operand 2026-10-05 01:23:55 +02:00
lilleman a9448d1a99 Delete comments restating their code, and doc.go's partial list of draw fences 2026-09-30 22:01:04 +02:00
lilleman 14194a775d Rename ftoken to scanUnit and session to generatorState 2026-09-29 12:47:38 +02:00
lilleman eebf2aa62b Delete the comments and preambles the panel found empty 2026-09-29 10:33:56 +02:00
lilleman 0dfa615b54 Name printedNumber's dp cases, and say what prints and proveNumber a builtin sets 2026-09-29 04:17:59 +02:00
lilleman 514d738b08 Report every invariant break through internalError 2026-09-29 01:51:44 +02:00
lilleman 306b88ef56 Compile every format at link 2026-09-28 03:23:27 +02:00
lilleman d6ac8ed9fd Give check, children, column, columns, draw, drawn, fields, format, head, index, key, n, name, named, names, null, number, op, reads, record, root, row, t and whole one meaning each 2026-09-25 19:31:09 +02:00
lilleman 3e7127da71 Parse a divisor's rounding half exactly, print zero unsigned, name int64 refusals, and quote CSV fields without a writer
Tests / vet + fmt + tests (pull_request) Successful in 1m0s
2026-09-15 15:08:26 +02:00
lilleman 5615ab6d89 Check a typed column's value, not its text: one literal, value call, calc or read, bounded by its arguments
Tests / vet + fmt + tests (pull_request) Successful in 59s
2026-09-15 14:33:04 +02:00
lilleman 94dc562c6c Typed columns and null: a datatype option, null items, and a load check that every typed render parses
Tests / vet + fmt + tests (pull_request) Successful in 58s
2026-09-15 11:23:57 +02:00
lilleman addba9abf7 Give maxLen its own literal and repeats MaxRepeat; arg errors name the spelling and the range; write's comment says what Flush reports; assert 64-bit at compile time
Tests / vet + fmt + tests (pull_request) Successful in 59s
Tests / vet + fmt + tests (push) Successful in 6s
2026-09-02 19:25:19 +02:00
lilleman 4f9285ab5c Reject non-finite float bounds, unplain integer args, constant samples, a constant zero divisor and the default separator; a binding key is no path segment; ascii keeps DEL; an unheld path panics
Tests / vet + fmt + tests (pull_request) Successful in 56s
2026-09-02 19:08:32 +02:00
lilleman f9647ff6bb Decompose compileTemplate, checkBoundLevelsHeld and loadDir; gate cyclomatic complexity at 14
Tests / vet + fmt + tests (pull_request) Successful in 54s
2026-09-02 18:31:38 +02:00
lilleman 1b1b93b35f Reject weight 0, a never-numeric calc operand and a repeat product past the cap; the CLI classifies ErrNoData
Tests / vet + fmt + tests (pull_request) Successful in 52s
2026-09-02 18:23:03 +02:00
lilleman 31c2f12098 Hold a reference path like a sibling path; add the lowercase, uppercase and ascii transforms 2026-09-02 12:52:19 +02:00
lilleman ff4b243148 Format text is literal; class runs are {digits(n)} {upper(n)} {lower(n)}; a string is a format 2026-09-02 12:37:21 +02:00
lilleman 05dc042e49 Rename the project to fejkdata and record the fork source
Tests / vet + fmt + tests (pull_request) Failing after 6s
2026-09-01 20:24:03 +02:00
M 0cee8b2183 Report a prep-time arg that its check should have caught
calcPrep discarded parseCalc's error, so a divergence from checkCalc would
have produced a nil AST and then a nil dereference per render, with no
message. atoi did the same quietly, returning zero for a length, range or
decimal count. Both now panic naming the argument, so the invariant they rest
on fails where it breaks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 21:58:37 +02:00
M 1b5e928d4f Fail loudly where calc says it cannot happen
calcVar.eval returned NaN on a path indexVars makes unreachable, and a name
missing from the index map read operand 0. Both would have printed a wrong
number rather than reporting anything. They panic now, like child() does for
the same class of slip, so drift between calcVars and indexVars surfaces as a
stack trace naming the operand.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 21:58:37 +02:00
M 9ed0d3bf55 Hold a calc operand's draw for the expansion
A field the format rendered and a calc read was drawn twice, so the operand
shown could differ from the operand computed — the same disagreement the
dotted-path rule already fences, in its plainest spelling. The README
carried it as a caveat, which is what a rule like this exists to remove.

A calc operand now joins the names an expansion holds, so it is drawn once
and every later read of it — the calc, and any bare token spelling it —
sees that draw. The hold stays per expansion: each repeat iteration and each
nested template draws its own.

expand reads a calc's operands before the call and hands over their values,
so a builtin takes (emitted, operands) rather than the sibling fields, and
the evaluator indexes that slice instead of walking the node tree. That is
what keeps the draws a local. Handing them to a builtin instead lets them
escape through an indirect call, which put two maps on the heap for every
held format, calc or not: BenchmarkBound went 56 B/5 allocs -> 744 B/10.

Measured against main: Bound 359 -> 349 ns at 56 B/5 allocs, unchanged;
Calc 416 -> 577 ns and one more alloc, which is what the correlation costs.

Validation is unchanged: t.bound still carries only the levels a dotted
token reads, so the overlap fences fence exactly what they did.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 13:33:05 +02:00
M 5a69b02ee0 Find a format's bound readers in one ordered scan 2026-08-30 22:31:54 +02:00
Mikael Göransson 37759f773f Pin the builtin registry shape and grow as a lower bound, and correct stale comments 2026-08-28 13:20:07 +02:00
lilleman ab9846c2ff Compile format strings at New instead of re-scanning them on every render 2026-08-28 13:20:07 +02:00
lilleman 5b6480a094 Updates from reviewers 2026-06-09 10:03:53 +02:00
lilleman cee2f35a2c Add {calc()}: arithmetic over number literals and sibling fields 2026-06-09 07:59:29 +02:00