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

Method generate_method

aiscript-vm/src/compiler/codegen.rs:1395–1421  ·  view source on GitHub ↗
(
        &mut self,
        FunctionDecl {
            name,
            mangled_name,
            params,
            return_type,
            body,
            fn_type,
            ..
        }: Fu

Source from the content-addressed store, hash-verified

1393 }
1394
1395 fn generate_method(
1396 &mut self,
1397 FunctionDecl {
1398 name,
1399 mangled_name,
1400 params,
1401 return_type,
1402 body,
1403 fn_type,
1404 ..
1405 }: FunctionDecl<'gc>,
1406 ) -> Result<(), VmError> {
1407 self.generate_function(
1408 name.lexeme,
1409 &mangled_name,
1410 params,
1411 return_type,
1412 body,
1413 fn_type,
1414 )?;
1415 let method_constant = self.identifier_constant(name.lexeme);
1416 self.emit(OpCode::Method {
1417 name_constant: method_constant as u8,
1418 is_static: fn_type.is_static_method(),
1419 });
1420 Ok(())
1421 }
1422
1423 fn generate_function(
1424 &mut self,

Callers 2

generate_stmtMethod · 0.80
generate_classMethod · 0.80

Calls 4

generate_functionMethod · 0.80
identifier_constantMethod · 0.80
emitMethod · 0.80
is_static_methodMethod · 0.80

Tested by

no test coverage detected