# this characters need escaping . ^ $ * + ? { } [ ] \ | ( )
import bslint.constants as const

List = [
    (r"\n", const.NEW_LINE, const.NO_INDENTATION),
    (r"\s+", None, const.NO_INDENTATION),

    ("\+=", const.OPERATOR, const.NO_INDENTATION),
    ("-=", const.OPERATOR, const.NO_INDENTATION),
    ("\*=", const.OPERATOR, const.NO_INDENTATION),
    ("/=", const.OPERATOR, const.NO_INDENTATION),
    (r"\\=", const.OPERATOR, const.NO_INDENTATION),  # divide integer
    ("<<=", const.OPERATOR, const.NO_INDENTATION),
    (">>=", const.OPERATOR, const.NO_INDENTATION),
    ("<>", const.OPERATOR, const.NO_INDENTATION),
    (">=", const.OPERATOR, const.NO_INDENTATION),
    ("<=", const.OPERATOR, const.NO_INDENTATION),
    (">=", const.OPERATOR, const.NO_INDENTATION),
    ("=>", const.OPERATOR, const.NO_INDENTATION),
    ("=<", const.OPERATOR, const.NO_INDENTATION),

    (">>", const.OPERATOR, const.NO_INDENTATION),
    ("<<", const.OPERATOR, const.NO_INDENTATION),

    (r"\.", const.SPECIAL_OPERATOR, const.NO_INDENTATION),
    (":", const.SPECIAL_OPERATOR, const.NO_INDENTATION),
    (r"\^", const.OPERATOR, const.NO_INDENTATION),
    ("=", const.OPERATOR, const.NO_INDENTATION),
    ("-", const.OPERATOR, const.NO_INDENTATION),
    ("\+", const.OPERATOR, const.NO_INDENTATION),
    ("\*", const.OPERATOR, const.NO_INDENTATION),
    (r"/", const.OPERATOR, const.NO_INDENTATION),
    ("<", const.OPERATOR, const.NO_INDENTATION),
    (">", const.OPERATOR, const.NO_INDENTATION),

    (r"\(", const.BRACKET, const.NO_INDENTATION),
    (r"\)", const.BRACKET, const.NO_INDENTATION),
    (r"\[", const.SQUARE_BRACKET, const.NO_INDENTATION),
    (r"\]", const.SQUARE_BRACKET, const.NO_INDENTATION),
    (r"\{", const.CURLY_BRACKET, const.NO_INDENTATION),
    (r"\}", const.CURLY_BRACKET, const.NO_INDENTATION),
    (",", const.SPECIAL_OPERATOR, const.NO_INDENTATION),
    (r"(TRUE)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(GETLASTRUNCOMPILEERROR)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(GETLASTRUNRUNTIMEERROR)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(GETGLOBALAA)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(ELSE IF)\b", const.KEYWORD, const.SPECIAL_INDENTATION),
    (r"(END IF)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(EXIT FOR)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(FOR EACH)\b", const.KEYWORD, const.INCREMENT_INDENTATION),
    (r"(END FOR)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(END WHILE)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(EXIT WHILE)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(END FUNCTION)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(END SUB)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(LINE_NUM)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(GOTO)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(CREATEOBJECT)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(ELSEIF)\b", const.KEYWORD, const.SPECIAL_INDENTATION),
    (r"(ENDIF)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(ENDWHILE)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(EXITWHILE)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(ENDFUNCTION)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(ENDSUB)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(OBJFUN)\b", const.KEYWORD, const.NO_INDENTATION),

    (r"(IF)\b", const.KEYWORD, const.INCREMENT_INDENTATION),
    (r"(THEN)\b", const.KEYWORD, const.INCREMENT_INDENTATION),
    (r"(ELSE)\b", const.KEYWORD, const.SPECIAL_INDENTATION),
    (r"(FOR)\b", const.KEYWORD, const.INCREMENT_INDENTATION),
    (r"(TO)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(STEP)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(INVALID)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(IN)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(WHILE)\b", const.KEYWORD, const.INCREMENT_INDENTATION),
    (r"(FUNCTION)\b", const.KEYWORD, const.INCREMENT_INDENTATION),
    (r"(AS)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(RETURN)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(PRINT)\b", const.PRINT_KEYWORD, const.NO_INDENTATION),
    (r"(DIM)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(END)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(MOD)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(STOP)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(AND)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(BOX)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(EACH)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(EVAL)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(EXIT)\b", const.KEYWORD, const.DECREMENT_INDENTATION),
    (r"(FALSE)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(LET)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(NEXT)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(NOT)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(OR)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(POS)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"('|rem) *(BSLINT)_(?P<command>[a-z_]+)(:(?P<param>[0-9]+))?.*", const.BSLINT_COMMAND, const.NO_INDENTATION),
    (r"('|REM)(.*)", const.COMMENT, const.NO_INDENTATION),
    (r"(RUN)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(SUB)\b", const.KEYWORD, const.INCREMENT_INDENTATION),
    (r"(TAB)\b", const.KEYWORD, const.NO_INDENTATION),
    (r"(TYPE)\b", const.KEYWORD, const.NO_INDENTATION),


    (r"(MAIN)\b", const.KEYWORD, const.NO_INDENTATION),
    ("\?", const.PRINT_KEYWORD, const.NO_INDENTATION),

    (r"(?P<value>^[a-z_][a-z0-9_]*)(?P<type>\$|%|!|#|&?)", const.ID, const.NO_INDENTATION),
    ('\"(.*)\"', const.STRING, const.NO_INDENTATION),
    (r"^\d*(\.?\d+){1}", const.NUMERIC, const.NO_INDENTATION)
]
