8000 Rename to `Kex.AST`; migrate docgen and Tey's manifest reader · Issue #137 · kexhq/kex · GitHub
[go: up one dir, main page]

Skip to content

Rename to Kex.AST; migrate docgen and Tey's manifest reader #137

Closed

Description

@akoskovacs

Part of #131. Blocked by #134, #135.

The final stage: give the surface its right name and move the consumers onto it.

Rename

src/stdlib/parser.kex becomes src/stdlib/ast.kex, declaring module Kex.AST — beside Kex.Interface in src/stdlib/kex.kex, which is where compiler introspection already lives.

The top-level name Parser goes away. It reads as a peer of Parsing, the stdlib's parser-combinator module, with which it has nothing whatever to do; that collision has been a standing source of confusion and this frees the good name for the combinators.

Surface: parse, parseFile, parseType, parseExpression, toSource, and the TypeRef / PatternRef printers. src/stdlib/prelude.kex updated accordingly.

Consumers

  • tools/docgen/docgen.kex — mechanical rename; it is the existing consumer and its output must not move.

  • Tey.Manifest — the substantive one. Replace the reader that recognises declarations by their leading word with a match over Kex.AST nodes: bundle "x" do ... end is a Call with a block, tey("greet", git: ..., tag: ...) is a Call with named arguments. Both became expressible in Full-fidelity AST schema: named args, call blocks, patterns, bodies #135.

    This removes the drift risk docs/tey-limitations.md describes — a hand-written grammar can accept or reject something the compiler does not, so a manifest Kex parses is one Tey rejects. Reading the compiler's own AST cannot drift by construction.

  • docs/tey-limitations.md — drop the manifest-reader entry, including the "middle option" paragraph about building the reader on the Parsing combinators instead, which this supersedes.

Verification

  • make test-all, both backends.
  • Docgen output diffed before/after the rename — must be identical.
  • Tey reading a real package.kex that uses a bundle block and named-argument tey(...) lines, on BEAM.

Activity

  1. changed the title [-]Rename to `Kex.Ast`; migrate docgen and Tey's manifest reader[/-] [+]Rename to `Kex.AST`; migrate docgen and Tey's manifest reader[/+] on Aug 19, 2026
  2. added this to the 0.4.0 milestone on Aug 21, 2026
  3. akoskovacs commented on Aug 21, 2026

    @akoskovacs
    CollaboratorAuthor

    Done. The surface is Kex.AST (src/stdlib/kex/ast.kex; src/stdlib/parser.kex is gone, and src/interpreter/stdlib/parser.cxx now defines the Kex.AST module), and both consumers are migrated: tools/docgen/docgen.kex parses through Kex.AST.parseFile, and tey/src/tey/manifest.kex opens with using Kex.AST instead of scanning declarations by leading word.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0