name = iro file_extensions [] = iro; textmate_uuid = e0fbbdae-90c3-466f-a089-6436289cb493 # ============== Constants ============== __KEYWORDS \= \b(styles|contexts) __IDENTIFIER \= \b([a-z_$][\w$]*) __PUNCT \= \b([;.,:&-><#]+) __BUILTINS \= \b(name|file_extensions|textmate_uuid|regex|color|ace_scope|textmate_scope|pygments_scope|include|pattern|style|context) # ============== 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 } .builtin : style { color = cyan ace_scope = support.function textmate_scope = support.function pygments_scope = Keyword.Reserved } .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 \= $${__KEYWORDS} styles [] = .keyword; } : pattern { regex \= $${__BUILTINS} styles [] = .builtin; } : pattern { regex \= $${__IDENTIFIER} styles [] = .ident; } : inline_push { regex \= ((\\)?=) styles [] = .punctuation; default_style = .string : eol_pop {} } : inline_push { regex \= (\") styles [] = .string; default_style = .string : pop { regex \= (\") styles [] = .string; } } : include "numeric" ; : inline_push { regex \= (\{) styles [] = .punctuation; : pop { regex \= (\};) styles [] = .punctuation; } : include "main" ; } : pattern { regex \= $${__PUNCT} styles [] = .punctuation; } : pattern { regex \= (&|=|;|,) styles [] = .punctuation; } : pattern { regex \= (\(|\)|\{|\}|\[|\]|\.|\+|\*|\-|\\|\||:) styles [] = .punctuation; } : pattern { regex \= (^(\s+)?#.*) styles [] = .comment; } : pattern { regex \= ([^\s]) styles [] = .illegal; } } # ============== Numeric ============== numeric : context { : pattern { regex \= (\b\d+) styles [] = .numeric; } } }