INNER CODE UNIT · Python

get_actual_tk_max

KnifeXRage/Godot-Secure · Godot Secure Scripts/universal/Godot Secure AES-256 Universal v6.py:129

def get_actual_tk_max(tokenizer_h_path):
    if not os.path.exists(tokenizer_h_path):
        raise FileNotFoundError(f"Could not locate gdscript_tokenizer.h at: {tokenizer_h_path}")

    with open(tokenizer_h_path, "r", encoding="utf-8") as f:
        content = f.read()

    # Locate the enum Type block
    match = re.search(r"enum\s+Type\s*\{([\s\S]*?)\bTK_MAX\b", content)
    if not match:
        raise ValueError("Could not find 'enum Type' containing 'TK_MAX' in gdscript_tokenizer.h")

    body = re.sub(r"//.*", "", match.group(1))
    tokens = [item.strip() for item in body.split(",") if item.strip()]
    return len(tokens)


def apply_buffer_scramble(filepath, buffer_seed):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…