Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 33s
lib/ocaml/baseline/{factorial,list_ops,option_match,module_use,sum_squares}.ml
exercised through ocaml-run-program (file-read F). lib/ocaml/baseline/
run.sh runs them and compares against expected.json — all 5 pass.
To make module_use.ml (with nested let-in) parse, parser's
skip-let-rhs-boundary! now uses has-matching-in? lookahead: a let at
depth 0 in a let-decl rhs opens a nested block IFF a matching in
exists before any decl-keyword. Without that in, the let is a new
top-level decl (preserves test 274 'let x = 1 let y = 2').
This is the first piece of Phase 5.1 'vendor a slice of OCaml
testsuite' — handcrafted fixtures for now, real testsuite TBD.
15 lines
247 B
OCaml
15 lines
247 B
OCaml
(* Baseline: module declaration + use *)
|
|
module Counter = struct
|
|
let make () =
|
|
let n = ref 0 in
|
|
fun () ->
|
|
n := !n + 1 ;
|
|
!n
|
|
end ;;
|
|
let result =
|
|
let c = Counter.make () in
|
|
let _ = c () in
|
|
let _ = c () in
|
|
c () ;;
|
|
result
|