luaur_ast/methods/
cst_expr_constant_string_cst_expr_constant_string.rs1use crate::records::ast_array::AstArray;
2use crate::records::cst_expr_constant_string::CstExprConstantString;
3use crate::records::cst_node::CstNode;
4use crate::rtti::CstNodeClass;
5
6impl CstExprConstantString {
7 #[allow(non_snake_case)]
8 pub fn new(
9 source_string: AstArray<core::ffi::c_char>,
10 quote_style: crate::enums::quote_style_cst::QuoteStyle,
11 block_depth: core::ffi::c_uint,
12 ) -> Self {
13 luaur_common::LUAU_ASSERT!(
14 block_depth == 0 || quote_style == crate::enums::quote_style_cst::QuoteStyle::QuotedRaw
15 );
16
17 Self {
18 base: CstNode {
19 class_index: <Self as CstNodeClass>::CLASS_INDEX,
20 },
21 source_string,
22 quote_style,
23 block_depth,
24 }
25 }
26}
27
28#[allow(non_snake_case)]
29pub fn cst_expr_constant_string_cst_expr_constant_string(
30 source_string: AstArray<core::ffi::c_char>,
31 quote_style: crate::enums::quote_style_cst::QuoteStyle,
32 block_depth: core::ffi::c_uint,
33) -> CstExprConstantString {
34 CstExprConstantString::new(source_string, quote_style, block_depth)
35}