feat: 搭建原生函数基础设施

This commit is contained in:
爱特每羊队
2026-06-07 01:07:45 +08:00
parent 67b5837379
commit 5d354ddb06
17 changed files with 271 additions and 15 deletions
@@ -73,6 +73,13 @@ impl SymbolTable {
reg_for_new
}
pub fn pre_register_global(&mut self, name: &str, reg: u8) {
self.scopes[0].entry(name.to_string()).or_insert(Binding {
reg,
initialized: true,
});
}
pub fn init_var(&mut self, name: &str) {
let current = self.scopes.last_mut().unwrap();
if let Some(b) = current.get_mut(name) {