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:
@@ -537,6 +537,15 @@ test "lex keywords" {
|
||||
}
|
||||
}
|
||||
|
||||
test "lex linkage keywords" {
|
||||
// extern / export are keywords (FFI-linkage stream), lexed beside callconv.
|
||||
var lex = Lexer.init("callconv extern export");
|
||||
const expected = [_]Tag{ .kw_callconv, .kw_extern, .kw_export };
|
||||
for (expected) |exp| {
|
||||
try std.testing.expectEqual(exp, lex.next().tag);
|
||||
}
|
||||
}
|
||||
|
||||
test "lex type-like identifiers" {
|
||||
// i32, u8, bool, string are identifiers, not keywords
|
||||
var lex = Lexer.init("i32 u8 bool string");
|
||||
|
||||
Reference in New Issue
Block a user