use std::collections::BTreeSet;

use egui_code_editor::Syntax;

pub fn dsa() -> Syntax {
    Syntax {
        quotes: BTreeSet::from(['"', '\'']),
        language: "Assembly",
        case_sensitive: false,
        comment: "//",
        comment_multiline: ["/*", "*/"],
        hyperlinks: BTreeSet::from(["HTTP", "HTTPS"]),
        keywords: BTreeSet::from([
            "NOP", "MOV", "CMOV", "LDB", "LDBS", "LDH", "LDHS", "LDW", "STB", "STH", "STW", "LLI",
            "LUI", "LWI", "JMP", "JNZ", "JEZ", "JNC", "JIC", "IEQ", "INE", "IGE", "IGT", "ILE",
            "ILT", "SHL", "SHR", "ADD", "SUB", "AND", "OR", "NOT", "XOR", "NAND", "NOR", "XNOR",
            "IRET", "RET", "CALL", "INT", "PUSH", "POP", "HLT",
        ]),
        types: BTreeSet::from(["DB", "DW", "DH", "RESB", "RESH", "RESW", "INCLUDE"]),
        special: BTreeSet::from([
            "RG0", "RG1", "RG2", "RG3", "RG4", "RG5", "RG6", "RG7", "RG8", "RG9", "RGA", "RGB",
            "RGC", "RGD", "RGE", "RGF", "ACC", "SPR", "BPR", "IDR", "MMR", "ZERO", "PCX", "STS",
            "CIR",
        ]),
    }
}

pub fn dsc() -> Syntax {
    Syntax {
        quotes: BTreeSet::from(['"', '\'', '`']),
        language: "Damn Simple Code",
        case_sensitive: false,
        comment: "//",
        comment_multiline: ["/*", "*/"],
        hyperlinks: BTreeSet::from(["HTTP", "HTTPS"]),
        keywords: BTreeSet::from([
            "INCLUDE", "FN", "LET", "CONST", "STATIC", "IF", "ELSE", "WHILE", "FOR", "BREAK",
            "CONTINUE", "LOOP", "RETURN", "CLASS", "DEFER", "PUB", "CONST",
        ]),
        types: BTreeSet::from([
            "U32", "U16", "U8", "I32", "I16", "I8", "STR", "CHAR", "BOOL", "VOID",
        ]),
        special: BTreeSet::from([
            ",", ";", ".", ":", "=", "+", "-", "*", "/", "%", "&", "|", "^", "~", "!", "?", "<",
            ">", "<<", ">>", "==", "!=", "<=", ">=", "&&", "||",
        ]),
    }
}
