feat(ffi-linkage): add kw_extern/kw_export tokens (Phase 0.0)
Lex 'extern' and 'export' as keywords beside 'callconv': new token.Tag variants + keywords StaticStringMap entries + LSP semantic-token keyword classification. Adds a 'lex linkage keywords' unit test. Tokens only — parser/AST plumbing and lowering land in later phases. Corpus sweep confirmed no .sx identifier collides with the new reserved words. lock commit per the cadence rule.
This commit is contained in:
@@ -43,6 +43,8 @@ pub const Tag = enum {
|
||||
kw_Self, // Self (in protocol declarations)
|
||||
kw_inline, // inline (compile-time if/for/while)
|
||||
kw_callconv, // callconv (calling convention annotation)
|
||||
kw_extern, // extern (import: external linkage, C ABI, no body)
|
||||
kw_export, // export (define + expose: external linkage, C ABI)
|
||||
|
||||
// Symbols
|
||||
colon, // :
|
||||
@@ -280,6 +282,8 @@ pub const keywords = std.StaticStringMap(Tag).initComptime(.{
|
||||
.{ "Self", .kw_Self },
|
||||
.{ "inline", .kw_inline },
|
||||
.{ "callconv", .kw_callconv },
|
||||
.{ "extern", .kw_extern },
|
||||
.{ "export", .kw_export },
|
||||
});
|
||||
|
||||
pub fn getKeyword(bytes: []const u8) ?Tag {
|
||||
|
||||
Reference in New Issue
Block a user