Skip to main content

luaur_ast/methods/
ast_expr_constant_integer_ast_expr_constant_integer.rs

1use crate::enums::constant_number_parse_result::ConstantNumberParseResult;
2use crate::records::ast_expr::AstExpr;
3use crate::records::ast_expr_constant_integer::AstExprConstantInteger;
4use crate::records::ast_node::AstNode;
5use crate::records::location::Location;
6use crate::rtti::AstNodeClass;
7
8impl AstExprConstantInteger {
9    pub fn new(location: Location, value: i64, parse_result: ConstantNumberParseResult) -> Self {
10        Self {
11            base: AstExpr {
12                base: AstNode {
13                    class_index: <Self as AstNodeClass>::CLASS_INDEX,
14                    location,
15                },
16            },
17            value,
18            parse_result,
19        }
20    }
21}
22
23#[allow(non_snake_case)]
24pub fn ast_expr_constant_integer_ast_expr_constant_integer(
25    location: Location,
26    value: i64,
27    parse_result: ConstantNumberParseResult,
28) -> AstExprConstantInteger {
29    AstExprConstantInteger::new(location, value, parse_result)
30}