ocaml: phase 4 'M.(expr)' local-open expression form (+3 tests, 481 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 21s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 21s
In parse-atom-postfix, after consuming '.', if the next token is '(',
parse the inner expression and emit (:let-open M EXPR) instead of
:field. Cleanly composes with the existing :let-open evaluator and
loops to allow chained dot postfixes.
List.(length [1;2;3]) = 3
List.(map (fun x -> x + 1) [1;2;3]) = [2;3;4]
Option.(map (fun x -> x * 10) (Some 4)) = Some 40
This commit is contained in:
@@ -407,6 +407,12 @@ _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 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
|
||||
emit `(:let-open M EXPR)` instead of `:field`. Cleanly composes with
|
||||
existing `:let-open` evaluator. `List.(length [1;2;3])` → 3,
|
||||
`Option.(map (fun x -> x * 10) (Some 4))` → Some 40.
|
||||
- 2026-05-08 Phase 4 — `let open M in body` local opens (+3 tests, 478
|
||||
total). Parser detects `let open` as a separate let-form, parses M
|
||||
as a path (Ctor(.Ctor)*), and emits `(:let-open PATH BODY)`. Eval
|
||||
|
||||
Reference in New Issue
Block a user