MCPcopy Index your code
hub / github.com/endbasic/endbasic / emit

Method emit

core/src/compiler/codegen.rs:81–89  ·  view source on GitHub ↗

Appends a new instruction `op` generated at `pos` to the code and returns its address.

(&mut self, op: u32, pos: LineCol)

Source from the content-addressed store, hash-verified

79
80 /// Appends a new instruction `op` generated at `pos` to the code and returns its address.
81 pub(super) fn emit(&mut self, op: u32, pos: LineCol) -> Address {
82 self.code.push(op);
83 self.instrs.push(InstrMetadata {
84 linecol: pos,
85 is_stmt_start: false,
86 arg_linecols: vec![],
87 });
88 self.code.len() - 1
89 }
90
91 /// Marks the instruction at `addr` as the start of a statement.
92 pub(super) fn mark_statement_start(&mut self, addr: Address) {

Callers 15

compile_array_accessFunction · 0.80
cast_numerical_typeFunction · 0.80
compile_pending_opsFunction · 0.80
compile_exprFunction · 0.80
emit_defaultMethod · 0.80
emit_valueMethod · 0.80
compile_assignmentFunction · 0.80
compile_case_relopFunction · 0.80
compile_case_guardFunction · 0.80
compile_selectFunction · 0.80
compile_doFunction · 0.80
compile_forFunction · 0.80

Calls 2

pushMethod · 0.80
lenMethod · 0.45