diff --git a/src/mode/_test/text_javascript.txt b/src/mode/_test/text_javascript.txt index faa075282da..b9c65d9fabd 100644 --- a/src/mode/_test/text_javascript.txt +++ b/src/mode/_test/text_javascript.txt @@ -81,7 +81,7 @@ a = { z>>=t<>r>>>s>=0b1 -foo.protoype.d = function(a, b, +foo.prototype.d = function(a, b, c, d) foo.d =function(a, b) foo.d =function(a, /*****/ d"string" @@ -160,4 +160,19 @@ async param => expression; }}/> { console.log("Test") -}}/> \ No newline at end of file +}}/> + +//test different generator functions use cases +function* generator() {} +function*generator() {} +Sound.play = function* play() { } +foobar: function * () { } + +//func's args shouldn't be determined as arrow function +func (a,b,1,2,3, async () => {}) +func(a,b,innerCall(c,d), () => {}) + +//async arrow function with default params +async (param1, param2, ...paramN) => { + statements +} diff --git a/src/mode/_test/tokens_flix.json b/src/mode/_test/tokens_flix.json index 2182c6d9a98..cb1bc7137f6 100644 --- a/src/mode/_test/tokens_flix.json +++ b/src/mode/_test/tokens_flix.json @@ -1,293 +1,299 @@ [[ - "start", - ["text", " "] + "start", + ["text"," "] ],[ - "start", - ["comment.block", "/* Hello comment */"], - ["text", "\n"], - ["comment.block", "/* Hello \n comment */"], - ["text", "\n"], - ["comment.line", "// Hello comment"] + "start", + ["comment.block","/* Hello comment */"] ],[ - "start", - ["keyword", "use"], - ["text", " "], - ["identifier", "Add"], - ["text", "."], - ["identifier", "add"] + "comment", + ["comment.block","/* Hello "] ],[ - "start", - ["storage.type", "mod"], - ["text", " "], - ["paren.lparen", "{"], - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "Int32"], - ["text", " = "], - ["constant.numeric", "42"], - ["paren.rparen", "}"] + "start", + ["comment.block"," comment */"] ],[ - "start", - ["storage.type", "class"], - ["text", " "], - ["identifier", "Add"], - ["paren.lparen", "["], - ["identifier", "a"], - ["paren.rparen", "]"], - ["text", " "], - ["paren.lparen", "{"], - ["paren.rparen", "}"] + "start", + ["comment.line","// Hello comment"] ],[ - "start", - ["storage.type", "enum"], - ["text", " "], - ["identifier", "Down"], - ["paren.lparen", "["], - ["identifier", "a"], - ["paren.rparen", "]"], - ["text", " "], - ["storage.modifier", "with"], - ["text", " "], - ["identifier", "Sendable"], - ["text", " "], - ["paren.lparen", "{"], - ["storage.type", "case"], - ["text", " "], - ["identifier", "Down"], - ["paren.lparen", "("], - ["identifier", "a"], - ["paren.rparen", ")}"] + "start", + ["keyword","use"], + ["text"," "], + ["identifier","Add"], + ["text","."], + ["identifier","add"] ],[ - "start", - ["storage.type", "eff"], - ["text", " "], - ["identifier", "NonDet"] + "start", + ["storage.type","mod"], + ["text"," "], + ["paren.lparen","{"], + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","Int32"], + ["text"," = "], + ["constant.numeric","42"], + ["paren.rparen","}"] ],[ - "start", - ["storage.type", "type"], - ["text", " "], - ["storage.type", "alias"], - ["text", " "], - ["identifier", "Static"], - ["text", " = "], - ["identifier", "Impure"] + "start", + ["storage.type","class"], + ["text"," "], + ["identifier","Add"], + ["paren.lparen","["], + ["identifier","a"], + ["paren.rparen","]"], + ["text"," "], + ["paren.lparen","{"], + ["paren.rparen","}"] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "Int32"], - ["text", " = "], - ["paren.lparen", "{"], - ["constant.numeric", "42"], - ["paren.rparen", "}"] + "start", + ["storage.type","enum"], + ["text"," "], + ["identifier","Down"], + ["paren.lparen","["], + ["identifier","a"], + ["paren.rparen","]"], + ["text"," "], + ["storage.modifier","with"], + ["text"," "], + ["identifier","Sendable"], + ["text"," "], + ["paren.lparen","{"], + ["storage.type","case"], + ["text"," "], + ["identifier","Down"], + ["paren.lparen","("], + ["identifier","a"], + ["paren.rparen",")}"] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "Float64"], - ["text", " = "], - ["keyword.control", "if"], - ["paren.lparen", "("], - ["constant.language.boolean", "true"], - ["paren.rparen", ")"], - ["paren.lparen", "{"], - ["constant.numeric", "42.0"], - ["paren.rparen", "}"], - ["keyword.control", "else"], - ["paren.lparen", "{"], - ["constant.numeric", "43.0"], - ["paren.rparen", "}"] + "start", + ["storage.type","eff"], + ["text"," "], + ["identifier","NonDet"] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "String"], - ["text", " = "], - ["string", "\"Hello"], - ["constant.character.escape", "\\\""], - ["string", "World"], - ["constant.character.escape", "\\u0021"], - ["string", "\""] + "start", + ["storage.type","type"], + ["text"," "], + ["storage.type","alias"], + ["text"," "], + ["identifier","Static"], + ["text"," = "], + ["identifier","Impure"] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "Char"], - ["text", " = "], - ["constant.character", "'a'"] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","Int32"], + ["text"," = "], + ["paren.lparen","{"], + ["constant.numeric","42"], + ["paren.rparen","}"] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "Char"], - ["text", " = "], - ["constant.character", "'"], - ["constant.character.escape", "\\u0021"], - ["constant.character", "'"] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","Float64"], + ["text"," = "], + ["keyword.control","if"], + ["paren.lparen","("], + ["constant.language.boolean","true"], + ["paren.rparen",")"], + ["paren.lparen","{"], + ["constant.numeric","42.0"], + ["paren.rparen","}"], + ["keyword.control","else"], + ["paren.lparen","{"], + ["constant.numeric","43.0"], + ["paren.rparen","}"] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "Char"], - ["text", " = "], - ["constant.character", "'"], - ["constant.character.escape", "\\'"], - ["constant.character", "'"] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","String"], + ["text"," = "], + ["string","\"Hello"], + ["constant.character.escape","\\\""], + ["string","World"], + ["constant.character.escape","\\u0021"], + ["string","\""] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["identifier", "Regex"], - ["text", " = "], - ["string.regexp", "regex\"Hello"], - ["constant.character.escape", "\\\""], - ["string.regexp", "World"], - ["constant.character.escape", "\\u0021"], - ["string.regexp", "\""] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","Char"], + ["text"," = "], + ["constant.character","'a'"] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "String"], - ["text", " = "], - ["keyword", "???"] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","Char"], + ["text"," = "], + ["constant.character","'"], + ["constant.character.escape","\\u0021"], + ["constant.character","'"] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "String"], - ["text", " = "], - ["keyword", "?someHole"] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","Char"], + ["text"," = "], + ["constant.character","'"], + ["constant.character.escape","\\'"], + ["constant.character","'"] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "Int32"], - ["text", " = "], - ["constant.numeric", "0x123i32"] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["identifier","Regex"], + ["text"," = "], + ["string.regexp","regex\"Hello"], + ["constant.character.escape","\\\""], + ["string.regexp","World"], + ["constant.character.escape","\\u0021"], + ["string.regexp","\""] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "Int32"], - ["text", " = "], - ["constant.numeric", "42i32"] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","String"], + ["text"," = "], + ["keyword","???"] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "Float64"], - ["text", " = "], - ["constant.numeric", "42.0f64"] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","String"], + ["text"," = "], + ["keyword","?someHole"] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "Bool"], - ["text", " = "], - ["constant.language.boolean", "true"] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","Int32"], + ["text"," = "], + ["constant.numeric","0x123i32"] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "Bool"], - ["text", " = "], - ["constant.language.boolean", "false"] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","Int32"], + ["text"," = "], + ["constant.numeric","42i32"] ],[ - "start", - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["identifier", "Null"], - ["text", " = "], - ["constant.language", "null"] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","Float64"], + ["text"," = "], + ["constant.numeric","42.0f64"] ],[ - "start", - ["storage.modifier", "@Lazy"], - ["text", "\n"], - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "Int32"], - ["text", " = "], - ["constant.numeric", "42"] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","Bool"], + ["text"," = "], + ["constant.language.boolean","true"] ],[ - "start", - ["storage.modifier", "pub"], - ["text", " "], - ["storage.type", "def"], - ["text", " "], - ["identifier", "main"], - ["paren.lparen", "("], - ["paren.rparen", ")"], - ["text", ": "], - ["support.type", "Int32"], - ["text", " = "], - ["constant.numeric", "42"] + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","Bool"], + ["text"," = "], + ["constant.language.boolean","false"] +],[ + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["identifier","Null"], + ["text"," = "], + ["constant.language","null"] +],[ + "start", + ["storage.modifier","@Lazy"] +],[ + "start", + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","Int32"], + ["text"," = "], + ["constant.numeric","42"] +],[ + "start", + ["storage.modifier","pub"], + ["text"," "], + ["storage.type","def"], + ["text"," "], + ["identifier","main"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text",": "], + ["support.type","Int32"], + ["text"," = "], + ["constant.numeric","42"] ]] \ No newline at end of file diff --git a/src/mode/_test/tokens_javascript.json b/src/mode/_test/tokens_javascript.json index ddee3d0f480..7e11d31fae5 100644 --- a/src/mode/_test/tokens_javascript.json +++ b/src/mode/_test/tokens_javascript.json @@ -549,9 +549,9 @@ "function_arguments", ["identifier","foo"], ["punctuation.operator","."], - ["storage.type","protoype"], + ["support.function","prototype"], ["punctuation.operator","."], - ["entity.name.function","d"], + ["identifier","d"], ["text"," "], ["keyword.operator","="], ["text"," "], @@ -572,9 +572,9 @@ ["paren.rparen",")"] ],[ "no_regex", - ["storage.type","foo"], + ["identifier","foo"], ["punctuation.operator","."], - ["entity.name.function","d"], + ["identifier","d"], ["text"," "], ["keyword.operator","="], ["storage.type","function"], @@ -586,9 +586,9 @@ ["paren.rparen",")"] ],[ "no_regex", - ["storage.type","foo"], + ["identifier","foo"], ["punctuation.operator","."], - ["entity.name.function","d"], + ["identifier","d"], ["text"," "], ["keyword.operator","="], ["storage.type","function"], @@ -662,27 +662,18 @@ ["meta.tag.punctuation.tag-close.xml",">"] ],[ ["jsx",1], - [ - "string.xml", - "1 " - ], + ["string.xml","1 "], ["meta.tag.punctuation.tag-open.xml","<"], ["meta.tag.tag-name.xml","a"], ["meta.tag.punctuation.tag-close.xml",">"], - [ - "string.xml", - " " - ], + ["string.xml"," "], ["paren.quasi.start","{"], ["text"," "], ["keyword.operator","++"], ["identifier","x"], ["text"," "], ["paren.quasi.end","}"], - [ - "string.xml", - " " - ], + ["string.xml"," "], ["meta.tag.punctuation.end-tag-open.xml",""] @@ -742,7 +733,8 @@ ["comment","//test generator function"] ],[ "start", - ["storage.type","function*"], + ["storage.type","function"], + ["storage.type","*"], ["text"," "], ["entity.name.function","range"], ["text"," "], @@ -1322,4 +1314,148 @@ ["paren.rparen","}"], ["paren.quasi.end","}"], ["meta.tag.punctuation.tag-close.xml","/>"] -]] +],[ + "start" +],[ + "start", + ["comment","//test different generator functions use cases"] +],[ + "no_regex", + ["storage.type","function"], + ["storage.type","*"], + ["text"," "], + ["entity.name.function","generator"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text"," "], + ["paren.lparen","{"], + ["paren.rparen","}"] +],[ + "no_regex", + ["storage.type","function"], + ["storage.type","*"], + ["entity.name.function","generator"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text"," "], + ["paren.lparen","{"], + ["paren.rparen","}"] +],[ + "no_regex", + ["identifier","Sound"], + ["punctuation.operator","."], + ["identifier","play"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["storage.type","function"], + ["storage.type","*"], + ["text"," "], + ["entity.name.function","play"], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text"," "], + ["paren.lparen","{"], + ["text"," "], + ["paren.rparen","}"] +],[ + "no_regex", + ["entity.name.function","foobar"], + ["punctuation.operator",":"], + ["text"," "], + ["storage.type","function"], + ["text"," "], + ["storage.type","*"], + ["text"," "], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text"," "], + ["paren.lparen","{"], + ["text"," "], + ["paren.rparen","}"] +],[ + "no_regex" +],[ + "no_regex", + ["comment","//func's args shouldn't be determined as arrow function"] +],[ + "no_regex", + ["identifier","func"], + ["text"," "], + ["paren.lparen","("], + ["identifier","a"], + ["punctuation.operator",","], + ["identifier","b"], + ["punctuation.operator",","], + ["constant.numeric","1"], + ["punctuation.operator",","], + ["constant.numeric","2"], + ["punctuation.operator",","], + ["constant.numeric","3"], + ["punctuation.operator",","], + ["text"," "], + ["keyword","async"], + ["text"," "], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text"," "], + ["storage.type","=>"], + ["text"," "], + ["paren.lparen","{"], + ["paren.rparen","})"] +],[ + "no_regex", + ["identifier","func"], + ["paren.lparen","("], + ["identifier","a"], + ["punctuation.operator",","], + ["identifier","b"], + ["punctuation.operator",","], + ["identifier","innerCall"], + ["paren.lparen","("], + ["identifier","c"], + ["punctuation.operator",","], + ["identifier","d"], + ["paren.rparen",")"], + ["punctuation.operator",","], + ["text"," "], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text"," "], + ["storage.type","=>"], + ["text"," "], + ["paren.lparen","{"], + ["paren.rparen","})"] +],[ + "no_regex" +],[ + "no_regex", + ["comment","//async arrow function with default params"] +],[ + "start", + ["keyword","async"], + ["text"," "], + ["paren.lparen","("], + ["variable.parameter","param1"], + ["punctuation.operator",","], + ["text"," "], + ["variable.parameter","param2"], + ["punctuation.operator",","], + ["text"," "], + ["keyword.operator","..."], + ["variable.parameter","paramN"], + ["paren.rparen",")"], + ["text"," "], + ["storage.type","=>"], + ["text"," "], + ["paren.lparen","{"] +],[ + "no_regex", + ["text"," "], + ["identifier","statements"] +],[ + "no_regex", + ["paren.rparen","}"] +],[ + "no_regex" +]] \ No newline at end of file diff --git a/src/mode/_test/tokens_jsx.json b/src/mode/_test/tokens_jsx.json index e247cb8c13a..6da36017f30 100644 --- a/src/mode/_test/tokens_jsx.json +++ b/src/mode/_test/tokens_jsx.json @@ -44,16 +44,10 @@ ["meta.tag.punctuation.tag-close.xml",">"] ],[ ["jsx",1], - [ - "string.xml", - " Keywords here are not highlighted, for example class or instance." - ] + ["string.xml"," Keywords here are not highlighted, for example class or instance."] ],[ "start", - [ - "string.xml", - " " - ], + ["string.xml"," "], ["meta.tag.punctuation.end-tag-open.xml",""] @@ -65,4 +59,4 @@ ],[ "no_regex", ["paren.rparen","}"] -]] +]] \ No newline at end of file diff --git a/src/mode/_test/tokens_typescript.json b/src/mode/_test/tokens_typescript.json index 592aa8b71d0..b76bcd0bad3 100644 --- a/src/mode/_test/tokens_typescript.json +++ b/src/mode/_test/tokens_typescript.json @@ -115,9 +115,9 @@ ["punctuation.operator",";"] ],[ "start", - ["storage.type","button"], + ["identifier","button"], ["punctuation.operator","."], - ["entity.name.function","onclick"], + ["identifier","onclick"], ["text"," "], ["keyword.operator","="], ["text"," "], diff --git a/src/mode/_test/tokens_vue.json b/src/mode/_test/tokens_vue.json index c41cb3f50a6..78654aa55d6 100644 --- a/src/mode/_test/tokens_vue.json +++ b/src/mode/_test/tokens_vue.json @@ -1,1983 +1,625 @@ -[ - [ - "comment", - [ - "comment.start.xml", - "" - ] - ], - [ - "start" - ], - [ - "start", - [ - "meta.tag.punctuation.tag-open.xml", - "<" - ], - [ - "meta.tag.tag-name.xml", - "template" - ], - [ - "meta.tag.punctuation.tag-close.xml", - ">" - ] - ], - [ - "start", - [ - "text.xml", - " " - ], - [ - "meta.tag.punctuation.tag-open.xml", - "<" - ], - [ - "meta.tag.tag-name.xml", - "div" - ], - [ - "meta.tag.punctuation.tag-close.xml", - ">" - ] - ], - [ - "start", - [ - "text.xml", - " " - ], - [ - "punctuation", - "{{" - ], - [ - "text", - " " - ], - [ - "identifier", - "foo" - ], - [ - "text", - " " - ], - [ - "keyword.operator", - "*" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "10" - ], - [ - "text", - " " - ], - [ - "keyword.operator", - "+" - ], - [ - "text", - " " - ], - [ - "string", - "'hi'" - ], - [ - "text", - " " - ], - [ - "punctuation", - "}}" - ] - ], - [ - "tag_stuff", - [ - "text.xml", - " " - ], - [ - "meta.tag.punctuation.tag-open.xml", - "<" - ], - [ - "meta.tag.tag-name.xml", - "span" - ] - ], - [ - "tag_stuff", - [ - "text.tag-whitespace.xml", - " " - ], - [ - "entity.other.attribute-name.xml", - "v-" - ], - [ - "entity.other.attribute-name.xml", - "text" - ], - [ - "punctuation.separator.key-value.xml", - "=" - ], - [ - "string", - "\"" - ], - [ - "identifier", - "foo" - ], - [ - "text", - " " - ], - [ - "keyword.operator", - "*" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "10" - ], - [ - "text", - " " - ], - [ - "keyword.operator", - "+" - ], - [ - "text", - " " - ], - [ - "string", - "'hi'" - ], - [ - "string", - "\"" - ], - [ - "text.tag-whitespace.xml", - " " - ], - [ - "punctuation.separator.key-value.xml", - ":" - ], - [ - "entity.other.attribute-name.xml", - "id" - ], - [ - "punctuation.separator.key-value.xml", - "=" - ], - [ - "string", - "\"" - ], - [ - "identifier", - "foo" - ], - [ - "text", - " " - ], - [ - "keyword.operator", - "+" - ], - [ - "text", - " " - ], - [ - "string", - "'baz'" - ], - [ - "string", - "\"" - ] - ], - [ - "tag_stuff", - [ - "text.tag-whitespace.xml", - " " - ], - [ - "punctuation.separator.key-value.xml", - "@" - ], - [ - "entity.other.attribute-name.xml", - "click" - ], - [ - "punctuation.separator.key-value.xml", - "=" - ], - [ - "string", - "\"" - ], - [ - "identifier", - "onClick" - ], - [ - "paren.lparen", - "(" - ], - [ - "string", - "'hello'" - ], - [ - "paren.rparen", - ")" - ], - [ - "string", - "\"" - ] - ], - [ - "start", - [ - "text.tag-whitespace.xml", - " " - ], - [ - "punctuation.separator.key-value.xml", - "@" - ], - [ - "entity.other.attribute-name.xml", - "click.prevent" - ], - [ - "punctuation.separator.key-value.xml", - "=" - ], - [ - "string", - "\"" - ], - [ - "identifier", - "onClick" - ], - [ - "paren.lparen", - "(" - ], - [ - "string", - "'hello'" - ], - [ - "paren.rparen", - ")" - ], - [ - "string", - "\"" - ], - [ - "meta.tag.punctuation.tag-close.xml", - ">" - ] - ], - [ - "start", - [ - "text.xml", - " Hello" - ] - ], - [ - "start", - [ - "text.xml", - " " - ], - [ - "meta.tag.punctuation.end-tag-open.xml", - "" - ] - ], - [ - "start", - [ - "text.xml", - " " - ], - [ - "meta.tag.punctuation.end-tag-open.xml", - "" - ] - ], - [ - "start", - [ - "meta.tag.punctuation.end-tag-open.xml", - "" - ] - ], - [ - "start" - ], - [ - "js-start", - [ - "meta.tag.punctuation.tag-open.xml", - "<" - ], - [ - "meta.tag.script.tag-name.xml", - "script" - ], - [ - "meta.tag.punctuation.tag-close.xml", - ">" - ] - ], - [ - "js-start", - [ - "keyword", - "export" - ], - [ - "text", - " " - ], - [ - "keyword", - "default" - ], - [ - "text", - " " - ], - [ - "paren.lparen", - "{" - ] - ], - [ - "js-start", - [ - "text", - " " - ], - [ - "identifier", - "data" - ], - [ - "punctuation.operator", - ":" - ], - [ - "text", - " " - ], - [ - "paren.lparen", - "(" - ], - [ - "paren.rparen", - ")" - ], - [ - "text", - " " - ], - [ - "storage.type", - "=>" - ], - [ - "text", - " " - ], - [ - "paren.lparen", - "({" - ] - ], - [ - "js-no_regex", - [ - "text", - " " - ], - [ - "identifier", - "foo" - ], - [ - "punctuation.operator", - ":" - ], - [ - "text", - " " - ], - [ - "string", - "'bar'" - ] - ], - [ - "js-no_regex", - [ - "text", - " " - ], - [ - "paren.rparen", - "})" - ] - ], - [ - "js-start", - [ - "paren.rparen", - "}" - ], - [ - "punctuation.operator", - ";" - ] - ], - [ - "start", - [ - "meta.tag.punctuation.end-tag-open.xml", - "" - ] - ], - [ - "start" - ], - [ - "css-start", - [ - "meta.tag.punctuation.tag-open.xml", - "<" - ], - [ - "meta.tag.style.tag-name.xml", - "style" - ], - [ - "meta.tag.punctuation.tag-close.style.xml", - ">" - ] - ], - [ - "css-ruleset", - [ - "constant", - "div" - ], - [ - "text", - " " - ], - [ - "paren.lparen", - "{" - ] - ], - [ - "css-ruleset", - [ - "text", - " " - ], - [ - "support.type", - "color" - ], - [ - "punctuation.operator", - ":" - ], - [ - "text", - " " - ], - [ - "support.constant.color", - "red" - ], - [ - "punctuation.operator", - ";" - ] - ], - [ - "css-start", - [ - "paren.rparen", - "}" - ] - ], - [ - "start", - [ - "meta.tag.punctuation.end-tag-open.xml", - "" - ] - ], - [ - "start" - ], - [ - "sass-start", - [ - "meta.tag.punctuation.tag-open.xml", - "<" - ], - [ - "meta.tag.style.tag-name.xml", - "style" - ], - [ - "text.tag-whitespace.xml", - " " - ], - [ - "entity.other.attribute-name.xml", - "lang" - ], - [ - "keyword.operator.attribute-equals.xml", - "=" - ], - [ - "string.attribute-value.xml", - "\"sass\"" - ], - [ - "meta.tag.punctuation.tag-close.style.xml", - ">" - ] - ], - [ - "sass-start", - [ - "comment", - "// sass ace mode;" - ] - ], - [ - "sass-start" - ], - [ - "sass-start", - [ - "keyword", - "@import" - ], - [ - "text", - " " - ], - [ - "support.function", - "url(" - ], - [ - "string", - "http://fonts.googleapis.com/css?family=Ace:700" - ], - [ - "support.function", - ")" - ] - ], - [ - "sass-start" - ], - [ - "sass-start", - [ - "variable.language", - "html" - ], - [ - "text", - ", " - ], - [ - "variable.language", - "body" - ] - ], - [ - "sass-start", - [ - "support.type", - " :background-color " - ], - [ - "constant.numeric", - "#ace" - ] - ], - [ - "sass-start", - [ - "text", - " " - ], - [ - "support.type", - "text-align" - ], - [ - "text", - ": " - ], - [ - "constant.language", - "center" - ] - ], - [ - "sass-start", - [ - "text", - " " - ], - [ - "support.type", - "height" - ], - [ - "text", - ": " - ], - [ - "constant.numeric", - "100%" - ] - ], - [ - [ - "sass-comment", - -1, - 2, - "sass-start" - ], - [ - "comment", - " /*;*********;" - ] - ], - [ - [ - "sass-comment", - 3, - 2, - "sass-start" - ], - [ - "comment", - " ;comment ;" - ] - ], - [ - [ - "sass-comment", - 3, - 2, - "sass-start" - ], - [ - "comment", - " ;*********;" - ] - ], - [ - "sass-start" - ], - [ - "sass-start" - ], - [ - "sass-start", - [ - "text", - " &" - ], - [ - "variable.language", - ":before" - ] - ], - [ - "sass-start", - [ - "text", - " " - ], - [ - "variable", - "$radius" - ], - [ - "text", - ": " - ], - [ - "variable", - "$size" - ], - [ - "text", - " " - ], - [ - "keyword.operator", - "*" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "0.845" - ] - ], - [ - "sass-start", - [ - "text", - " " - ], - [ - "variable", - "$glow" - ], - [ - "text", - ": " - ], - [ - "variable", - "$size" - ], - [ - "text", - " " - ], - [ - "keyword.operator", - "*" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "0.125" - ] - ], - [ - "sass-start" - ], - [ - "sass-start", - [ - "text", - " " - ], - [ - "support.type", - "box-shadow" - ], - [ - "text", - ": " - ], - [ - "constant.numeric", - "0" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "0" - ], - [ - "text", - " " - ], - [ - "variable", - "$glow" - ], - [ - "text", - " " - ], - [ - "variable", - "$glow" - ], - [ - "text", - " / " - ], - [ - "constant.numeric", - "2" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "#fff" - ] - ], - [ - "sass-start", - [ - "text", - " " - ], - [ - "support.type", - "border-radius" - ], - [ - "text", - ": " - ], - [ - "variable", - "$radius" - ] - ], - [ - "sass-start" - ], - [ - "sass-start", - [ - "text", - " &" - ], - [ - "variable.language", - ":active" - ] - ], - [ - "sass-start", - [ - "text", - " ~ " - ], - [ - "variable.language", - ".button" - ] - ], - [ - "sass-start", - [ - "text", - " " - ], - [ - "support.type", - "box-shadow" - ], - [ - "text", - ": " - ], - [ - "constant.numeric", - "0" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "15px" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "25px" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "-4px" - ], - [ - "text", - " " - ], - [ - "support.function", - "rgba" - ], - [ - "paren.lparen", - "(" - ], - [ - "constant.numeric", - "0" - ], - [ - "text", - ", " - ], - [ - "constant.numeric", - "0" - ], - [ - "text", - ", " - ], - [ - "constant.numeric", - "0" - ], - [ - "text", - ", " - ], - [ - "constant.numeric", - "0.4" - ], - [ - "paren.rparen", - ")" - ] - ], - [ - "sass-start" - ], - [ - "sass-start", - [ - "text", - " ~ " - ], - [ - "variable.language", - ".label" - ] - ], - [ - "sass-start", - [ - "text", - " " - ], - [ - "support.type", - "font-size" - ], - [ - "text", - ": " - ], - [ - "constant.numeric", - "40px" - ] - ], - [ - "sass-start", - [ - "text", - " " - ], - [ - "support.type", - "color" - ], - [ - "text", - ": " - ], - [ - "support.function", - "rgba" - ], - [ - "paren.lparen", - "(" - ], - [ - "constant.numeric", - "0" - ], - [ - "text", - ", " - ], - [ - "constant.numeric", - "0" - ], - [ - "text", - ", " - ], - [ - "constant.numeric", - "0" - ], - [ - "text", - ", " - ], - [ - "constant.numeric", - "0.45" - ], - [ - "paren.rparen", - ")" - ] - ], - [ - "sass-start" - ], - [ - "sass-start", - [ - "text", - " &" - ], - [ - "variable.language", - ":checked" - ] - ], - [ - "sass-start", - [ - "text", - " ~ " - ], - [ - "variable.language", - ".button" - ] - ], - [ - "sass-start", - [ - "text", - " " - ], - [ - "support.type", - "box-shadow" - ], - [ - "text", - ": " - ], - [ - "constant.numeric", - "0" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "15px" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "25px" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "-4px" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "#ace" - ] - ], - [ - "sass-start" - ], - [ - "sass-start", - [ - "text", - " ~ " - ], - [ - "variable.language", - ".label" - ] - ], - [ - "sass-start", - [ - "text", - " " - ], - [ - "support.type", - "font-size" - ], - [ - "text", - ": " - ], - [ - "constant.numeric", - "40px" - ] - ], - [ - "sass-start", - [ - "text", - " " - ], - [ - "support.type", - "color" - ], - [ - "text", - ": " - ], - [ - "constant.numeric", - "#c9c9c9" - ] - ], - [ - "start", - [ - "meta.tag.punctuation.end-tag-open.xml", - "" - ] - ], - [ - "start" - ], - [ - "scss-start", - [ - "meta.tag.punctuation.tag-open.xml", - "<" - ], - [ - "meta.tag.style.tag-name.xml", - "style" - ], - [ - "text.tag-whitespace.xml", - " " - ], - [ - "entity.other.attribute-name.xml", - "lang" - ], - [ - "keyword.operator.attribute-equals.xml", - "=" - ], - [ - "string.attribute-value.xml", - "\"scss\"" - ], - [ - "meta.tag.punctuation.tag-close.style.xml", - ">" - ] - ], - [ - "scss-start", - [ - "comment", - "/* style.scss */" - ] - ], - [ - "scss-start" - ], - [ - "scss-start", - [ - "variable.language", - "#navbar" - ], - [ - "text", - " " - ], - [ - "paren.lparen", - "{" - ] - ], - [ - "scss-start", - [ - "text", - " " - ], - [ - "variable", - "$navbar-width" - ], - [ - "text", - ": " - ], - [ - "constant.numeric", - "800px" - ], - [ - "text", - ";" - ] - ], - [ - "scss-start", - [ - "text", - " " - ], - [ - "variable", - "$items" - ], - [ - "text", - ": " - ], - [ - "constant.numeric", - "5" - ], - [ - "text", - ";" - ] - ], - [ - "scss-start", - [ - "text", - " " - ], - [ - "variable", - "$navbar-color" - ], - [ - "text", - ": " - ], - [ - "constant.numeric", - "#ce4dd6" - ], - [ - "text", - ";" - ] - ], - [ - "scss-start" - ], - [ - "scss-start", - [ - "text", - " " - ], - [ - "support.type", - "width" - ], - [ - "text", - ": " - ], - [ - "variable", - "$navbar-width" - ], - [ - "text", - ";" - ] - ], - [ - "scss-start", - [ - "text", - " " - ], - [ - "support.type", - "border-bottom" - ], - [ - "text", - ": " - ], - [ - "constant.numeric", - "2px" - ], - [ - "text", - " " - ], - [ - "constant.language", - "solid" - ], - [ - "text", - " " - ], - [ - "variable", - "$navbar-color" - ], - [ - "text", - ";" - ] - ], - [ - "scss-start" - ], - [ - "scss-start", - [ - "text", - " " - ], - [ - "variable.language", - "li" - ], - [ - "text", - " " - ], - [ - "paren.lparen", - "{" - ] - ], - [ - "scss-start", - [ - "text", - " " - ], - [ - "support.type", - "float" - ], - [ - "text", - ": " - ], - [ - "support.type", - "left" - ], - [ - "text", - ";" - ] - ], - [ - "scss-start", - [ - "text", - " " - ], - [ - "support.type", - "width" - ], - [ - "text", - ": " - ], - [ - "variable", - "$navbar-width" - ], - [ - "text", - "/" - ], - [ - "variable", - "$items" - ], - [ - "text", - " " - ], - [ - "constant", - "-" - ], - [ - "text", - " " - ], - [ - "constant.numeric", - "10px" - ], - [ - "text", - ";" - ] - ], - [ - "scss-start" - ], - [ - "scss-start", - [ - "text", - " " - ], - [ - "support.type", - "background-color" - ], - [ - "text", - ": " - ], - [ - "support.function", - "lighten" - ], - [ - "paren.lparen", - "(" - ], - [ - "variable", - "$navbar-color" - ], - [ - "text", - ", " - ], - [ - "constant.numeric", - "20%" - ], - [ - "paren.rparen", - ")" - ], - [ - "text", - ";" - ] - ], - [ - "scss-start" - ], - [ - "scss-start", - [ - "text", - " &" - ], - [ - "variable.language", - ":hover" - ], - [ - "text", - " " - ], - [ - "paren.lparen", - "{" - ] - ], - [ - "scss-start", - [ - "text", - " " - ], - [ - "support.type", - "background-color" - ], - [ - "text", - ": " - ], - [ - "support.function", - "lighten" - ], - [ - "paren.lparen", - "(" - ], - [ - "variable", - "$navbar-color" - ], - [ - "text", - ", " - ], - [ - "constant.numeric", - "10%" - ], - [ - "paren.rparen", - ")" - ], - [ - "text", - ";" - ] - ], - [ - "scss-start", - [ - "text", - " " - ], - [ - "paren.rparen", - "}" - ] - ], - [ - "scss-start", - [ - "text", - " " - ], - [ - "paren.rparen", - "}" - ] - ], - [ - "scss-start", - [ - "paren.rparen", - "}" - ] - ], - [ - "scss-start" - ], - [ - "start", - [ - "meta.tag.punctuation.end-tag-open.xml", - "" - ] - ], - [ - "start" - ], - [ - "jade-start", - [ - "meta.tag.punctuation.tag-open.xml", - "<" - ], - [ - "meta.tag.template.tag-name.xml", - "template" - ], - [ - "text.tag-whitespace.xml", - " " - ], - [ - "entity.other.attribute-name.xml", - "lang" - ], - [ - "keyword.operator.attribute-equals.xml", - "=" - ], - [ - "string.attribute-value.xml", - "\"jade\"" - ], - [ - "meta.tag.punctuation.tag-close.template.xml", - ">" - ] - ], - [ - "jade-start", - [ - "storage.type.function.jade", - " mixin" - ], - [ - "entity.name.function.jade", - " article" - ], - [ - "punctuation.definition.parameters.begin.jade", - "(" - ], - [ - "variable.parameter.function.jade", - "obj, parents" - ], - [ - "punctuation.definition.parameters.end.jade", - ")" - ] - ], - [ - "jade-start", - [ - "source.js.embedded.jade", - " -" - ], - [ - "storage.type", - "var" - ], - [ - "text", - " " - ], - [ - "identifier", - "x" - ], - [ - "text", - " " - ], - [ - "keyword.operator", - "=" - ], - [ - "text", - " " - ], - [ - "string", - "\"0\"" - ], - [ - "text", - ";" - ] - ], - [ - "jade-start", - [ - "text", - " " - ] - ], - [ - "jade-start", - [ - "source.js.embedded.jade", - " -" - ], - [ - "text", - " " - ], - [ - "storage.type", - "var" - ], - [ - "text", - " " - ], - [ - "identifier", - "items" - ], - [ - "text", - " " - ], - [ - "keyword.operator", - "=" - ], - [ - "text", - " " - ], - [ - "paren.lparen", - "[" - ], - [ - "string", - "\"one\"" - ], - [ - "punctuation.operator", - "," - ], - [ - "text", - " " - ], - [ - "string", - "\"two\"" - ], - [ - "punctuation.operator", - "," - ], - [ - "text", - " " - ], - [ - "string", - "\"three\"" - ], - [ - "text", - "]" - ] - ], - [ - "jade-start", - [ - "meta.tag.any.jade", - " each" - ], - [ - "text", - " item in items" - ] - ], - [ - "jade-start", - [ - "meta.tag.any.jade", - " li" - ], - [ - "text", - "= item" - ] - ], - [ - "start", - [ - "meta.tag.punctuation.end-tag-open.xml", - "" - ] - ], - [ - "start" - ] -] +[[ + "comment", + ["comment.start.xml",""] +],[ + "start" +],[ + "start", + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","template"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + "start", + ["text.xml"," "], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","div"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + "start", + ["text.xml"," "], + ["punctuation","{{"], + ["text"," "], + ["identifier","foo"], + ["text"," "], + ["keyword.operator","*"], + ["text"," "], + ["constant.numeric","10"], + ["text"," "], + ["keyword.operator","+"], + ["text"," "], + ["string","'hi'"], + ["text"," "], + ["punctuation","}}"] +],[ + "tag_stuff", + ["text.xml"," "], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","span"] +],[ + "tag_stuff", + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","v-"], + ["entity.other.attribute-name.xml","text"], + ["punctuation.separator.key-value.xml","="], + ["string","\""], + ["identifier","foo"], + ["text"," "], + ["keyword.operator","*"], + ["text"," "], + ["constant.numeric","10"], + ["text"," "], + ["keyword.operator","+"], + ["text"," "], + ["string","'hi'"], + ["string","\""], + ["text.tag-whitespace.xml"," "], + ["punctuation.separator.key-value.xml",":"], + ["entity.other.attribute-name.xml","id"], + ["punctuation.separator.key-value.xml","="], + ["string","\""], + ["identifier","foo"], + ["text"," "], + ["keyword.operator","+"], + ["text"," "], + ["string","'baz'"], + ["string","\""] +],[ + "tag_stuff", + ["text.tag-whitespace.xml"," "], + ["punctuation.separator.key-value.xml","@"], + ["entity.other.attribute-name.xml","click"], + ["punctuation.separator.key-value.xml","="], + ["string","\""], + ["identifier","onClick"], + ["paren.lparen","("], + ["string","'hello'"], + ["paren.rparen",")"], + ["string","\""] +],[ + "start", + ["text.tag-whitespace.xml"," "], + ["punctuation.separator.key-value.xml","@"], + ["entity.other.attribute-name.xml","click.prevent"], + ["punctuation.separator.key-value.xml","="], + ["string","\""], + ["identifier","onClick"], + ["paren.lparen","("], + ["string","'hello'"], + ["paren.rparen",")"], + ["string","\""], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + "start", + ["text.xml"," Hello"] +],[ + "start", + ["text.xml"," "], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + "start", + ["text.xml"," "], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + "start", + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + "start" +],[ + "js-start", + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.script.tag-name.xml","script"], + ["meta.tag.punctuation.tag-close.xml",">"] +],[ + "js-start", + ["keyword","export"], + ["text"," "], + ["keyword","default"], + ["text"," "], + ["paren.lparen","{"] +],[ + "js-start", + ["text"," "], + ["identifier","data"], + ["punctuation.operator",":"], + ["text"," "], + ["paren.lparen","("], + ["paren.rparen",")"], + ["text"," "], + ["storage.type","=>"], + ["text"," "], + ["paren.lparen","({"] +],[ + "js-no_regex", + ["text"," "], + ["identifier","foo"], + ["punctuation.operator",":"], + ["text"," "], + ["string","'bar'"] +],[ + "js-no_regex", + ["text"," "], + ["paren.rparen","})"] +],[ + "js-start", + ["paren.rparen","}"], + ["punctuation.operator",";"] +],[ + "start", + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + "start" +],[ + "css-start", + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.style.tag-name.xml","style"], + ["meta.tag.punctuation.tag-close.style.xml",">"] +],[ + "css-ruleset", + ["constant","div"], + ["text"," "], + ["paren.lparen","{"] +],[ + "css-ruleset", + ["text"," "], + ["support.type","color"], + ["punctuation.operator",":"], + ["text"," "], + ["support.constant.color","red"], + ["punctuation.operator",";"] +],[ + "css-start", + ["paren.rparen","}"] +],[ + "start", + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + "start" +],[ + "sass-start", + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.style.tag-name.xml","style"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","lang"], + ["keyword.operator.attribute-equals.xml","="], + ["string.attribute-value.xml","\"sass\""], + ["meta.tag.punctuation.tag-close.style.xml",">"] +],[ + "sass-start", + ["comment","// sass ace mode;"] +],[ + "sass-start" +],[ + "sass-start", + ["keyword","@import"], + ["text"," "], + ["support.function","url("], + ["string","http://fonts.googleapis.com/css?family=Ace:700"], + ["support.function",")"] +],[ + "sass-start" +],[ + "sass-start", + ["variable.language","html"], + ["text",", "], + ["variable.language","body"] +],[ + "sass-start", + ["support.type"," :background-color "], + ["constant.numeric","#ace"] +],[ + "sass-start", + ["text"," "], + ["support.type","text-align"], + ["text",": "], + ["constant.language","center"] +],[ + "sass-start", + ["text"," "], + ["support.type","height"], + ["text",": "], + ["constant.numeric","100%"] +],[ + ["sass-comment",-1,2,"sass-start"], + ["comment"," /*;*********;"] +],[ + ["sass-comment",3,2,"sass-start"], + ["comment"," ;comment ;"] +],[ + ["sass-comment",3,2,"sass-start"], + ["comment"," ;*********;"] +],[ + "sass-start" +],[ + "sass-start" +],[ + "sass-start", + ["text"," &"], + ["variable.language",":before"] +],[ + "sass-start", + ["text"," "], + ["variable","$radius"], + ["text",": "], + ["variable","$size"], + ["text"," "], + ["keyword.operator","*"], + ["text"," "], + ["constant.numeric","0.845"] +],[ + "sass-start", + ["text"," "], + ["variable","$glow"], + ["text",": "], + ["variable","$size"], + ["text"," "], + ["keyword.operator","*"], + ["text"," "], + ["constant.numeric","0.125"] +],[ + "sass-start" +],[ + "sass-start", + ["text"," "], + ["support.type","box-shadow"], + ["text",": "], + ["constant.numeric","0"], + ["text"," "], + ["constant.numeric","0"], + ["text"," "], + ["variable","$glow"], + ["text"," "], + ["variable","$glow"], + ["text"," / "], + ["constant.numeric","2"], + ["text"," "], + ["constant.numeric","#fff"] +],[ + "sass-start", + ["text"," "], + ["support.type","border-radius"], + ["text",": "], + ["variable","$radius"] +],[ + "sass-start" +],[ + "sass-start", + ["text"," &"], + ["variable.language",":active"] +],[ + "sass-start", + ["text"," ~ "], + ["variable.language",".button"] +],[ + "sass-start", + ["text"," "], + ["support.type","box-shadow"], + ["text",": "], + ["constant.numeric","0"], + ["text"," "], + ["constant.numeric","15px"], + ["text"," "], + ["constant.numeric","25px"], + ["text"," "], + ["constant.numeric","-4px"], + ["text"," "], + ["support.function","rgba"], + ["paren.lparen","("], + ["constant.numeric","0"], + ["text",", "], + ["constant.numeric","0"], + ["text",", "], + ["constant.numeric","0"], + ["text",", "], + ["constant.numeric","0.4"], + ["paren.rparen",")"] +],[ + "sass-start" +],[ + "sass-start", + ["text"," ~ "], + ["variable.language",".label"] +],[ + "sass-start", + ["text"," "], + ["support.type","font-size"], + ["text",": "], + ["constant.numeric","40px"] +],[ + "sass-start", + ["text"," "], + ["support.type","color"], + ["text",": "], + ["support.function","rgba"], + ["paren.lparen","("], + ["constant.numeric","0"], + ["text",", "], + ["constant.numeric","0"], + ["text",", "], + ["constant.numeric","0"], + ["text",", "], + ["constant.numeric","0.45"], + ["paren.rparen",")"] +],[ + "sass-start" +],[ + "sass-start", + ["text"," &"], + ["variable.language",":checked"] +],[ + "sass-start", + ["text"," ~ "], + ["variable.language",".button"] +],[ + "sass-start", + ["text"," "], + ["support.type","box-shadow"], + ["text",": "], + ["constant.numeric","0"], + ["text"," "], + ["constant.numeric","15px"], + ["text"," "], + ["constant.numeric","25px"], + ["text"," "], + ["constant.numeric","-4px"], + ["text"," "], + ["constant.numeric","#ace"] +],[ + "sass-start" +],[ + "sass-start", + ["text"," ~ "], + ["variable.language",".label"] +],[ + "sass-start", + ["text"," "], + ["support.type","font-size"], + ["text",": "], + ["constant.numeric","40px"] +],[ + "sass-start", + ["text"," "], + ["support.type","color"], + ["text",": "], + ["constant.numeric","#c9c9c9"] +],[ + "start", + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + "start" +],[ + "scss-start", + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.style.tag-name.xml","style"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","lang"], + ["keyword.operator.attribute-equals.xml","="], + ["string.attribute-value.xml","\"scss\""], + ["meta.tag.punctuation.tag-close.style.xml",">"] +],[ + "scss-start", + ["comment","/* style.scss */"] +],[ + "scss-start" +],[ + "scss-start", + ["variable.language","#navbar"], + ["text"," "], + ["paren.lparen","{"] +],[ + "scss-start", + ["text"," "], + ["variable","$navbar-width"], + ["text",": "], + ["constant.numeric","800px"], + ["text",";"] +],[ + "scss-start", + ["text"," "], + ["variable","$items"], + ["text",": "], + ["constant.numeric","5"], + ["text",";"] +],[ + "scss-start", + ["text"," "], + ["variable","$navbar-color"], + ["text",": "], + ["constant.numeric","#ce4dd6"], + ["text",";"] +],[ + "scss-start" +],[ + "scss-start", + ["text"," "], + ["support.type","width"], + ["text",": "], + ["variable","$navbar-width"], + ["text",";"] +],[ + "scss-start", + ["text"," "], + ["support.type","border-bottom"], + ["text",": "], + ["constant.numeric","2px"], + ["text"," "], + ["constant.language","solid"], + ["text"," "], + ["variable","$navbar-color"], + ["text",";"] +],[ + "scss-start" +],[ + "scss-start", + ["text"," "], + ["variable.language","li"], + ["text"," "], + ["paren.lparen","{"] +],[ + "scss-start", + ["text"," "], + ["support.type","float"], + ["text",": "], + ["support.type","left"], + ["text",";"] +],[ + "scss-start", + ["text"," "], + ["support.type","width"], + ["text",": "], + ["variable","$navbar-width"], + ["text","/"], + ["variable","$items"], + ["text"," "], + ["constant","-"], + ["text"," "], + ["constant.numeric","10px"], + ["text",";"] +],[ + "scss-start" +],[ + "scss-start", + ["text"," "], + ["support.type","background-color"], + ["text",": "], + ["support.function","lighten"], + ["paren.lparen","("], + ["variable","$navbar-color"], + ["text",", "], + ["constant.numeric","20%"], + ["paren.rparen",")"], + ["text",";"] +],[ + "scss-start" +],[ + "scss-start", + ["text"," &"], + ["variable.language",":hover"], + ["text"," "], + ["paren.lparen","{"] +],[ + "scss-start", + ["text"," "], + ["support.type","background-color"], + ["text",": "], + ["support.function","lighten"], + ["paren.lparen","("], + ["variable","$navbar-color"], + ["text",", "], + ["constant.numeric","10%"], + ["paren.rparen",")"], + ["text",";"] +],[ + "scss-start", + ["text"," "], + ["paren.rparen","}"] +],[ + "scss-start", + ["text"," "], + ["paren.rparen","}"] +],[ + "scss-start", + ["paren.rparen","}"] +],[ + "scss-start" +],[ + "start", + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + "start" +],[ + "jade-start", + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.template.tag-name.xml","template"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","lang"], + ["keyword.operator.attribute-equals.xml","="], + ["string.attribute-value.xml","\"jade\""], + ["meta.tag.punctuation.tag-close.template.xml",">"] +],[ + "jade-start", + ["storage.type.function.jade"," mixin"], + ["entity.name.function.jade"," article"], + ["punctuation.definition.parameters.begin.jade","("], + ["variable.parameter.function.jade","obj, parents"], + ["punctuation.definition.parameters.end.jade",")"] +],[ + "jade-start", + ["source.js.embedded.jade"," -"], + ["storage.type","var"], + ["text"," "], + ["identifier","x"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["string","\"0\""], + ["text",";"] +],[ + "jade-start", + ["text"," "] +],[ + "jade-start", + ["source.js.embedded.jade"," -"], + ["text"," "], + ["storage.type","var"], + ["text"," "], + ["identifier","items"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["paren.lparen","["], + ["string","\"one\""], + ["punctuation.operator",","], + ["text"," "], + ["string","\"two\""], + ["punctuation.operator",","], + ["text"," "], + ["string","\"three\""], + ["text","]"] +],[ + "jade-start", + ["meta.tag.any.jade"," each"], + ["text"," item in items"] +],[ + "jade-start", + ["meta.tag.any.jade"," li"], + ["text","= item"] +],[ + "start", + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + "start" +]] \ No newline at end of file diff --git a/src/mode/javascript_highlight_rules.js b/src/mode/javascript_highlight_rules.js index bae2c5fd025..1fe1f43a311 100644 --- a/src/mode/javascript_highlight_rules.js +++ b/src/mode/javascript_highlight_rules.js @@ -9,7 +9,8 @@ var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; var JavaScriptHighlightRules = function(options) { // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects - var keywordMapper = this.createKeywordMapper({ + + var keywords = { "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors "Namespace|QName|XML|XMLList|" + // E4X @@ -23,7 +24,7 @@ var JavaScriptHighlightRules = function(options) { "this|arguments|prototype|window|document" , // Pseudo "keyword": "const|yield|import|get|set|async|await|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "break|case|catch|continue|default|delete|do|else|finally|for|" + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + // invalid or reserved "__parent__|__count__|escape|unescape|with|__proto__|" + @@ -35,7 +36,9 @@ var JavaScriptHighlightRules = function(options) { "support.function": "alert", "constant.language.boolean": "true|false" - }, "identifier"); + }; + + var keywordMapper = this.createKeywordMapper(keywords, "identifier"); // keywords which can be followed by regular expressions var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; @@ -49,11 +52,19 @@ var JavaScriptHighlightRules = function(options) { ".)"; // regexp must not have capturing parentheses. Use (?:) instead. // regexps are ordered -> the first match is used + + var anonymousFunctionRe = "(function)(\\s*)(\\*?)"; + + var functionCallStartRule = { //just simple function call + token: ["identifier", "text", "paren.lparen"], + regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()" + }; this.$rules = { "no_regex" : [ DocCommentHighlightRules.getStartRule("doc-start"), comments("no_regex"), + functionCallStartRule, { token : "string", regex : "'(?=.)", @@ -68,60 +79,35 @@ var JavaScriptHighlightRules = function(options) { }, { token : "constant.numeric", // decimal integers and floats regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ - }, { - // Sound.prototype.play = - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - // Sound.play = function() { } - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()", - next: "function_arguments" }, { // play = function() { } token : [ "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()", - next: "function_arguments" - }, { - // Sound.play = function play() { } - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" + "text", "storage.type", "text", "paren.lparen" ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()", + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()", next: "function_arguments" }, { // function myFunc(arg) { } token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" + "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen" ], - regex : "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + regex : "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()", next: "function_arguments" }, { // foobar: function() { } token : [ "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" + "text", "storage.type", "text", "storage.type", "text", "paren.lparen" ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()", + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()", next: "function_arguments" }, { // : function() { } (this is for issues with 'foo': function() { }) token : [ - "text", "text", "storage.type", "text", "paren.lparen" + "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen" ], - regex : "(:)(\\s*)(function\\*?)(\\s*)(\\()", + regex : "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()", next: "function_arguments" }, { // from "module-path" (this is the only case where 'from' should be a keyword) @@ -172,17 +158,28 @@ var JavaScriptHighlightRules = function(options) { token : "text", regex : "\\s+" }, { - // Sound.play = function play() { } + token: "keyword.operator", + regex: /=/ + }, { + // Sound.play = function() { } token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" + "storage.type", "text", "storage.type", "text", "paren.lparen" ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()", + regex : anonymousFunctionRe + "(\\s*)(\\()", + next: "function_arguments" + }, { + // Sound.play = function play() { } + token: [ + "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen" + ], + regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()", next: "function_arguments" }, { token : "punctuation.operator", regex : /[.](?![.])/ + }, { + token : "support.function", + regex: "prototype" }, { token : "support.function", regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ @@ -417,7 +414,7 @@ var JavaScriptHighlightRules = function(options) { regex: "(" + identifierRe + ")(\\s*)(?=\\=>)" }, { token: "paren.lparen", - regex: "(\\()(?=.+\\s*=>)", + regex: "(\\()(?=[^\\(]+\\s*=>)", next: "function_arguments" }, { token: "variable.language",