name = lama2 file_extensions [] = l2, lama2; contexts[] { main : context { : include "emptyline"; : push { uid = uid_lama_push description = lama2_block regex \= (GET|POST|PUT|DELETE|get|post|put|delete) styles [] = .keyword; context [] = root_lama; } : push { uid = uid_lama_push_comment description = lama2_block_comment regex \= (^\s*#.*) styles [] = .comment; context [] = root_lama; } : push { uid = uid_js_block1 description = js_block regex \= ((?!(#|GET|POST|PUT|DELETE|get|post|put|delete))) styles [] = .variable; context [] = root_javascript; } } separator : context { :pattern { regex \= (^---$) styles[] = .punctuation; } } emptyline : context { :pattern { regex \= (^\s*$) styles[] = .whitespace; } } root_lama : context { uid = uid_root_lama : pop { regex \= (^---$) styles [] = .punctuation; } : pattern { regex \= (#.*) styles[] = .comment; } : include "preamble"; : include "json"; : include "headers"; : include "varjson"; : include "files"; } ### Start Javascript contexts root_javascript : context { uid = uid_js_block2 : pop { uid = uid_js_pop1 regex \= (^---$) styles [] = .variable; } : include "js_keywords"; } js_keywords : context { : include "multi_line_comment"; : include "js_comment"; : include "js_string3"; : include "js_string1"; : include "js_string2"; : include "js_punctuation"; : include "js_call"; : include "js_keyword_new"; : include "js_storage_type"; : include "js_keyword_control_flow"; : include "js_variable"; : include "js_operator"; : include "numeric"; } js_keyword_new : context { : pattern { regex \= (?:\b)(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)(?:\b) styles[] = .js_keyword_new; } } js_operator : context { : pattern { regex \= (\+|-|\*|\/|=|>|<|>=|<=|&|\||%|!|\^|\(|\)) styles[] = .punctuation; } } js_punctuation: context { :pattern { regex \= ([.,\/#!$%\^&\*;:{}=\-_\[\]`~()]) styles[] = .punctuation; } } js_string1: context { description = jsstring : inline_push { regex \= (") styles [] = .punctuation; default_style = .text : pop { regex \= (") styles [] = .punctuation; } } } js_string2: context { description = jsstring : inline_push { regex \= (') styles [] = .punctuation; default_style = .text : pop { regex \= (') styles [] = .punctuation; } } } js_string3: context { description = jsstring : inline_push { regex \= (\`) styles [] = .punctuation; default_style = .text : pop { regex \= (\`) styles [] = .punctuation; } } } js_variable: context { uid = uid_js_var1 : pattern { uid = uid_js_var2 regex \= (?:\b)([_$a-zA-Z\xa0-\uffff][_$a-zA-Z0-9\xa0-\uffff]*)(?:\b) styles[] = .jsvariable; } } js_comment: context { : pattern { regex \= (//.*$) styles[] = .jscomment; } } js_storage_type : context { : pattern { regex \= (?:\b)(var|let|const)(?:\b) styles[] = .js_storage_type; } } js_call : context { : pattern { regex \= (?:\b)(\.[_$a-zA-Z\xa0-\uffff][_$a-zA-Z0-9\xa0-\uffff]*)(\() styles[] = .funcall, .punctuation; } } js_keyword_control_flow : context { : pattern { regex \= (?:\b)(return|yield)(?:\b) styles[] = .js_keyword_control_flow; } } numeric : context { : pattern { regex \= (\b\d+) styles [] = .numeric; } } multi_line_comment : context { description = multiline : inline_push { regex \= (/\*) styles [] = .jscomment; default_style = .jscomment : pop { regex \= (\*/) styles [] = .jscomment; } } } ### End javascript contexts varjson : context { : pattern { regex \= (.*)(=)([^#]+) styles[] = .hkey, .punctuation, .hval; } } files : context { : pattern { regex \= (.*)(@)([^#]+) styles[] = .hkey, .punctuation, .hval; } } headers : context { : pattern { regex \= (.*)(:)([^#]+) styles[] = .hkey, .punctuation, .hval; } } preamble : context { : pattern { regex \= (GET|POST|PUT|DELETE|get|post|put|delete) styles[] = .keyword; } : pattern { regex \= (MULTIPART|multipart) styles[] = .keyword; } : pattern { regex \= (https?|\$\{.*\})([^\s]+)(?:\b) styles[] = .variable, .punctuation; } : pattern { regex \= (\$\{.*\})(.*)(?:\b) styles[] = .punctuation; } } json : context { : inline_push { regex \= (\{) styles [] = .punctuation; : pop { regex \= (\}) styles [] = .punctuation; } : include "json" ; } : inline_push { regex \= (\[) styles [] = .punctuation; : pop { regex \= (\]) styles [] = .punctuation; } : include "json" ; } : pattern { regex \= (,|\:) styles [] = .punctuation; } : inline_push { regex \= (\") styles [] = .punctuation; : pop { regex \= (\") styles [] = .punctuation; } : pattern { regex \= ((?:\\u[0-9a-f]{4})|(?:\\["\\/bfnrt])) styles [] = .escape_char; } : pattern { regex \= ([^\"\\]+) styles [] = .attribute_value; } } : pattern { regex \= ((?:\-?(?:0|(?:[1-9][0-9]*)))(?:(?:\.[0-9]*)(?:(?:e|E)(?:\+|\-)[0-9]+)?)?) styles [] = .special; } : pattern { regex \= (true|false|null) styles [] = .special; } # : pattern { # regex \= ([^\s]) # styles [] = .illegal; # } } } styles[] { .whitespace : style { color = gold textmate_scope = keyword pygments_scope = Keyword } .keyword : style { color = gold textmate_scope = keyword pygments_scope = Keyword } .comment : style { color = gray textmate_scope = comment pygments_scope = Comment } .variable : style { color = green textmate_scope = variable pygments_scope = Name.Variable } .hkey : style { color = blue textmate_scope = constant.language pygments_scope = Name.Constant } .hval : style { color = green textmate_scope = string.source pygments_scope = Literal } .escape_char : style { textmate_scope = constant.character.escape pygments_scope = String.Escape color = green background_color = yellow } .illegal : style { textmate_scope = invalid.illegal pygments_scope = Generic.Error color = white background_color = red } .punctuation : style { textmate_scope = keyword.operator pygments_scope = Punctuation color = red_2 } .attribute_value : style { textmate_scope = string.unquoted pygments_scope = String.Char color = gold } .special : style { textmate_scope = storage.type pygments_scope = Keyword.Type color = red } ## js styles start .jscomment : style { color = grey italic = true ace_scope = comment textmate_scope = comment pygments_scope = Comment } .comment_text : style { color = grey italic = true ace_scope = comment textmate_scope = comment pygments_scope = Comment } .comment_open : style { color = grey italic = true ace_scope = comment textmate_scope = comment pygments_scope = Comment } .comment_close : style { color = grey italic = true ace_scope = comment textmate_scope = comment pygments_scope = Comment } .comment_illegal : style { color = white background_color = red ace_scope = invalid textmate_scope = invalid pygments_scope = Generic.Error } .jskeyword : style { color = cyan ace_scope = keyword textmate_scope = keyword pygments_scope = Keyword } .funcall : style { color = orange ace_scope = keyword textmate_scope = keyword pygments_scope = Keyword } .numeric : style { color = gold ace_scope = constant.numeric textmate_scope = constant.numeric pygments_scope = Number } .jspunctuation : style { color = red_2 ace_scope = punctuation textmate_scope = punctuation pygments_scope = Punctuation } .text : style { color = yellow ace_scope = text textmate_scope = text pygments_scope = String } .jsvariable : style { color = brown ace_scope = text textmate_scope = text pygments_scope = String } .jsillegal : style { color = white background_color = red ace_scope = invalid textmate_scope = invalid pygments_scope = Generic.Error } .tag_open : style { color = gold ace_scope = constant.numeric textmate_scope = constant.numeric pygments_scope = Number } .tag_close : style { color = gold ace_scope = constant.numeric textmate_scope = constant.numeric pygments_scope = Number } .tag_keyword : style { color = gold ace_scope = constant.numeric textmate_scope = constant.numeric pygments_scope = Number } .string_begin : style { color = gold textmate_scope = punctuation.definition.string.begin pygments_scope = String } .string_end : style { color = gold textmate_scope = punctuation.definition.string.begin pygments_scope = String } .test : style { color = purple ace_scope = constant.numeric textmate_scope = constant.numeric pygments_scope = Number } .attribute_name : style { color = light_green textmate_scope = entity.other.attribute-name } .attribute_assignment : style { color = white textmate_scope = punctuation.separator.key-value } .string_unquoted : style { color = brown textmate_scope = string.unquoted } # Uncaught pops should never be visible .uncaught_pop : style { color = grey } .js_keyword_new : style { color = light_blue textmate_scope = keyword.operator.new } .js_storage_type : style { color = cyan textmate_scope = storage.type.js } .js_keyword_control_flow : style { color = red textmate_scope = keyword.control.flow } }