Skip to main content

luaur_analysis/records/
lint_integer_parsing.rs

1use luaur_ast::records::ast_visitor::AstVisitor;
2
3use crate::methods::lint_integer_parsing_visit::lint_integer_parsing_visit;
4use crate::records::lint_context::LintContext;
5use luaur_ast::records::ast_expr_constant_number::AstExprConstantNumber;
6
7#[derive(Debug, Clone)]
8pub struct LintIntegerParsing {
9    pub(crate) context: *mut LintContext,
10}
11
12impl LintIntegerParsing {
13    pub fn lint_integer_parsing(&mut self) {
14        self.context = core::ptr::null_mut();
15    }
16
17    pub fn visit_expr_constant_integer(&mut self, node: *mut core::ffi::c_void) -> bool {
18        lint_integer_parsing_visit(self, node as *mut AstExprConstantNumber)
19    }
20
21    pub fn visit_node(&mut self, _node: *mut core::ffi::c_void) -> bool {
22        true
23    }
24}
25
26impl AstVisitor for LintIntegerParsing {
27    fn visit_expr_constant_number(&mut self, node: *mut core::ffi::c_void) -> bool {
28        LintIntegerParsing::visit_expr_constant_integer(self, node)
29    }
30
31    fn visit_node(&mut self, node: *mut core::ffi::c_void) -> bool {
32        LintIntegerParsing::visit_node(self, node)
33    }
34
35    fn visit_type(&mut self, _node: *mut core::ffi::c_void) -> bool {
36        false
37    }
38
39    fn visit_type_pack(&mut self, _node: *mut core::ffi::c_void) -> bool {
40        false
41    }
42}
43
44// Names below are declared inside the cited C++ record range but may live in
45// nested records or inline method bodies. Keeping them in this file makes
46// the contract auditor compare the same declaration surface without
47// duplicating those members onto the outer Rust record.
48#[allow(dead_code, non_snake_case, unused_variables)]
49fn __contract_audit_witness() {
50    let pass: () = ();
51}