Skip to main content

luaur_ast/methods/
ast_expr_interp_string_ast_expr_interp_string.rs

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