split semantic processing and fmt-c code generation

Introducing Sex SEMantic ENgine: the semen.
Also split reader to other file (it can be replaced in the future).
Macro expansion inside Sex code doesn't work yet, and it must be done
in semen, not during fmt-c generation as before.
This commit is contained in:
2025-09-24 20:12:08 +03:00
committed by Pavel Kulyov
parent 8e4cc98522
commit b1744bb6af
16 changed files with 392 additions and 244 deletions

View File

@@ -1,7 +1,8 @@
; Why `sex-modules`? Probably `modules` unit is reserved by chicken,
; things start to break.
(declare (unit sex-modules)
(uses utils))
(uses sex-reader
utils))
(import brev-separate
(chicken file)
@@ -14,7 +15,7 @@
(define +persistent-module-paths+ (list))
(define (import-modules module-list)
(define (get-public-forms module-list)
;; Module list is a list of symbols
;; How Sex handles modules:
;; For each module in a list, construct path, find module by path in
@@ -63,6 +64,7 @@
(list)
raw-forms)))
;;; TODO: use semen facilities to analyze modules
(define (process-public-interface-form form acc)
(case (car form)
((pub)