INNER CODE UNIT · Python
print_warning
KnifeXRage/Godot-Secure · Godot Secure Scripts/universal/Godot Secure AES-256 Universal v6.py:125
def print_warning(message):
save_log(f"\n[WARN] - {message}")
print(f"\n{LogColors.WARNING} ⚠ {LogColors.ENDC} {message}")
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()]