MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / make_constant

Method make_constant

aiscript-vm/src/compiler/codegen.rs:1749–1757  ·  view source on GitHub ↗

Constants and identifiers

(&mut self, value: Value<'gc>)

Source from the content-addressed store, hash-verified

1747
1748 // Constants and identifiers
1749 fn make_constant(&mut self, value: Value<'gc>) -> usize {
1750 let constant = self.function.add_constant(value);
1751 if constant > u8::MAX as usize {
1752 self.error_at_value(value, "Too many constants in one chunk.");
1753 0
1754 } else {
1755 constant
1756 }
1757 }
1758
1759 fn identifier_constant(&mut self, name: &str) -> usize {
1760 let s = self.ctx.intern(name.as_bytes());

Callers 3

generate_stmtMethod · 0.80
emit_constantMethod · 0.80
identifier_constantMethod · 0.80

Calls 2

add_constantMethod · 0.80
error_at_valueMethod · 0.80

Tested by

no test coverage detected