Skip to content

selfhost: preserve explicit span mutability during parsing - #771

Closed
godofecht wants to merge 1 commit into
selfhost/span-type-namefrom
selfhost/span-parser-preservation
Closed

godofecht wants to merge 1 commit into
selfhost/span-type-namefrom
selfhost/span-parser-preservation

Conversation

@godofecht

Copy link
Copy Markdown
Contributor

Final explicit-span behavior slice of #718, stacked on #770.

Adds an end-to-end parser contract for span<i32> vs span<mut i32>. It parses real function parameters, reads the ordinary AST_PARAM.a type nodes used by Stage-A typecheck, requires the new span-mutability accessor to report const vs mutable distinctly, and verifies canonical span_const_i32 / span_mut_i32 names through flowc_type_name_into.

The remaining source splice in flowc_parse_type is intentionally tiny: import flowc_ast_type_set_span_mutable; remember whether KW_MUT was consumed inside the <...> branch; after attaching the inner type, set the outer metadata only when the outer source span is exactly span. Do not apply this to arbitrary generic applications. Reference-span sugar remains #720.

The parser source itself is not replaced through the current connector because it requires whole-file replacement and is large enough that a truncated reconstruction would be unsafe. This branch therefore remains a red local contract until that two-site splice is applied from a complete local checkout.

All commits use [skip ci]; qualification is local only.

Related: #674 #677 #718 #720 #769 #770

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