Commit Graph
9 Commits
Author SHA1 Message Date
coolguy 3b8c8ac674 refactor: unify M7 lowering and C emission
emitcm7.c was the same wrapper trick as the checker: nineteen #define renames,
a textual include of emit_c.c, and a per-unit feature scan choosing between two
emitters. Five of the M7 halves fell through to their M6 counterpart, so those
become the single entry point with the old body renamed to *_core; the other
thirteen never delegated at all and simply replace the M6 version.

The scan is gone from both places it was used -- the program entry and the
expression emitter, whose switch already ended in a default that delegates.
fe_emit_c_program_core went with the dispatch that was its only caller.

emitcm7.c is deleted and the build compiles emit_c.c directly. Nothing in the
compiler now selects an implementation by looking for `?` or `!` in a unit.

This is the pair to the checker commit; together they end the two-engine split
that produced four of the five defects fixed while getting M7 to pass.
2026-08-17 01:49:02 +09:00
coolguy 3091df7a78 refactor: unify the M1-M7 checker
check_m7.c textually included check.c, renamed three entry points aside, and
selected between two whole checkers by scanning each unit for `?`, `!`, `try`
and friends. A unit that mentioned any of them was checked by a second
implementation, so an M1-M6 rule fixed in check.c never reached it -- and the
split hid real defects, since the M7 half was reached by no existing fixture
until M7 cases were registered.

The split was cheaper to undo than it looked: every M7 dispatcher already
delegated to its M6 counterpart for nodes it did not handle. So the M7 entry
points become the single check_expr/check_stmt/check_lvalue/check_call, and
the former M6 bodies become check_expr_core/check_stmt_core/check_lvalue_core,
reached as the fallback. Recursion runs through the unified entry, which is
what makes an optional nested inside otherwise-M6 code get checked at all.

m7_check_fn and m7_check_method were identical to the M6 versions apart from
which check_stmt they called, so they are dropped. The feature scanner
(m7_type_ast, m7_node_feature, m7_program_feature) is gone with the dispatch
it fed, including the loop case that still consulted it. fe_check_program and
fe_check_expr_type keep the M7 bodies, which are supersets.

The build compiles check.c directly again.

No behaviour intended to change: the unified checker applies the union of the
rules to every unit, which for M1-M6 sources is what the M6 half already did.
2026-08-17 01:45:04 +09:00
coolguy 7a25447281 trial: unblock the DOS build (local only, not for merge) 2026-08-16 23:02:43 +09:00
정시원 a2d7dffcae wire M7 DOS build 2026-08-16 21:55:00 +09:00
정시원 d43f28d06a wire M7 foundation into DOS build 2026-08-16 21:17:57 +09:00
정시원 5c88872ef0 wire ownership helper into DOS build 2026-08-16 19:45:20 +09:00
coolguy 8e6a409637 feat: implement M3 aggregate types and iteration 2026-08-16 08:49:50 +09:00
coolguy da78a615fb feat: add M2 type checking and C emission 2026-08-16 07:40:50 +09:00
coolguy 005056a5ea feat: implement M1 Ferro frontend 2026-08-16 07:10:53 +09:00