luaur-analysis 0.1.0

Luau type checker and type inference (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Node: `cxx:Method:Luau.Analysis:Analysis/src/ToString.cpp:191:stringifier_state_has_seen`
//! Source: `Analysis/src/ToString.cpp:191-199` (hand-ported)

use crate::records::stringifier_state::StringifierState;
use core::ffi::c_void;

impl StringifierState {
    /// C++ `bool hasSeen(const void* tv)`.
    pub fn has_seen(&mut self, tv: *const c_void) -> bool {
        let ttv = tv as *mut c_void;
        if self.seen.contains(&ttv) {
            return true;
        }

        self.seen.insert(&ttv);
        false
    }
}