ocaml: phase 1+5.1 type aliases + poly_stack baseline (+3 tests, 469 / 19 baseline)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 39s

Parser: in parse-decl-type, dispatch on the post-= token:
  '|' or Ctor   -> sum type
  '{'           -> record type
  otherwise     -> type alias (skip to boundary)
AST (:type-alias NAME PARAMS) with body discarded. Runtime no-op since
SX has no nominal types.

poly_stack.ml baseline exercises:
  module type ELEMENT = sig type t val show : t -> string end
  module IntElem = struct type t = int let show x = ... end
  module Make (E : ELEMENT) = struct ... use E.show ... end
  module IntStack = Make(IntElem)

Demonstrates the substrate handles signature decls + abstract types +
functor parameter with sig constraint.
This commit is contained in:
2026-05-08 20:49:26 +00:00
parent c7d8b7dd62
commit ce75bd6848
6 changed files with 72 additions and 0 deletions

View File

@@ -407,6 +407,13 @@ _Newest first._
binary search tree (`type 'a tree = Leaf | Node of 'a * 'a tree *
'a tree`) with insert + in-order traversal. Tests parametric ADT,
recursive match, List.append, List.fold_left.
- 2026-05-08 Phase 1+5.1 — type aliases + poly_stack baseline (+3
tests, 469 total + 19 baseline). Parser dispatch on the post-`=`
token: `|` or `Ctor` → sum, `{` → record, otherwise → alias (skip
to boundary). AST `(:type-alias NAME PARAMS)` with body discarded.
Runtime no-op. poly_stack.ml baseline exercises a functor whose
parameter has `type t = int` (record alias) + `let show : t ->
string`. Stack uses ref + module field lookup to format ints.
- 2026-05-08 Phase 2+3 — `try ... with | pat when GUARD -> body` guard
support (+3 tests, 467 total). parse-try mirrors match/function;
eval-try clause loop now dispatches on `case`/`case-when` and falls