(
&mut self,
FunctionDecl {
name,
mangled_name,
params,
return_type,
body,
fn_type,
..
}: Fu
| 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, |
no test coverage detected