Skip to content

Modeled C stage 1: the c facade block parses (D51 §16.2b) - #1258

Merged
ehartford merged 1 commit into
mainfrom
c-facade-parser
Sep 21, 2026
Merged

ehartford merged 1 commit into
mainfrom
c-facade-parser

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Stage 1 of docs/modeled-c-implementation-plan.md (D51, §16.2b): parser and AST only, flip none.

c facade name: is a top-level declaration holding resource, fn, domain and use convention items; each resource or fn carries an indented clause list. Seven AST kinds (NK_C_FACADE, NK_FACADE_RESOURCE/FN/DOMAIN/CONVENTION, NK_FACADE_CLAUSE with a FACADE_CLAUSE_* operand table, NK_FACADE_PARAM_REF for param name|N|type T). c and facade are two contextual identifiers recognized in parse_decl and top_level_starts_decl, so no user name is taken. Every clause form of §16.2b parses; each malformed form is a parse error naming the expected spelling.

Facts are not collected (stage 2, in review next): behav_c_facade_parses compiles and runs a block using every form; nine err_c_facade_* tests pin the diagnostics. Sema, MirLower and Codegen ignore the new kinds.

Battery (seed-driven, worktree): build, :fixpoint, :test, :test-green, :last-green all rc=0.

`c facade name:` is a top-level declaration: resource, fn, domain and
`use convention` items, each resource or fn with an indented clause list.
Seven AST kinds (NK_C_FACADE, NK_FACADE_RESOURCE/FN/DOMAIN/CONVENTION,
NK_FACADE_CLAUSE with a FACADE_CLAUSE_* operand table, NK_FACADE_PARAM_REF
for `param name|N|type T`); `c` and `facade` are two contextual identifiers
recognized at top level and in top_level_starts_decl, so no user name is
taken. Every clause of §16.2b parses: from (out param), init/preinit(self),
drop, destroys, ok, borrows, independent, lend, consumes [destroyed_by],
retains … by, returns borrow … from | returns static, preserves param|domain,
of, rename, thread capabilities, callback_thread any, callback consumes.
Each malformed form is a parse error naming the expected spelling.

Facts are not collected (stage 2): behav_c_facade_parses compiles and runs
a block using every form; nine err_c_facade_* tests pin the diagnostics.
Flip: none.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant