MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / emit_name_list

Method emit_name_list

compiler/src/modules/parser/stmt.rs:300–309  ·  view source on GitHub ↗

Emits Global/Nonlocal opcodes for a comma-separated name list. For Global, also registers each name so subsequent loads/stores route through LoadGlobal/StoreGlobal. */

(&mut self, op: OpCode)

Source from the content-addressed store, hash-verified

298
299 /* Emits Global/Nonlocal opcodes for a comma-separated name list. For Global, also registers each name so subsequent loads/stores route through LoadGlobal/StoreGlobal. */
300 pub(super) fn emit_name_list(&mut self, op: OpCode) {
301 self.advance();
302 loop {
303 let name = self.advance_text();
304 let idx = self.chunk.push_name(&name);
305 self.chunk.emit(op, idx);
306 if matches!(op, OpCode::Global) { self.globals_decl.insert(name); }
307 if !self.eat_if(TokenType::Comma) { break; }
308 }
309 }
310
311 pub(super) fn compile_block(&mut self) { self.compile_block_inner(false); }
312 pub(super) fn compile_block_body(&mut self) { self.compile_block_inner(true); }

Callers 1

stmtMethod · 0.80

Calls 6

advanceMethod · 0.80
advance_textMethod · 0.80
push_nameMethod · 0.80
emitMethod · 0.80
insertMethod · 0.80
eat_ifMethod · 0.80

Tested by

no test coverage detected