You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Full-fidelity AST schema: named args, call blocks, patterns, bodies #135
Part of #131. Blocked by #133 (do the fidelity work once, on both sinks).
The exposed schema covers roughly 25 of the 43 ast::Expr variants (src/ast/ast.hxx), and drops information even from the ones it covers. This is the stage that makes it the real AST rather than a reporting view, and it is deliberately incremental — each group below is a landable commit.
Because #133 puts both backends behind one converter, every item here lands on the interpreter and BEAM at once.
Groups, ordered by who is blocked
Call / MethodCall: named arguments and block arguments. Both are already on ast::FunctionCall and ast::MethodCall (src/ast/ast.hxx:183, :196) as namedArgs and block, and both are simply dropped in conversion. Today bundle "demo" do ... end becomes Call(Identifier("bundle"), [LitString("demo")]) with the manifest's entire contents missing, and tey("greet", git: ..., tag: ...) loses its arguments. Unblocks Tey (Rename to Kex.AST; migrate docgen and Tey's manifest reader #137).
Patterns.Match carries (PatternRef, Expression) pairs and guards, not just arm bodies. Let carries a real pattern instead of a name string scraped out of VarPattern.
Declaration detail: function clause bodies, rescue blocks, and the distinctions src/ast/ast.hxx explicitly documents as semantic — FunctionClause::hasParamList (let x = 3 is a binding, let x() = 3 is a nullary function) and MethodCall::parenthesized (a function reference vs. a call to it).
Schema versioning
Program gains schemaVersion : Integer, bumped by each group. Consumers can then refuse a schema they do not understand instead of misreading it.
Verification
make test-all, every spec under both backends.
An exhaustiveness test mapping each ast::Expr variant to its schema counterpart, so that adding a node to the C++ AST fails the build rather than silently vanishing from the exposed one. This is the mechanism that keeps src/stdlib/ast.kex canonical rather than aspirational.
Activity
Complete full-fidelity Kex.AST schema, fixes #135