luaur_ast/methods/
ast_stat_function_ast_stat_function.rs1use crate::records::ast_expr::AstExpr;
2use crate::records::ast_expr_function::AstExprFunction;
3use crate::records::ast_node::AstNode;
4use crate::records::ast_stat::AstStat;
5use crate::records::ast_stat_function::AstStatFunction;
6use crate::records::location::Location;
7use crate::rtti::AstNodeClass;
8
9impl AstStatFunction {
10 pub fn new(location: Location, name: *mut AstExpr, func: *mut AstExprFunction) -> Self {
11 Self {
12 base: AstStat {
13 base: AstNode {
14 class_index: <Self as AstNodeClass>::CLASS_INDEX,
15 location,
16 },
17 has_semicolon: false,
18 },
19 name,
20 func,
21 }
22 }
23}
24
25#[allow(non_snake_case)]
26pub fn ast_stat_function_ast_stat_function(
27 location: Location,
28 name: *mut AstExpr,
29 func: *mut AstExprFunction,
30) -> AstStatFunction {
31 AstStatFunction::new(location, name, func)
32}