Files
doslang-mirror/fec/tests/own
coolguy 51e2568ba7 implement: unit identity -- dotted paths, name rules, source path
Units start here, with the part that needs no import graph: what a unit is
called and where it must live.

The parser only ever read a single identifier after `unit` and `import`, so
`unit game.main;` and `import std.io;` were syntax errors -- which is why the
dotted fixtures failed at the semicolon. It now reads a dotted path and stores
it canonically, dots included, since that spelling is the unit's identity
everywhere else. `import a.b as c;` parses too, with the alias on the node.

resolve.c is the new pass between parsing and checking, for the questions that
span files. It carries SPEC 8.1 so far: each path segment is ASCII lowercase,
starts with a letter, continues with letters, digits or underscore, and is at
most eight characters; and the dotted path must match the source path it was
read from, so game.world.map has to come from game/world/map.fe. The source
side is folded to lowercase before comparing, because a case-insensitive host
must not let two spellings become two units.

That rule then applied to the fixtures, which were not obeying it: 57 declared
a unit name unrelated to their file, left over from the milestone directories,
and eight had names too long to be legal. Both are now aligned -- the rule is
worth having only if the tree follows it.

units: badupper, badlong and unitbad pass. 138 -> 146 of 188. The rest of
units/ needs the import graph, which is the next piece: resolution, cycles,
bindings and visibility.
2026-08-17 03:47:28 +09:00
..

M6 fixtures

These fixtures pin the M6 ownership/borrow rules before implementation.

  • ok*.fe must compile with --target=bits32 --emit-c.
  • bad*.fe must fail compilation; the first line follows the // ERROR:<line>:<substring> convention from SPEC §12.
  • They are registered in src/ferrolang_vm/registry.py, which is what decides whether a milestone runs.
  • When M6 starts, wire this directory into the DOS/QEMU gate without changing the expected result of any fixture.
  • M6 also owns the general-global borrow restriction from R10 because AGENTS.md explicitly groups that change with the own.c state-machine work.

Coverage: R4 storage restrictions, R5 scope, R6 shared/exclusive liveness, root-local field/index conflicts, call-only &mut -> & reborrows, branch/loop MaybeMoved and initialization-state merging, R7 invalidation, R8 derived-return provenance joins, defer lifetime extension, and global borrow restrictions.