Skip to main content

luaur_ast/methods/
ast_expr_error_ast_expr_error.rs

1use crate::records::ast_array::AstArray;
2use crate::records::ast_expr::AstExpr;
3use crate::records::ast_expr_error::AstExprError;
4use crate::records::ast_node::AstNode;
5use crate::records::location::Location;
6use crate::rtti::AstNodeClass;
7
8impl AstExprError {
9    pub fn new(
10        location: Location,
11        expressions: AstArray<*mut AstExpr>,
12        message_index: u32,
13    ) -> Self {
14        Self {
15            base: AstExpr {
16                base: AstNode {
17                    class_index: <Self as AstNodeClass>::CLASS_INDEX,
18                    location,
19                },
20            },
21            expressions,
22            message_index,
23        }
24    }
25}
26
27#[allow(non_snake_case)]
28pub fn ast_expr_error_ast_expr_error(
29    location: Location,
30    expressions: AstArray<*mut AstExpr>,
31    message_index: u32,
32) -> AstExprError {
33    AstExprError::new(location, expressions, message_index)
34}