luaur-compiler 0.1.3

Luau source-to-bytecode compiler (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use luaur_ast::records::ast_expr_table::AstExprTable;
use luaur_ast::records::ast_name::AstName;

use luaur_common::records::dense_hash_pointer::DenseHashPointer;

use std::hash::{Hash, Hasher};

pub fn shape_visitor_hasher_operator_call(p: (*mut AstExprTable, AstName)) -> usize {
    let mut state = std::collections::hash_map::DefaultHasher::new();
    p.1.hash(&mut state);
    let name_hash = state.finish() as usize;
    DenseHashPointer.call(p.0 as *const core::ffi::c_void) ^ name_hash
}