name = dpscript_ir file_extensions [] = dpir; textmate_uuid = ae8328da-80d6-42c8-b2a2-03468f3b0819 # ============== Constants ============== __KEYWORDS \= \b(func|define|command|argument|call|tag|entry|goto|condition|if|else|join) __IDENTIFIER \= \b([A-Za-z_$][\w$]*) __SUB_KEYWORD \= \b(copy|append|set|get|variable_alias)\b # ============== Styles ============== styles [] { .comment : style { color = green italic = true ace_scope = comment textmate_scope = comment pygments_scope = Comment } .keyword : style { color = orange ace_scope = keyword textmate_scope = keyword pygments_scope = Keyword } .ident : style { color = light_blue ace_scope = entity.name textmate_scope = entity.name pygments_scope = Name.Entity } .type : style { color = gold ace_scope = entity.name.type textmate_scope = entity.name.type pygments_scope = Keyword.Type } .sub_keyword : style { color = yellow ace_scope = entity.name.tag textmate_scope = entity.name.tag pygments_scope = Name.Label } .block : style { color = gold ace_scope = entity.name.other textmate_scope = entity.name.other pygments_scope = Name.Other } .numeric : style { color = gold ace_scope = constant.numeric textmate_scope = constant.numeric pygments_scope = Number } .punctuation : style { color = violet ace_scope = punctuation textmate_scope = punctuation pygments_scope = Punctuation } .string : style { color = brown ace_scope = string textmate_scope = string pygments_scope = String } .illegal : style { color = white background_color = red ace_scope = invalid textmate_scope = invalid pygments_scope = Generic.Error } } # ============== Contexts ============== contexts [] { main : context { : pattern { regex \= (//.*) styles [] = .comment; } : pattern { regex \= $${__KEYWORDS} styles [] = .keyword; } : pattern { regex \= (^(\s+)?data) styles [] = .keyword; } : pattern { regex \= $${__SUB_KEYWORD} styles [] = .sub_keyword; } : pattern { regex \= (\$$${__IDENTIFIER}) styles [] = .block; } : pattern { regex \= $${__IDENTIFIER} styles [] = .ident; } : include "numeric" ; : inline_push { regex \= (\{) styles [] = .punctuation; : pop { regex \= (\};) styles [] = .punctuation; } : include "main" ; } : pattern { regex \= (&|=|;|,|@|\+|\!|:|%) styles [] = .punctuation; } : inline_push { regex \= (') styles [] = .string; default_style = .string : pop { regex \= ([^\\]') styles [] = .string; } } : inline_push { regex \= (\") styles [] = .string; default_style = .string : pop { regex \= ([^\\]\") styles [] = .string; } } : pattern { regex \= (\(|\)|\{|\}|\[|\]) styles [] = .punctuation; } : pattern { regex \= ([^\s]) styles [] = .illegal; } } # ============== Numeric ============== numeric : context { : pattern { regex \= (\b\d+) styles [] = .numeric; } } }