Repository navigation
Modeled C stage 1: the c facade block parses (D51 §16.2b) - #1258
Merged
Merged
Conversation
`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.
This was referenced Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 anduse conventionitems; each resource or fn carries an indented clause list. Seven AST kinds (NK_C_FACADE,NK_FACADE_RESOURCE/FN/DOMAIN/CONVENTION,NK_FACADE_CLAUSEwith aFACADE_CLAUSE_*operand table,NK_FACADE_PARAM_REFforparam name|N|type T).candfacadeare two contextual identifiers recognized inparse_declandtop_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_parsescompiles and runs a block using every form; nineerr_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.