Skip to main content

luaur_ast/methods/
ast_stat_block_ast_stat_block.rs

1use crate::records::ast_array::AstArray;
2use crate::records::ast_node::AstNode;
3use crate::records::ast_stat::AstStat;
4use crate::records::ast_stat_block::AstStatBlock;
5use crate::records::location::Location;
6use crate::rtti::AstNodeClass;
7
8impl AstStatBlock {
9    pub fn new(location: Location, body: AstArray<*mut AstStat>, has_end: bool) -> Self {
10        Self {
11            base: AstStat {
12                base: AstNode {
13                    class_index: <Self as crate::rtti::AstNodeClass>::CLASS_INDEX,
14                    location,
15                },
16                has_semicolon: false,
17            },
18            body,
19            has_end,
20        }
21    }
22}
23
24#[allow(non_snake_case)]
25pub fn ast_stat_block_ast_stat_block(
26    location: Location,
27    body: AstArray<*mut AstStat>,
28    has_end: bool,
29) -> AstStatBlock {
30    AstStatBlock::new(location, body, has_end)
31}