refactor(ffi-linkage): Phase 9.2a — rename runtime-class TYPE names → Runtime* (Decision 5)
Mechanical, collision-free PascalCase renames (object-model axis, not linkage): ForeignClassDecl→RuntimeClassDecl, ForeignMethodDecl→RuntimeMethodDecl, ForeignClassMember→RuntimeClassMember, ForeignFieldDecl→RuntimeFieldDecl, ForeignRuntime→RuntimeKind, ForeignClassPrefix→RuntimeClassPrefix. Snapshot-neutral; suite green (646/444). Remaining 9.2: snake_case state (foreign_class_map, current_foreign_class, foreign_path [coupled to .sx hooks], the foreign_class_decl union variant) + the parse/lower/resolve fn names + ForeignClassDecl.is_foreign flag.
This commit is contained in:
@@ -1280,7 +1280,7 @@ pub const Parser = struct {
|
||||
} });
|
||||
}
|
||||
|
||||
fn foreignRuntimeForCurrent(self: *Parser) ?ast.ForeignRuntime {
|
||||
fn foreignRuntimeForCurrent(self: *Parser) ?ast.RuntimeKind {
|
||||
return switch (self.current.tag) {
|
||||
.hash_jni_class => .jni_class,
|
||||
.hash_jni_interface => .jni_interface,
|
||||
@@ -1293,8 +1293,8 @@ pub const Parser = struct {
|
||||
};
|
||||
}
|
||||
|
||||
const ForeignClassPrefix = struct {
|
||||
runtime: ast.ForeignRuntime,
|
||||
const RuntimeClassPrefix = struct {
|
||||
runtime: ast.RuntimeKind,
|
||||
is_foreign: bool,
|
||||
is_main: bool,
|
||||
};
|
||||
@@ -1305,7 +1305,7 @@ pub const Parser = struct {
|
||||
/// directive (possibly after modifiers). Consumes the modifier tokens
|
||||
/// only when a runtime directive follows; otherwise leaves the parser
|
||||
/// state untouched.
|
||||
fn tryParseForeignClassPrefix(self: *Parser) ?ForeignClassPrefix {
|
||||
fn tryParseForeignClassPrefix(self: *Parser) ?RuntimeClassPrefix {
|
||||
// Peek ahead through modifier tokens to confirm a directive follows.
|
||||
var lookahead_idx: usize = 0;
|
||||
var is_foreign = false;
|
||||
@@ -1349,7 +1349,7 @@ pub const Parser = struct {
|
||||
return self.peekTag(1) == .identifier and self.peekTag(2) == .r_paren;
|
||||
}
|
||||
|
||||
fn foreignRuntimeForOffset(self: *Parser, offset: usize) ?ast.ForeignRuntime {
|
||||
fn foreignRuntimeForOffset(self: *Parser, offset: usize) ?ast.RuntimeKind {
|
||||
const tag = self.peekTag(offset);
|
||||
return switch (tag) {
|
||||
.hash_jni_class => .jni_class,
|
||||
@@ -1363,7 +1363,7 @@ pub const Parser = struct {
|
||||
};
|
||||
}
|
||||
|
||||
fn parseForeignClassDecl(self: *Parser, name: []const u8, start_pos: u32, runtime: ast.ForeignRuntime, is_foreign: bool, is_main: bool, name_is_raw: bool) anyerror!*Node {
|
||||
fn parseForeignClassDecl(self: *Parser, name: []const u8, start_pos: u32, runtime: ast.RuntimeKind, is_foreign: bool, is_main: bool, name_is_raw: bool) anyerror!*Node {
|
||||
self.advance(); // skip directive token
|
||||
|
||||
try self.expect(.l_paren);
|
||||
@@ -1399,7 +1399,7 @@ pub const Parser = struct {
|
||||
|
||||
try self.expect(.l_brace);
|
||||
|
||||
var members = std.ArrayList(ast.ForeignClassMember).empty;
|
||||
var members = std.ArrayList(ast.RuntimeClassMember).empty;
|
||||
while (self.current.tag != .r_brace and self.current.tag != .eof) {
|
||||
// #extends Alias; or #implements Alias;
|
||||
if (self.current.tag == .hash_extends or self.current.tag == .hash_implements) {
|
||||
|
||||
Reference in New Issue
Block a user