Skip to content

feat: named tables and array type #118

Description

@dvhthomas

Summary

Add named markdown tables and a first-class Array type to CalcMark, enabling tabular data to serve as a computation source.

Canonical use case: Consulting SOW where a table of roles, rates, and headcount computes line totals and grand totals — no data duplication between tables and calc blocks.

Key capabilities

  • Directive-based table naming: <!-- table: rates (role, rate, hc) -->
  • Dot-access syntax for column arrays: rates.rate, rates.hc
  • Element-wise arithmetic: rates.rate * rates.hc
  • Aggregate functions on arrays: sum(), avg(), min(), max(), count()
  • Array interpolation in table cells: {{line_costs}} per row

Documents

  • Requirements: docs/brainstorms/2026-04-06-named-tables-and-arrays-requirements.md
  • Plan: docs/plans/2026-04-06-003-feat-named-tables-and-arrays-plan.md

Plan structure (10 units, 6 phases)

  1. Type Foundation: Array + Table types
  2. Syntax: AST node, lexer DOT generalization, parser MemberAccess + new function tokens
  3. Document Pipeline: Table directive parsing + extraction from TextBlocks
  4. Semantic + Interpreter: MemberAccess eval, element-wise ops, aggregate functions
  5. Display + Interpolation: Array formatting, array-in-table-cell interpolation, JSON output
  6. Integration: Classifier, feature registry, golden tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    in-progressSynced from project board status

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions