Skip to main content

luaur_analysis/records/
lint_same_line_statement.rs

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