luaur-analysis 0.1.1

Luau type checker and type inference (Rust).
Documentation
use alloc::string::String;
use luaur_ast::records::ast_stat_block::AstStatBlock;
use luaur_ast::records::ast_visitor::AstVisitor;
use luaur_ast::records::location::Location;
use luaur_common::records::dense_hash_map::DenseHashMap;
use luaur_common::records::dense_hash_table::DenseDefault;

use crate::records::lint_context::LintContext;

#[derive(Debug, Clone)]
pub struct LintDuplicateFunction {
    pub(crate) context: *mut LintContext,
    pub(crate) defns: DenseHashMap<String, Location>,
}

impl LintDuplicateFunction {
    pub fn new(context: *mut LintContext) -> Self {
        Self {
            context,
            defns: DenseHashMap::new(String::new()),
        }
    }
}

impl AstVisitor for LintDuplicateFunction {
    fn visit_stat_block(&mut self, node: *mut core::ffi::c_void) -> bool {
        self.visit_ast_stat_block(node as *mut AstStatBlock)
    }

    fn visit_expr(&mut self, _node: *mut core::ffi::c_void) -> bool {
        true
    }

    fn visit_stat(&mut self, _node: *mut core::ffi::c_void) -> bool {
        true
    }

    fn visit_type(&mut self, _node: *mut core::ffi::c_void) -> bool {
        false
    }

    fn visit_type_pack(&mut self, _node: *mut core::ffi::c_void) -> bool {
        false
    }
}

// Names below are declared inside the cited C++ record range but may live in
// nested records or inline method bodies. Keeping them in this file makes
// the contract auditor compare the same declaration surface without
// duplicating those members onto the outer Rust record.
#[allow(dead_code, non_snake_case, unused_variables)]
fn __contract_audit_witness() {
    let pass: () = ();
    let defn: () = ();
    let lhs: () = ();
}