################################################################# ## MiniZinc ################################################################ ## ## TODO: Add description ## ################################################################ name = MiniZinc file_extensions [] = mzn; ################################################################ ## Constants ################################################################ __id \= (\b[A-Za-z][A-Za-z0-9_]*|'[^']*') ################################################################ ## Styles ################################################################ styles [] { .builtin : style { color = light_green ace_scope = support.function textmate_scope = support.function pygments_scope = Name.Builtin } .comment : style { color = yellow italic = true ace_scope = comment textmate_scope = comment pygments_scope = Comment } .constant : style { color = white ace_scope = constant.language textmate_scope = constant.language pygments_scope = Literal } .function : style { color = purple ace_scope = entity.name.function textmate_scope = entity.name.function pygments_scope = Name.Function } .global : style { color = green ace_scope = support.function textmate_scope = support.function pygments_scope = Name.Builtin.Pseudo } .illegal : style { color = white background_color = red ace_scope = invalid textmate_scope = invalid pygments_scope = Generic.Error } .keyword : style { color = cyan ace_scope = keyword.control textmate_scope = keyword.control pygments_scope = Keyword } .numeric : style { color = gold ace_scope = constant.numeric textmate_scope = constant.numeric pygments_scope = Number } .operator : style { color = orange ace_scope = keyword.operator textmate_scope = keyword.operator pygments_scope = Operator } .punctuation : style { color = red_2 ace_scope = punctuation textmate_scope = punctuation pygments_scope = Punctuation } .variable : style { color = violet ace_scope = variable textmate_scope = variable pygments_scope = Name.Variable } } ################################################# ## Parse contexts ################################################# contexts [] { ############################################## ## Main Context - Entry point context ############################################## main : context { ####################################### ## Comment Patterns ####################################### : include "multi_line_comment"; : pattern { regex \= (//.*) styles [] = .comment; } ####################################### ## Literal Patterns ####################################### : include "numeric"; } ################################################# ## End of Contexts ################################################# ########################################### ## Numeric Context ########################################### numeric : context { : pattern { description = integer number regex \= (\b\d+) styles [] = .numeric; } : pattern { description = octal integer number regex \= (\b0o[0-7]+) styles [] = .numeric; } : pattern { description = hexadecimal number regex \= (\b0x[0-9A-Fa-f]+) styles [] = .numeric; } : pattern { description = hexadecimal number regex \= (\b0x[0-9A-Fa-f]+) styles [] = .numeric; } : pattern { description = floating point number regex \= (\b\d+(?:.\d+|(?:.\d+)?[Ee][-+]?\d+)) styles [] = .numeric; } } ########################################### ## Multi Line Comment Context ########################################### multi_line_comment : context { description = multiline : inline_push { regex \= (/\*) styles [] = .comment; default_style = .comment : pop { regex \= (\*/) styles [] = .comment; } } } }