ocaml: phase 6 Filename module + Char.compare/equal/escaped (+7 tests, 569 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 31s

Filename module (forward-slash only, no Windows-separator detection):

  basename '/foo/bar/baz.ml'        = 'baz.ml'
  dirname  '/foo/bar/baz.ml'        = '/foo/bar'
  extension 'baz.tar.gz'            = '.gz'
  chop_extension 'hello.ml'         = 'hello'
  concat 'a' 'b'                    = 'a/b'
  is_relative 'a/b'                 = true
  current_dir_name = '.', parent_dir_name = '..', dir_sep = '/'

Char additions:

  equal a b                         = (a = b)
  compare a b                       = code(a) - code(b)
  escaped '\n'                      = '\\n'    (likewise t, r, \\, ")
This commit is contained in:
2026-05-09 05:24:37 +00:00
parent 7773c40337
commit 5d33f8f20b
3 changed files with 98 additions and 0 deletions

View File

@@ -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-09 Phase 6 — Filename module + Char.compare/equal/escaped
(+7 tests, 569 total). Filename: basename, dirname, extension,
chop_extension, concat, is_relative + dir_sep / current_dir_name /
parent_dir_name constants. Forward-slash only, doesn't try to
detect Windows separators. Char additions: equal, compare (via
code subtraction), escaped (handles `\n`/`\t`/`\r`/`\\`/`\"`).
- 2026-05-09 Phase 4 — basic labeled / optional argument syntax
(label dropped, positional semantics) (+3 tests, 562 total). Three
parser changes: