ocaml: phase 5.1 roman.ml baseline + top-level 'let () = expr'
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 51s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 51s
Side-quest emerged from adding roman.ml baseline (Roman numeral greedy
encoding): top-level 'let () = expr' was unsupported because
ocaml-parse-program's parse-decl-let consumed an ident strictly. Now
parse-decl-let recognises a leading '()' as a unit binding and
synthesises a __unit_NN name (matching how parse-let already handles
inner-let unit patterns).
roman.ml exercises:
* tuple list literal [(int * string); ...]
* recursive pattern match on tuple-cons
* String.length + List.fold_left
* the new top-level let () support (sanity in a comment, even though
the program ends with a bare expression for the test harness)
Bumped lib/ocaml/test.sh server timeout 180->360s — the recent surge in
test count plus a CPU-contended host was crowding out the sole epoch
reaching the deeper smarts.
This commit is contained in:
@@ -407,6 +407,15 @@ _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 5.1 — roman.ml baseline (Roman numeral greedy
|
||||
encoding). Side-quest: top-level `let () = expr` was unsupported by
|
||||
ocaml-parse-program — now parse-decl-let recognises `()` as a unit
|
||||
binding (`__unit_NN` synthetic name), matching the inner-let handling
|
||||
in parse-let. roman.ml uses recursive pattern match on
|
||||
`(int * string) list` greedy table + `List.fold_left + String.length`
|
||||
to compute the cumulative length of 9 encoded numbers (44).
|
||||
Bumped test.sh server timeout 180→360s for headroom on contended
|
||||
systems.
|
||||
- 2026-05-08 Phase 4 — `M.(expr)` local-open expression form (+3
|
||||
tests, 481 total). Implemented in parse-atom-postfix: after
|
||||
consuming `.`, if next token is `(`, parse the inner expression and
|
||||
|
||||
Reference in New Issue
Block a user