luaur_ast/methods/
ast_expr_constant_string_ast_expr_constant_string.rs1use crate::enums::quote_style_ast::QuoteStyle;
2use crate::records::ast_array::AstArray;
3use crate::records::ast_expr::AstExpr;
4use crate::records::ast_expr_constant_string::AstExprConstantString;
5use crate::records::ast_node::AstNode;
6use crate::records::location::Location;
7use crate::rtti::AstNodeClass;
8
9impl AstExprConstantString {
10 pub fn new(
11 location: Location,
12 value: AstArray<core::ffi::c_char>,
13 quote_style: QuoteStyle,
14 ) -> Self {
15 Self {
16 base: AstExpr {
17 base: AstNode {
18 class_index: <Self as AstNodeClass>::CLASS_INDEX,
19 location,
20 },
21 },
22 value,
23 quote_style,
24 }
25 }
26}
27
28#[allow(non_snake_case)]
29pub fn ast_expr_constant_string_ast_expr_constant_string(
30 location: Location,
31 value: AstArray<core::ffi::c_char>,
32 quote_style: QuoteStyle,
33) -> AstExprConstantString {
34 AstExprConstantString::new(location, value, quote_style)
35}