diff --git a/lib/ace/mode/_test/highlight_rules_test.js b/lib/ace/mode/_test/highlight_rules_test.js index 9335e1f8..231d58cb 100644 --- a/lib/ace/mode/_test/highlight_rules_test.js +++ b/lib/ace/mode/_test/highlight_rules_test.js @@ -112,7 +112,7 @@ function testMode(modeName, i) { } function testEqual(a) { var err; - if (a[0] !== a[1]) { + if (a[0] + "" !== a[1] + "") { console.log(a[0],a[1]); err = 1; } diff --git a/lib/ace/mode/_test/text_markdown.txt b/lib/ace/mode/_test/text_markdown.txt index d968edcd..40688776 100644 --- a/lib/ace/mode/_test/text_markdown.txt +++ b/lib/ace/mode/_test/text_markdown.txt @@ -11,3 +11,9 @@ test: 6+ #s is not a valid header test: # followed be only space is not a valid header test: only space between #s is not a valid header # # + +test links [Cloud9 IDE](http://www.c9.io/) +* [demo](http://ajaxorg.github.com/ace/) +in lists + +in plain text http://ace.ajaxorg.com \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_c9search.json b/lib/ace/mode/_test/tokens_c9search.json index 4d7485ab..98052746 100644 --- a/lib/ace/mode/_test/tokens_c9search.json +++ b/lib/ace/mode/_test/tokens_c9search.json @@ -10,55 +10,68 @@ ],[ "start", ["c9searchresults.constant.numeric"," 1"], - ["c9searchresults.text",": var fs = require(\"fs\");"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var fs = require(\"fs\");"] ],[ "start", ["c9searchresults.constant.numeric","\t2"], - ["c9searchresults.text",": var argv = require('optimist').argv;"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var argv = require('optimist').argv;"] ],[ "start", ["c9searchresults.constant.numeric","\t3"], - ["c9searchresults.text",": var path = require(\"path\");"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var path = require(\"path\");"] ],[ "start", ["c9searchresults.constant.numeric","\t5"], - ["c9searchresults.text",": var clientExtensions = {};"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var clientExtensions = {};"] ],[ "start", ["c9searchresults.constant.numeric","\t6"], - ["c9searchresults.text",": var clientDirs = fs.readdirSync(__dirname + \"/../plugins-client\");"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var clientDirs = fs.readdirSync(__dirname + \"/../plugins-client\");"] ],[ "start", ["c9searchresults.constant.numeric","\t7"], - ["c9searchresults.text",": for (var i = 0; i < clientDirs.length; i++) {"] + ["c9searchresults.text",": "], + ["c9searchresults.text","for (var i = 0; i < clientDirs.length; i++) {"] ],[ "start", ["c9searchresults.constant.numeric","\t8"], - ["c9searchresults.text",": var dir = clientDirs[i];"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var dir = clientDirs[i];"] ],[ "start", ["c9searchresults.constant.numeric","\t12"], - ["c9searchresults.text",": var name = dir.split(\".\")[1];"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var name = dir.split(\".\")[1];"] ],[ "start", ["c9searchresults.constant.numeric","\t16"], - ["c9searchresults.text",": var projectDir = (argv.w && path.resolve(process.cwd(), argv.w)) || process.cwd();"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var projectDir = (argv.w && path.resolve(process.cwd(), argv.w)) || process.cwd();"] ],[ "start", ["c9searchresults.constant.numeric","\t17"], - ["c9searchresults.text",": var fsUrl = \"/workspace\";"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var fsUrl = \"/workspace\";"] ],[ "start", ["c9searchresults.constant.numeric","\t19"], - ["c9searchresults.text",": var port = argv.p || process.env.PORT || 3131;"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var port = argv.p || process.env.PORT || 3131;"] ],[ "start", ["c9searchresults.constant.numeric","\t20"], - ["c9searchresults.text",": var host = argv.l || \"localhost\";"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var host = argv.l || \"localhost\";"] ],[ "start", ["c9searchresults.constant.numeric","\t22"], - ["c9searchresults.text",": var config = {"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var config = {"] ],[ "start" ],[ @@ -68,7 +81,8 @@ ],[ "start", ["c9searchresults.constant.numeric","\t2"], - ["c9searchresults.text",": var config = require(\"./default\");"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var config = require(\"./default\");"] ],[ "start" ],[ @@ -78,7 +92,8 @@ ],[ "start", ["c9searchresults.constant.numeric","\t1"], - ["c9searchresults.text",": var config = require(\"./default\");"] + ["c9searchresults.text",": "], + ["c9searchresults.text","var config = require(\"./default\");"] ],[ "start" ],[ diff --git a/lib/ace/mode/_test/tokens_coffee.json b/lib/ace/mode/_test/tokens_coffee.json index 5d9d8645..e0e745fe 100644 --- a/lib/ace/mode/_test/tokens_coffee.json +++ b/lib/ace/mode/_test/tokens_coffee.json @@ -28,9 +28,9 @@ ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], - ["variable.parameter","args"], - ["paren.rparen","})"], + ["paren.lparen","("], + ["variable.parameter","{args}"], + ["paren.rparen",")"], ["text"," "], ["storage.type","->"] ],[ @@ -40,9 +40,9 @@ ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], - ["variable.parameter","a1, a2"], - ["paren.rparen","})"], + ["paren.lparen","("], + ["variable.parameter","{a1, a2}"], + ["paren.rparen",")"], ["text"," "], ["storage.type","->"] ],[ @@ -52,9 +52,9 @@ ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], - ["variable.parameter","@a1, a2"], - ["paren.rparen","})"], + ["paren.lparen","("], + ["variable.parameter","{@a1, a2}"], + ["paren.rparen",")"], ["text"," "], ["storage.type","->"] ],[ @@ -62,11 +62,11 @@ ["text"," "], ["entity.name.function","foo"], ["text"," "], - ["punctuation.operator",":"], + ["keyword.operator",":"], ["text"," "], - ["paren.lparen","({"], - ["variable.parameter","args"], - ["paren.rparen","})"], + ["paren.lparen","("], + ["variable.parameter","{args}"], + ["paren.rparen",")"], ["text"," "], ["storage.type","->"] ],[ @@ -76,22 +76,21 @@ ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], - ["variable.parameter","args"], - ["paren.rparen","})"], + ["paren.lparen","("], + ["variable.parameter","{args}"], + ["paren.rparen",")"], ["text"," "], ["storage.type","->"] ],[ "start", ["text"," "], - ["identifier","foo"], + ["entity.name.function","foo"], ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], - ["constant.numeric","0"], - ["identifier","abc"], - ["paren.rparen","})"], + ["paren.lparen","("], + ["variable.parameter","{0abc}"], + ["paren.rparen",")"], ["text"," "], ["storage.type","->"] ],[ @@ -123,22 +122,27 @@ ],[ "start", ["text"," "], - ["identifier","foo"], + ["entity.name.function","foo"], ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], - ["comment","#abc}) ->"] + ["paren.lparen","("], + ["variable.parameter","{#abc}"], + ["paren.rparen",")"], + ["text"," "], + ["storage.type","->"] ],[ "start", ["text"," "], - ["identifier","foo"], + ["entity.name.function","foo"], ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], - ["identifier","abc"], - ["comment","#}) ->"] + ["paren.lparen","("], + ["variable.parameter","{abc#}"], + ["paren.rparen",")"], + ["text"," "], + ["storage.type","->"] ],[ "start", ["text"," "], @@ -167,15 +171,13 @@ ],[ "start", ["text"," "], - ["identifier","foo"], + ["entity.name.function","foo"], ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], - ["identifier","a"], - ["paren.lparen","{"], - ["identifier","bc"], - ["paren.rparen","})"], + ["paren.lparen","("], + ["variable.parameter","{a{bc}"], + ["paren.rparen",")"], ["text"," "], ["storage.type","->"] ],[ @@ -185,8 +187,9 @@ ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], - ["paren.rparen","})"], + ["paren.lparen","("], + ["variable.parameter","{}"], + ["paren.rparen",")"], ["text"," "], ["storage.type","->"] ],[ @@ -196,9 +199,9 @@ ["text"," "], ["keyword.operator","="], ["text"," "], - ["paren.lparen","({"], - ["text"," "], - ["paren.rparen","})"], + ["paren.lparen","("], + ["variable.parameter","{ }"], + ["paren.rparen",")"], ["text"," "], ["storage.type","->"] ],[ @@ -206,10 +209,11 @@ ["text"," "], ["entity.name.function","foo"], ["text"," "], - ["punctuation.operator",":"], + ["keyword.operator",":"], ["text"," "], - ["paren.lparen","({"], - ["paren.rparen","})"], + ["paren.lparen","("], + ["variable.parameter","{}"], + ["paren.rparen",")"], ["text"," "], ["storage.type","->"] ],[ @@ -294,7 +298,7 @@ ["keyword.operator","="], ["text"," "], ["paren.lparen","("], - ["text"," "], + ["variable.parameter"," "], ["paren.rparen",")"], ["text"," "], ["storage.type","->"] @@ -303,10 +307,10 @@ ["text"," "], ["entity.name.function","foo"], ["text"," "], - ["punctuation.operator",":"], + ["keyword.operator",":"], ["text"," "], ["paren.lparen","("], - ["text"," "], + ["variable.parameter"," "], ["paren.rparen",")"], ["text"," "], ["storage.type","->"] @@ -345,7 +349,7 @@ ["text"," "], ["entity.name.function","foo"], ["text"," "], - ["punctuation.operator",":"], + ["keyword.operator",":"], ["text"," "], ["storage.type","->"] ],[ @@ -358,7 +362,7 @@ ["identifier","foo"], ["text"," "], ["identifier","bar"], - ["punctuation.operator",":"], + ["keyword.operator",":"], ["text"," "], ["constant.numeric","1"], ["punctuation.operator",","], @@ -422,7 +426,9 @@ ["text"," "], ["keyword.operator","="], ["text"," "], - ["string","\"#{ 22 / 7 + {x: \""], + ["string.start","\""], + ["string","#{ 22 / 7 + {x: "], + ["string.end","\""], ["comment","#{a + b}\"} + 2}\""] ],[ "qqdoc", @@ -466,14 +472,17 @@ "start", ["string.regex"," ///imgy"] ],[ - "start", + "js", ["text"," "], ["keyword","this"], ["text"," "], ["keyword","isnt"], - ["punctuation.operator",":"], + ["keyword.operator",":"], ["text"," "], - ["string","`just JavaScript`"] + ["string","`just "] +],[ + "start", + ["string"," JavaScript`"] ],[ "start", ["text"," "], diff --git a/lib/ace/mode/_test/tokens_curly.json b/lib/ace/mode/_test/tokens_curly.json index 6d086717..14144479 100644 --- a/lib/ace/mode/_test/tokens_curly.json +++ b/lib/ace/mode/_test/tokens_curly.json @@ -1,106 +1,55 @@ [[ "start", - ["meta.tag","<"], - ["meta.tag.tag-name","html"], - ["meta.tag.r",">"] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","head"], - ["meta.tag.r",">"] -],[ - "start" -],[ - "css-start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name.style","style"], - ["text"," "], - ["entity.other.attribute-name","type"], - ["keyword.operator","="], - ["string","\"text/css\""], - ["meta.tag.r",">"] -],[ - "css-ruleset", - ["text"," "], - ["variable",".text-layer"], - ["text"," "], - ["paren.lparen","{"] -],[ - "css-ruleset", - ["text"," "], - ["support.type","font-family"], - ["text",": Monaco, "], - ["string","\"Courier New\""], - ["text",", "], - ["support.constant.fonts","monospace"], - ["text",";"] -],[ - "css-ruleset", - ["text"," "], - ["support.type","font-size"], - ["text",": "], - ["constant.numeric","12"], - ["keyword","px"], - ["text",";"] -],[ - "css-ruleset", - ["text"," "], - ["support.type","cursor"], - ["text",": "], - ["support.constant","text"], - ["text",";"] -],[ - "css-start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "start" -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","body"], - ["meta.tag.r",">"] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","h1"], - ["text"," "], - ["entity.other.attribute-name","style"], - ["keyword.operator","="], - ["string","\"color:red\""], - ["meta.tag.r",">"], + ["text","tokenize Curly template"], ["variable","{{"], - ["text","author_name"], - ["variable","}}"], + ["text","test"], + ["variable","}}"] +],[ + "start", + ["text","tokenize embedded script"] +],[ + "start", + ["meta.tag","<"], + ["meta.tag.tag-name.script","script"], + ["text"," "], + ["entity.other.attribute-name","a"], + ["keyword.operator","="], + ["string","'a'"], + ["meta.tag.r",">"], + ["storage.type","var"], ["meta.tag",""], + ["text","'123'"] +],[ + "start", + ["text","tokenize multiline attribute value with double quotes"] +],[ + "tag_qqstring", + ["meta.tag","<"], + ["meta.tag.tag-name.anchor","a"], + ["text"," "], + ["entity.other.attribute-name","href"], + ["keyword.operator","="], + ["string","\"abc{{xyz}}"] +],[ + "start", + ["string","def\""], ["meta.tag.r",">"] ],[ "start", - ["text"," "], - ["meta.tag",""] + ["text","tokenize multiline attribute value with single quotes"] +],[ + "tag_qstring", + ["meta.tag","<"], + ["meta.tag.tag-name.anchor","a"], + ["text"," "], + ["entity.other.attribute-name","href"], + ["keyword.operator","="], + ["string","'abc"] ],[ "start", - ["meta.tag",""] ],[ "start" diff --git a/lib/ace/mode/_test/tokens_diff.json b/lib/ace/mode/_test/tokens_diff.json index 66afb5bf..6063991e 100644 --- a/lib/ace/mode/_test/tokens_diff.json +++ b/lib/ace/mode/_test/tokens_diff.json @@ -1,6 +1,7 @@ [[ "start", - ["variable","diff --git"], + ["variable","diff"], + ["variable"," --git"], ["keyword"," a/lib/ace/edit_session.js"], ["variable"," b/lib/ace/edit_session.js"] ],[ @@ -52,7 +53,8 @@ ],[ "start" ],[ - "start" + "start", + ["invalid"," "] ],[ "start" ],[ @@ -84,7 +86,8 @@ ],[ "start" ],[ - "start" + "start", + ["invalid"," "] ],[ "start" ],[ @@ -191,7 +194,8 @@ ],[ "start" ],[ - "start" + "start", + ["invalid"," "] ],[ "start" ],[ @@ -201,7 +205,8 @@ "start" ],[ "start", - ["variable","diff --git"], + ["variable","diff"], + ["variable"," --git"], ["keyword"," a/lib/ace/editor.js"], ["variable"," b/lib/ace/editor.js"] ],[ @@ -259,7 +264,8 @@ ],[ "start" ],[ - "start" + "start", + ["invalid"," "] ],[ "start" ],[ @@ -291,7 +297,8 @@ ],[ "start" ],[ - "start" + "start", + ["invalid"," "] ],[ "start" ],[ @@ -343,7 +350,8 @@ "start" ],[ "start", - ["variable","diff --git"], + ["variable","diff"], + ["variable"," --git"], ["keyword"," a/lib/ace/search_highlight.js"], ["variable"," b/lib/ace/search_highlight.js"] ],[ diff --git a/lib/ace/mode/_test/tokens_html.json b/lib/ace/mode/_test/tokens_html.json index df77b5d3..726c704f 100644 --- a/lib/ace/mode/_test/tokens_html.json +++ b/lib/ace/mode/_test/tokens_html.json @@ -5,96 +5,44 @@ ["meta.tag.r",">"] ],[ "start", - ["text"," "], ["meta.tag","<"], - ["meta.tag.tag-name","head"], - ["meta.tag.r",">"] -],[ - "start" -],[ - "css-start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name.style","style"], + ["meta.tag.tag-name.script","script"], ["text"," "], - ["entity.other.attribute-name","type"], + ["entity.other.attribute-name","a"], ["keyword.operator","="], - ["string","\"text/css\""], - ["meta.tag.r",">"] -],[ - "css-ruleset", - ["text"," "], - ["variable",".text-layer"], - ["text"," "], - ["paren.lparen","{"] -],[ - "css-ruleset", - ["text"," "], - ["support.type","font-family"], - ["text",": Monaco, "], - ["string","\"Courier New\""], - ["text",", "], - ["support.constant.fonts","monospace"], - ["text",";"] -],[ - "css-ruleset", - ["text"," "], - ["support.type","font-size"], - ["text",": "], - ["constant.numeric","12"], - ["keyword","px"], - ["text",";"] -],[ - "css-ruleset", - ["text"," "], - ["support.type","cursor"], - ["text",": "], - ["support.constant","text"], - ["text",";"] -],[ - "css-start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "start" -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","body"], - ["meta.tag.r",">"] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","h1"], - ["text"," "], - ["entity.other.attribute-name","style"], - ["keyword.operator","="], - ["string","\"color:red\""], + ["string","'a'"], ["meta.tag.r",">"], - ["text","Juhu Kinners"], + ["storage.type","var"], ["meta.tag",""] + ["meta.tag.tag-name.script","script"], + ["meta.tag.r",">"], + ["text","'123'"] +],[ + "tag_qqstring", + ["meta.tag","<"], + ["meta.tag.tag-name.anchor","a"], + ["text"," "], + ["entity.other.attribute-name","href"], + ["keyword.operator","="], + ["string","\"abc"] ],[ "start", - ["text"," "], - ["meta.tag",""] +],[ + "tag_qstring", + ["meta.tag","<"], + ["meta.tag.tag-name.anchor","a"], + ["text"," "], + ["entity.other.attribute-name","href"], + ["keyword.operator","="], + ["string","'abc"] +],[ + "start", + ["string","def\\'"], + ["meta.tag.r",">"] +],[ + "start" ],[ "start", ["meta.tag",""] ],[ "start", - ["text"," Only {{ product.price | format_as_money }}"] + ["text"," Only "], + ["variable","{{"], + ["text"," "], + ["identifier","product"], + ["text","."], + ["identifier","price"], + ["text"," | "], + ["identifier","format_as_money"], + ["text"," "], + ["variable","}}"] ],[ "start" ],[ @@ -156,7 +165,15 @@ ["meta.tag","<"], ["meta.tag.tag-name","p"], ["meta.tag.r",">"], - ["text"," The word \"tobi\" in uppercase: {{ 'tobi' | upcase }} "], + ["text"," The word \"tobi\" in uppercase: "], + ["variable","{{"], + ["text"," "], + ["string","'tobi'"], + ["text"," | "], + ["support.function","upcase"], + ["text"," "], + ["variable","}}"], + ["text"," "], ["meta.tag",""] @@ -165,7 +182,15 @@ ["meta.tag","<"], ["meta.tag.tag-name","p"], ["meta.tag.r",">"], - ["text","The word \"tobi\" has {{ 'tobi' | size }} letters! "], + ["text","The word \"tobi\" has "], + ["variable","{{"], + ["text"," "], + ["string","'tobi'"], + ["text"," | "], + ["support.function","size"], + ["text"," "], + ["variable","}}"], + ["text"," letters! "], ["meta.tag",""] @@ -174,7 +199,19 @@ ["meta.tag","<"], ["meta.tag.tag-name","p"], ["meta.tag.r",">"], - ["text","Change \"Hello world\" to \"Hi world\": {{ 'Hello world' | replace: 'Hello', 'Hi' }} "], + ["text","Change \"Hello world\" to \"Hi world\": "], + ["variable","{{"], + ["text"," "], + ["string","'Hello world'"], + ["text"," | "], + ["support.function","replace"], + ["text",": "], + ["string","'Hello'"], + ["text",", "], + ["string","'Hi'"], + ["text"," "], + ["variable","}}"], + ["text"," "], ["meta.tag",""] @@ -183,7 +220,17 @@ ["meta.tag","<"], ["meta.tag.tag-name","p"], ["meta.tag.r",">"], - ["text","The date today is {{ 'now' | date: \"%Y %b %d\" }} "], + ["text","The date today is "], + ["variable","{{"], + ["text"," "], + ["string","'now'"], + ["text"," | "], + ["support.function","date"], + ["text",": "], + ["string","\"%Y %b %d\""], + ["text"," "], + ["variable","}}"], + ["text"," "], ["meta.tag",""] @@ -311,7 +358,14 @@ ["identifier","link_to_vendor"], ["text"," "], ["variable","}}"], - ["text"," / {{ product.title }}"] + ["text"," / "], + ["variable","{{"], + ["text"," "], + ["identifier","product"], + ["text","."], + ["identifier","title"], + ["text"," "], + ["variable","}}"] ],[ "start", ["text"," "], @@ -445,7 +499,14 @@ ["variable","%}"] ],[ "start", - ["text"," First column: {{ item.variable }}"] + ["text"," First column: "], + ["variable","{{"], + ["text"," "], + ["identifier","item"], + ["text","."], + ["identifier","variable"], + ["text"," "], + ["variable","}}"] ],[ "start", ["text"," "], @@ -456,7 +517,14 @@ ["variable","%}"] ],[ "start", - ["text"," Different column: {{ item.variable }}"] + ["text"," Different column: "], + ["variable","{{"], + ["text"," "], + ["identifier","item"], + ["text","."], + ["identifier","variable"], + ["text"," "], + ["variable","}}"] ],[ "start", ["text"," "], diff --git a/lib/ace/mode/_test/tokens_lua.json b/lib/ace/mode/_test/tokens_lua.json index 01d9ebed..cc2676ea 100644 --- a/lib/ace/mode/_test/tokens_lua.json +++ b/lib/ace/mode/_test/tokens_lua.json @@ -1,11 +1,11 @@ [[ - "qcomment", + ["bracketedComment",4,"start"], ["comment","--[[--"] ],[ - "qcomment", + ["bracketedComment",4,"start"], ["comment","num_args takes in 5.1 byte code and extracts the number of arguments"] ],[ - "qcomment", + ["bracketedComment",4,"start"], ["comment","from its function header."] ],[ "start", @@ -280,16 +280,16 @@ ],[ "start" ],[ - "qstring3", + ["bracketedString",5,"start"], ["support.function","print"], ["paren.lparen","("], - ["string","[===["] + ["comment","[===["] ],[ - "qstring3", - ["string"," blah blah %s, (%d %d)"] + ["bracketedString",5,"start"], + ["comment"," blah blah %s, (%d %d)"] ],[ "start", - ["string","]===]"], + ["comment","]===]"], ["keyword.operator","%"], ["paren.lparen","{"], ["string","\"blah\""], @@ -301,10 +301,10 @@ ],[ "start" ],[ - "qcomment1", + ["bracketedComment",5,"start"], ["comment","--[=[--"] ],[ - "qcomment1", + ["bracketedComment",5,"start"], ["comment","table.maxn is deprecated, use # instead."] ],[ "start", diff --git a/lib/ace/mode/_test/tokens_luapage.json b/lib/ace/mode/_test/tokens_luapage.json index bdcf77b9..d63f30e9 100644 --- a/lib/ace/mode/_test/tokens_luapage.json +++ b/lib/ace/mode/_test/tokens_luapage.json @@ -21,15 +21,15 @@ ["meta.tag.tag-name","html"], ["meta.tag.r",">"] ],[ - "lua-qcomment", + ["lua-bracketedComment",4,"lua-start"], ["keyword","<%"], ["text"," "], ["comment","--[[--"] ],[ - "lua-qcomment", + ["lua-bracketedComment",4,"lua-start"], ["comment"," index.lp from the Kepler Project's LuaDoc HTML doclet."] ],[ - "lua-qcomment", + ["lua-bracketedComment",4,"lua-start"], ["comment"," http://keplerproject.github.com/luadoc/"] ],[ "start", diff --git a/lib/ace/mode/_test/tokens_lucene.json b/lib/ace/mode/_test/tokens_lucene.json index 4b75447b..1f6d2985 100644 --- a/lib/ace/mode/_test/tokens_lucene.json +++ b/lib/ace/mode/_test/tokens_lucene.json @@ -1,17 +1,92 @@ [[ "start", - ["paren.lparen","("], - ["keyword","title:"], - ["string","\"foo bar\""], - ["text"," "], + ["keyword","test:"], + ["text"," recognises "], ["keyword.operator","AND"], - ["text"," "], - ["keyword","body:"], - ["string","\"quick fox\""], - ["paren.rparen",")"], - ["text"," "], + ["text"," as keyword"] +],[ + "start", + ["keyword","test:"], + ["text"," recognises "], ["keyword.operator","OR"], - ["text"," "], - ["keyword","title:"], - ["text","fox"] + ["text"," as keyword"] +],[ + "start", + ["keyword","test:"], + ["text"," recognises "], + ["keyword.operator","NOT"], + ["text"," as keyword"] +],[ + "start", + ["keyword","test:"], + ["text"," recognises "], + ["string","\"hello this is dog\""], + ["text"," as string"] +],[ + "start", + ["keyword","test:"], + ["text"," recognises "], + ["constant.character.negation","-"], + ["string","\"hello this is dog\""], + ["text"," as negation with string"] +],[ + "start", + ["keyword","test:"], + ["text"," recognises "], + ["constant.character.proximity","~100"], + ["text"," as text with proximity"] +],[ + "start", + ["keyword","test:"], + ["text"," recognises "], + ["string","\"hello this is dog\""], + ["constant.character.proximity","~100"], + ["text"," as string with proximity"] +],[ + "start", + ["keyword","test:"], + ["text"," recognises "], + ["keyword","raw:"], + ["string","\"hello this is dog\""], + ["text"," as keyword"] +],[ + "start", + ["keyword","test:"], + ["text"," recognises "], + ["keyword","raw:"], + ["text","foo as\"keyword'"] +],[ + "start", + ["keyword","test:"], + ["text"," recognises "], + ["string","\"(\""], + ["text"," as opening parenthesis"] +],[ + "start", + ["keyword","test:"], + ["text"," recognises "], + ["string","\")\""], + ["text"," as closing parenthesis"] +],[ + "start", + ["keyword","test:"], + ["text"," recognises foo"], + ["constant.character.asterisk","*"], + ["text"," as text with asterisk"] +],[ + "start", + ["keyword","test:"], + ["text"," recognises foo"], + ["constant.character.interro","?"], + ["text"," as text with interro"] +],[ + "start", + ["keyword","test:"], + ["text"," recognises single word as text"] +],[ + "start", + ["text"," foo"] +],[ + "start", + ["text"," "] ]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_markdown.json b/lib/ace/mode/_test/tokens_markdown.json index 5fe3be82..4fb6af81 100644 --- a/lib/ace/mode/_test/tokens_markdown.json +++ b/lib/ace/mode/_test/tokens_markdown.json @@ -1,690 +1,75 @@ [[ "start", - ["text","Ace (Ajax.org Cloud9 Editor)"] + ["text","test: header 1 "] ],[ "start", - ["markup.heading.1","============================"] -],[ - "start" + ["markup.heading.1","#f"] ],[ "start", - ["text","Ace is a standalone code editor written in JavaScript. Our goal is to create a browser based editor that matches and extends the features, usability and performance of existing native editors such as TextMate, Vim or Eclipse. It can be easily embedded in any web page or JavaScript application. Ace is developed as the primary editor for ["], + ["text","test: header 2"] +],[ + "start", + ["markup.heading.2","## foo"] +],[ + "start", + ["text","test: header ends with ' #'"] +],[ + "start", + ["markup.heading.1","# # # "] +],[ + "start", + ["text","test: header ends with '#'"] +],[ + "start", + ["markup.heading.1","#foo# "] +],[ + "start", + ["text","test: 6+ #s is not a valid header"] +],[ + "start", + ["text","####### foo"] +],[ + "start", + ["text","test: # followed be only space is not a valid header"] +],[ + "start", + ["text","test: only space between #s is not a valid header"] +],[ + "start", + ["text","# #"] +],[ + "allowBlock" +],[ + "start", + ["text","test links "], + ["text","["], ["string","Cloud9 IDE"], ["text","]("], - ["markup.underline","http://www.cloud9ide.com/"], - ["text",") and the successor of the Mozilla Skywriter (Bespin) Project."] -],[ - "start" -],[ - "start", - ["text","Features"] -],[ - "start", - ["markup.heading.2","--------"] -],[ - "start" + ["markup.underline","http://www.c9.io/"], + ["text",")"], + ["text"," "] ],[ "listblock", - ["markup.list","* Syntax highlighting"] -],[ - "listblock", - ["markup.list","* Automatic indent and outdent"] -],[ - "listblock", - ["markup.list","* An optional command line"] -],[ - "listblock", - ["markup.list","* Handles huge documents (100,000 lines and more are no problem)"] -],[ - "listblock", - ["markup.list","* Fully customizable key bindings including VI and Emacs modes"] -],[ - "listblock", - ["markup.list","* Themes (TextMate themes can be imported)"] -],[ - "listblock", - ["markup.list","* Search and replace with regular expressions"] -],[ - "listblock", - ["markup.list","* Highlight matching parentheses"] -],[ - "listblock", - ["markup.list","* Toggle between soft tabs and real tabs"] -],[ - "listblock", - ["markup.list","* Displays hidden characters"] -],[ - "listblock", - ["markup.list","* Drag and drop text using the mouse"] -],[ - "listblock", - ["markup.list","* Line wrapping"] -],[ - "listblock", - ["markup.list","* Unstructured / user code folding"] -],[ - "listblock", - ["markup.list","* Live syntax checker (currently JavaScript/CoffeeScript)"] -],[ - "start" -],[ - "start", - ["text","Take Ace for a spin!"] -],[ - "start", - ["markup.heading.2","--------------------"] -],[ - "start" -],[ - "start", - ["text","Check out the Ace live ["], + ["markup.list","* "], + ["text","["], ["string","demo"], ["text","]("], ["markup.underline","http://ajaxorg.github.com/ace/"], - ["text",") or get a ["], - ["string","Cloud9 IDE account"], - ["text","]("], - ["markup.underline","http://run.cloud9ide.com"], - ["text",") to experience Ace while editing one of your own GitHub projects."] -],[ - "start" -],[ - "start", - ["text","If you want, you can use Ace as a textarea replacement thanks to the ["], - ["string","Ace Bookmarklet"], - ["text","]("], - ["markup.underline","http://ajaxorg.github.com/ace/build/textarea/editor.html"], - ["text",")."] -],[ - "start" -],[ - "start", - ["text","History"] -],[ - "start", - ["markup.heading.2","-------"] -],[ - "start" -],[ - "start", - ["text","Previously known as “Bespin” and “Skywriter” it’s now known as Ace (Ajax.org Cloud9 Editor)! Bespin and Ace started as two independent projects, both aiming to build a no-compromise code editor component for the web. Bespin started as part of Mozilla Labs and was based on the canvas tag, while Ace is the Editor component of the Cloud9 IDE and is using the DOM for rendering. After the release of Ace at JSConf.eu 2010 in Berlin the Skywriter team decided to merge Ace with a simplified version of Skywriter's plugin system and some of Skywriter's extensibility points. All these changes have been merged back to Ace. Both Ajax.org and Mozilla are actively developing and maintaining Ace."] -],[ - "start" -],[ - "start", - ["text","Getting the code"] -],[ - "start", - ["markup.heading.2","----------------"] -],[ - "start" -],[ - "start", - ["text","Ace is a community project. We actively encourage and support contributions. The Ace source code is hosted on GitHub. It is released under the BSD License. This license is very simple, and is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings!"] -],[ - "start" -],[ - "githubblock", - ["support.function","```bash"] -],[ - "githubblock", - ["support.function"," git clone git://github.com/ajaxorg/ace.git"] -],[ - "githubblock", - ["support.function"," cd ace"] -],[ - "githubblock", - ["support.function"," git submodule update --init --recursive"] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","Embedding Ace"] -],[ - "start", - ["markup.heading.2","-------------"] -],[ - "start" -],[ - "start", - ["text","Ace can be easily embedded into any existing web page. The Ace git repository ships with a pre-packaged version of Ace inside of the "], - ["support.function","`build`"], - ["text"," directory. The same packaged files are also available as a separate ["], - ["string","download"], - ["text","]("], - ["markup.underline","https://github.com/ajaxorg/ace/downloads"], - ["text","). Simply copy the contents of the "], - ["support.function","`src`"], - ["text"," subdirectory somewhere into your project and take a look at the included demos of how to use Ace."] -],[ - "start" -],[ - "start", - ["text","The easiest version is simply:"] -],[ - "start" -],[ - "html-start", - ["support.function","```html"] -],[ - "html-start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","div"], - ["text"," "], - ["entity.other.attribute-name","id"], - ["keyword.operator","="], - ["string","\"editor\""], - ["meta.tag.r",">"], - ["text","some text"], - ["meta.tag",""] -],[ - "html-start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name.script","script"], - ["text"," "], - ["entity.other.attribute-name","src"], - ["keyword.operator","="], - ["string","\"src/ace.js\""], - ["text"," "], - ["entity.other.attribute-name","type"], - ["keyword.operator","="], - ["string","\"text/javascript\""], - ["text"," "], - ["entity.other.attribute-name","charset"], - ["keyword.operator","="], - ["string","\"utf-8\""], - ["meta.tag.r",">"], - ["meta.tag",""] -],[ - "html-js-start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name.script","script"], - ["meta.tag.r",">"] -],[ - "html-js-regex_allowed", - ["text"," "], - ["storage.type","window"], - ["punctuation.operator","."], - ["entity.name.function","onload"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["storage.type","function"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "html-js-regex_allowed", - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","editor"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","ace"], - ["punctuation.operator","."], - ["identifier","edit"], - ["paren.lparen","("], - ["string","\"editor\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "html-js-regex_allowed", - ["text"," "], - ["paren.rparen","}"], - ["punctuation.operator",";"] -],[ - "html-start", - ["text"," "], - ["meta.tag",""] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","With \"editor\" being the id of the DOM element, which should be converted to an editor. Note that this element must be explicitly sized and positioned "], - ["support.function","`absolute`"], - ["text"," or "], - ["support.function","`relative`"], - ["text"," for Ace to work. e.g."] -],[ - "start" -],[ - "css-start", - ["support.function","```css"] -],[ - "css-ruleset", - ["text"," "], - ["keyword","#editor"], - ["text"," "], - ["paren.lparen","{"] -],[ - "css-ruleset", - ["text"," "], - ["support.type","position"], - ["text",": "], - ["support.constant","absolute"], - ["text",";"] -],[ - "css-ruleset", - ["text"," "], - ["support.type","width"], - ["text",": "], - ["constant.numeric","500"], - ["keyword","px"], - ["text",";"] -],[ - "css-ruleset", - ["text"," "], - ["support.type","height"], - ["text",": "], - ["constant.numeric","400"], - ["keyword","px"], - ["text",";"] -],[ - "css-start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","To change the theme simply include the Theme's JavaScript file"] -],[ - "start" -],[ - "html-start", - ["support.function","```html"] -],[ - "html-start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name.script","script"], - ["text"," "], - ["entity.other.attribute-name","src"], - ["keyword.operator","="], - ["string","\"src/theme-twilight.js\""], - ["text"," "], - ["entity.other.attribute-name","type"], - ["keyword.operator","="], - ["string","\"text/javascript\""], - ["text"," "], - ["entity.other.attribute-name","charset"], - ["keyword.operator","="], - ["string","\"utf-8\""], - ["meta.tag.r",">"], - ["meta.tag",""] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","and configure the editor to use the theme:"] -],[ - "start" -],[ - "js-start", - ["support.function","```javascript"] -],[ - "js-regex_allowed", - ["text"," "], - ["identifier","editor"], - ["punctuation.operator","."], - ["identifier","setTheme"], - ["paren.lparen","("], - ["string","\"ace/theme/twilight\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","By default the editor only supports plain text mode; many other languages are available as separate modules. After including the mode's JavaScript file:"] -],[ - "start" -],[ - "html-start", - ["support.function","```html"] -],[ - "html-start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name.script","script"], - ["text"," "], - ["entity.other.attribute-name","src"], - ["keyword.operator","="], - ["string","\"src/mode-javascript.js\""], - ["text"," "], - ["entity.other.attribute-name","type"], - ["keyword.operator","="], - ["string","\"text/javascript\""], - ["text"," "], - ["entity.other.attribute-name","charset"], - ["keyword.operator","="], - ["string","\"utf-8\""], - ["meta.tag.r",">"], - ["meta.tag",""] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","Then the mode can be used like this:"] -],[ - "start" -],[ - "js-start", - ["support.function","```javascript"] -],[ - "js-regex_allowed", - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","JavaScriptMode"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","require"], - ["paren.lparen","("], - ["string","\"ace/mode/javascript\""], - ["paren.rparen",")"], - ["punctuation.operator","."], - ["identifier","Mode"], - ["punctuation.operator",";"] -],[ - "js-regex_allowed", - ["text"," "], - ["identifier","editor"], - ["punctuation.operator","."], - ["identifier","getSession"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["punctuation.operator","."], - ["identifier","setMode"], - ["paren.lparen","("], - ["keyword","new"], - ["text"," "], - ["identifier","JavaScriptMode"], - ["paren.lparen","("], - ["paren.rparen","))"], - ["punctuation.operator",";"] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","Documentation"] -],[ - "start", - ["markup.heading.2","-------------"] -],[ - "start" -],[ - "start", - ["text","You find a lot more sample code in the ["], - ["string","demo app"], - ["text","]("], - ["markup.underline","https://github.com/ajaxorg/ace/blob/master/demo/demo.js"], - ["text",")."] -],[ - "start" -],[ - "start", - ["text","There is also some documentation on the ["], - ["string","wiki page"], - ["text","]("], - ["markup.underline","https://github.com/ajaxorg/ace/wiki"], - ["text",")."] -],[ - "start" -],[ - "start", - ["text","If you still need help, feel free to drop a mail on the ["], - ["string","ace mailing list"], - ["text","]("], - ["markup.underline","http://groups.google.com/group/ace-discuss"], - ["text",")."] -],[ - "start" -],[ - "start", - ["text","Running Ace"] -],[ - "start", - ["markup.heading.2","-----------"] -],[ - "start" -],[ - "start", - ["text","After the checkout Ace works out of the box. No build step is required. Open 'editor.html' in any browser except Google Chrome. Google Chrome doesn't allow XMLHTTPRequests from files loaded from disc (i.e. with a file:/// URL). To open Ace in Chrome simply start the bundled mini HTTP server:"] -],[ - "start" -],[ - "githubblock", - ["support.function","```bash"] -],[ - "githubblock", - ["support.function"," ./static.py"] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","Or using Node.JS"] -],[ - "start" -],[ - "githubblock", - ["support.function","```bash"] -],[ - "githubblock", - ["support.function"," ./static.js"] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","The editor can then be opened at http://localhost:8888/index.html."] -],[ - "start" -],[ - "start", - ["text","Package Ace"] -],[ - "start", - ["markup.heading.2","-----------"] -],[ - "start" -],[ - "start", - ["text","To package Ace we use the dryice build tool developed by the Mozilla Skywriter team. Before you can build you need to make sure that the submodules are up to date."] -],[ - "start" -],[ - "githubblock", - ["support.function","```bash"] -],[ - "githubblock", - ["support.function"," git submodule update --init --recursive"] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","Afterwards Ace can be built by calling"] -],[ - "start" -],[ - "githubblock", - ["support.function","```bash"] -],[ - "githubblock", - ["support.function"," ./Makefile.dryice.js normal"] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","The packaged Ace will be put in the 'build' folder."] -],[ - "start" -],[ - "start", - ["text","To build the bookmarklet version execute"] -],[ - "start" -],[ - "githubblock", - ["support.function","```bash"] -],[ - "githubblock", - ["support.function"," ./Makefile.dryice.js bm"] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","Running the Unit Tests"] -],[ - "start", - ["markup.heading.2","----------------------"] -],[ - "start" -],[ - "start", - ["text","The Ace unit tests run on node.js. Before the first run a couple of node modules have to be installed. The easiest way to do this is by using the node package manager (npm). In the Ace base directory simply call"] -],[ - "start" -],[ - "githubblock", - ["support.function","```bash"] -],[ - "githubblock", - ["support.function"," npm link ."] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","To run the tests call:"] -],[ - "start" -],[ - "githubblock", - ["support.function","```bash"] -],[ - "githubblock", - ["support.function"," node lib/ace/test/all.js"] -],[ - "start", - ["support.function","```"] -],[ - "start" -],[ - "start", - ["text","You can also run the tests in your browser by serving:"] -],[ - "start" -],[ - "start", - ["support.function"," http://localhost:8888/lib/ace/test/tests.html"] -],[ - "start" -],[ - "start", - ["text","This makes debugging failing tests way more easier."] -],[ - "start" -],[ - "start", - ["text","Contributing"] -],[ - "start", - ["markup.heading.2","------------"] -],[ - "start" -],[ - "start", - ["text","Ace wouldn't be what it is without contributions! Feel free to fork and improve/enhance Ace any way you want. If you feel that the editor or the Ace community will benefit from your changes, please open a pull request. To protect the interests of the Ace contributors and users we require contributors to sign a Contributors License Agreement (CLA) before we pull the changes into the main repository. Our CLA is the simplest of agreements, requiring that the contributions you make to an ajax.org project are only those you're allowed to make. This helps us significantly reduce future legal risk for everyone involved. It is easy, helps everyone, takes ten minutes, and only needs to be completed once. There are two versions of the agreement:"] -],[ - "start" + ["text",")"], + ["markup.list"," "] ],[ "listblock", - ["markup.list","1. [The Individual CLA](https://github.com/ajaxorg/ace/raw/master/doc/Contributor_License_Agreement-v2.pdf): use this version if you're working on an ajax.org in your spare time, or can clearly claim ownership of copyright in what you'll be submitting."] -],[ - "listblock", - ["markup.list","2. [The Corporate CLA](https://github.com/ajaxorg/ace/raw/master/doc/Corporate_Contributor_License_Agreement-v2.pdf): have your corporate lawyer review and submit this if your company is going to be contributing to ajax.org projects"] + ["markup.list","in lists"] ],[ "start" ],[ "start", - ["text","If you want to contribute to an ajax.org project please print the CLA and fill it out and sign it. Then either send it by snail mail or fax to us or send it back scanned (or as a photo) by email."] -],[ - "start" -],[ - "start", - ["text","Email: fabian.jakobs@web.de"] -],[ - "start" -],[ - "start", - ["text","Fax: +31 (0) 206388953"] -],[ - "start" -],[ - "start", - ["text","Address: Ajax.org B.V."] -],[ - "start", - ["text"," Keizersgracht 241"] -],[ - "start", - ["text"," 1016 EA, Amsterdam"] -],[ - "start", - ["text"," the Netherlands"] + ["text","in plain text "], + ["meta.tag","<"], + ["meta.tag.tag-name","b"], + ["meta.tag.r",">"], + ["text","http://ace.ajaxorg.com"], + ["meta.tag","<"], + ["meta.tag.tag-name","b"], + ["meta.tag.r",">"] ]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_ruby.json b/lib/ace/mode/_test/tokens_ruby.json index 5f4b9d16..f1d80f46 100644 --- a/lib/ace/mode/_test/tokens_ruby.json +++ b/lib/ace/mode/_test/tokens_ruby.json @@ -1,154 +1,135 @@ [[ "start", - ["comment","#!/usr/bin/ruby"] -],[ - "start" -],[ - "start", - ["comment","# Program to find the factorial of a number"] -],[ - "start", - ["keyword","def"], ["text"," "], - ["identifier","fact"], - ["paren.lparen","("], - ["identifier","n"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["identifier","n"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["constant.numeric","0"] -],[ - "start", - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","else"] -],[ - "start", - ["text"," "], - ["identifier","n"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["identifier","fact"], - ["paren.lparen","("], - ["identifier","n"], - ["constant.numeric","-1"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","end"] -],[ - "start", - ["keyword","end"] -],[ - "start" -],[ - "start", - ["support.function","puts"], - ["text"," "], - ["identifier","fact"], - ["paren.lparen","("], - ["support.class","ARGV"], - ["paren.lparen","["], - ["constant.numeric","0"], - ["paren.rparen","]"], - ["text","."], - ["identifier","to_i"], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["keyword","class"], - ["text"," "], - ["support.class","Range"] + ["comment","#test: symbol tokenizer"] ],[ "start", ["text"," "], - ["keyword","def"], - ["text"," "], - ["identifier","to_json"], - ["paren.lparen","("], - ["keyword.operator","*"], - ["identifier","a"], - ["paren.rparen",")"] + ["paren.lparen","["], + ["constant.other.symbol.ruby",":@thing"], + ["text",", "], + ["constant.other.symbol.ruby",":$thing"], + ["text",", "], + ["constant.other.symbol.ruby",":_thing"], + ["text",", "], + ["constant.other.symbol.ruby",":thing"], + ["text",", "], + ["constant.other.symbol.ruby",":Thing"], + ["text",", "], + ["constant.other.symbol.ruby",":thing1"], + ["text",", "], + ["constant.other.symbol.ruby",":thing_a"], + ["text",","] +],[ + "start", + ["text"," "], + ["constant.other.symbol.ruby",":THING"], + ["text",", "], + ["constant.other.symbol.ruby",":thing!"], + ["text",", "], + ["constant.other.symbol.ruby",":thing="], + ["text",", "], + ["constant.other.symbol.ruby",":thing?"], + ["text",", "], + ["constant.other.symbol.ruby",":t?"], + ["text",","] +],[ + "start", + ["text"," :, :@, :"], + ["keyword.operator","$"], + ["text",", :"], + ["constant.numeric","1"], + ["text",", :1"], + ["identifier","thing"], + ["text",", "], + ["constant.other.symbol.ruby",":th?"], + ["identifier","ing"], + ["text",", "], + ["constant.other.symbol.ruby",":thi="], + ["identifier","ng"], + ["text",", :1"], + ["identifier","thing"], + ["text",","] +],[ + "start", + ["text"," "], + ["constant.other.symbol.ruby",":th!"], + ["identifier","ing"], + ["text",", "], + ["constant.other.symbol.ruby",":thing"], + ["comment","#"] ],[ "start", ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["string","'json_class'"], - ["text"," "], - ["punctuation.separator.key-value","=>"], - ["text"," "], - ["variable.language","self"], - ["text","."], - ["keyword","class"], - ["text","."], - ["identifier","name"], - ["text",", "], - ["comment","# = 'Range'"] -],[ - "start", - ["text"," "], - ["string","'data'"], - ["text"," "], - ["punctuation.separator.key-value","=>"], - ["text"," "], - ["paren.lparen","["], - ["text"," "], - ["identifier","first"], - ["text",", "], - ["identifier","last"], - ["text",", "], - ["identifier","exclude_end"], - ["text","? "], ["paren.rparen","]"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text","."], - ["identifier","to_json"], - ["paren.lparen","("], - ["keyword.operator","*"], - ["identifier","a"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","end"] -],[ - "start", - ["keyword","end"] ],[ "start" ],[ "start", - ["paren.lparen","{"], - ["constant.other.symbol.ruby",":id"], ["text"," "], - ["punctuation.separator.key-value","=>"], + ["comment","#test: namespaces aren't symbols\" : function() {"] +],[ + "start", + ["text"," "], + ["support.class","Namespaced"], + ["text","::"], + ["support.class","Class"] +],[ + "start", ["text"," "], - ["constant.numeric","34"], + ["comment","#test: hex tokenizer "] +],[ + "start", + ["text"," "], + ["constant.numeric","0x9a"], ["text",", "], - ["constant.other.symbol.ruby",":sdfasdfasdf"], + ["constant.numeric","0XA1"], + ["text",", "], + ["constant.numeric","0x9_a"], + ["text",", 0"], + ["identifier","x"], + ["text",", 0"], + ["identifier","x_9a"], + ["text",", 0"], + ["identifier","x9a_"], + ["text",","] +],[ + "start", ["text"," "], - ["punctuation.separator.key-value","=>"], - ["text"," "], - ["string","\"asdasdads\""], - ["paren.rparen","}"] + ["comment","#test: float tokenizer"] +],[ + "start", + ["text"," "], + ["paren.lparen","["], + ["constant.numeric","1"], + ["text",", "], + ["constant.numeric","+1"], + ["text",", "], + ["constant.numeric","-1"], + ["text",", "], + ["constant.numeric","12_345"], + ["text",", "], + ["constant.numeric","0.000_1"], + ["text",","] +],[ + "start", + ["text"," "], + ["identifier","_"], + ["text",", "], + ["constant.numeric","3_1"], + ["text",", "], + ["constant.numeric","1_2"], + ["text",", 1"], + ["identifier","_"], + ["text","."], + ["constant.numeric","0"], + ["text",", "], + ["constant.numeric","0"], + ["text","."], + ["identifier","_1"], + ["paren.rparen","]"], + ["text",";"] +],[ + "start", + ["text"," "] ]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_stylus.json b/lib/ace/mode/_test/tokens_stylus.json index d7f15758..f24993f7 100644 --- a/lib/ace/mode/_test/tokens_stylus.json +++ b/lib/ace/mode/_test/tokens_stylus.json @@ -32,7 +32,8 @@ ],[ "start", ["entity.name.function.stylus","asdasdasdad"], - ["text","(df, ad"], + ["text","("], + ["text","df, ad"], ["keyword.operator.stylus","="], ["constant.numeric","23"], ["text",")"] diff --git a/lib/ace/mode/_test/tokens_tcl.json b/lib/ace/mode/_test/tokens_tcl.json index e3003afe..6a032ddc 100644 --- a/lib/ace/mode/_test/tokens_tcl.json +++ b/lib/ace/mode/_test/tokens_tcl.json @@ -30,8 +30,7 @@ ["identifier","distmap"], ["paren.rparen","}"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","graph"], + ["variable.instance","$graph"], ["text"," "], ["paren.lparen","{"] ],[ @@ -43,8 +42,7 @@ ["text"," "], ["identifier","dist"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","vertex"], + ["variable.instance","$vertex"], ["text"," "], ["identifier","Inf"] ],[ @@ -56,14 +54,14 @@ ["text"," "], ["identifier","path"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","vertex"], + ["variable.instance","$vertex"], ["text"," "], ["paren.lparen","{"], - ["text","}"] + ["paren.rparen","}"] ],[ "commandItem", - ["text"," }"] + ["text"," "], + ["paren.rparen","}"] ],[ "start", ["text"," "], @@ -73,8 +71,7 @@ ["text"," "], ["identifier","dist"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","origin"], + ["variable.instance","$origin"], ["text"," 0"] ],[ "start", @@ -85,14 +82,12 @@ ["text"," "], ["identifier","path"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","origin"], + ["variable.instance","$origin"], ["text"," "], ["paren.lparen","["], ["keyword","list"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","origin"], + ["variable.instance","$origin"], ["paren.rparen","]"] ],[ "commandItem", @@ -108,8 +103,7 @@ ["text"," "], ["identifier","size"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","graph"], + ["variable.instance","$graph"], ["paren.rparen","]}"], ["text"," "], ["paren.lparen","{"] @@ -138,8 +132,7 @@ ["support.function","-"], ["paren.rparen","}"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","graph"], + ["variable.instance","$graph"], ["text"," "], ["paren.lparen","{"] ],[ @@ -148,8 +141,7 @@ ["keyword","if"], ["text"," "], ["paren.lparen","{"], - ["variable.instancce","$"], - ["variable.instance","d"], + ["variable.instance","$d"], ["text"," "], ["support.function",">"], ["text"," "], @@ -163,11 +155,9 @@ ["text"," "], ["identifier","get"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","dist"], + ["variable.instance","$dist"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","uu"], + ["variable.instance","$uu"], ["paren.rparen","]]}"], ["text"," "], ["paren.lparen","{"] @@ -178,8 +168,7 @@ ["text"," "], ["identifier","u"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","uu"] + ["variable.instance","$uu"] ],[ "start", ["text","\t\t"], @@ -187,14 +176,15 @@ ["text"," "], ["identifier","d"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","dd"] + ["variable.instance","$dd"] ],[ "commandItem", - ["text","\t }"] + ["text","\t "], + ["paren.rparen","}"] ],[ "commandItem", - ["text","\t}"] + ["text","\t"], + ["paren.rparen","}"] ],[ "commandItem", ["text"," "] @@ -208,8 +198,7 @@ ["keyword","if"], ["text"," "], ["paren.lparen","{"], - ["variable.instancce","$"], - ["variable.instance","d"], + ["variable.instance","$d"], ["text"," "], ["support.function","=="], ["text"," "], @@ -245,11 +234,9 @@ ["text"," "], ["identifier","get"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","graph"], + ["variable.instance","$graph"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","u"], + ["variable.instance","$u"], ["paren.rparen","]"], ["text"," "], ["paren.lparen","{"] @@ -264,11 +251,9 @@ ["text"," "], ["identifier","exists"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","graph"], + ["variable.instance","$graph"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","v"], + ["variable.instance","$v"], ["paren.rparen","]}"], ["text"," "], ["paren.lparen","{"] @@ -283,13 +268,11 @@ ["keyword","expr"], ["text"," "], ["paren.lparen","{"], - ["variable.instancce","$"], - ["variable.instance","d"], + ["variable.instance","$d"], ["text"," "], ["support.function","+"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","dd"], + ["variable.instance","$dd"], ["paren.rparen","}]"] ],[ "commandItem", @@ -297,8 +280,7 @@ ["keyword","if"], ["text"," "], ["paren.lparen","{"], - ["variable.instancce","$"], - ["variable.instance","alt"], + ["variable.instance","$alt"], ["text"," "], ["support.function","<"], ["text"," "], @@ -307,11 +289,9 @@ ["text"," "], ["identifier","get"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","dist"], + ["variable.instance","$dist"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","v"], + ["variable.instance","$v"], ["paren.rparen","]}"], ["text"," "], ["paren.lparen","{"] @@ -324,11 +304,9 @@ ["text"," "], ["identifier","dist"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","v"], + ["variable.instance","$v"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","alt"] + ["variable.instance","$alt"] ],[ "start", ["text","\t\t "], @@ -338,8 +316,7 @@ ["text"," "], ["identifier","path"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","v"], + ["variable.instance","$v"], ["text"," "], ["paren.lparen","["], ["keyword","list"], @@ -350,25 +327,25 @@ ["text"," "], ["identifier","get"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","path"], + ["variable.instance","$path"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","u"], + ["variable.instance","$u"], ["paren.rparen","]"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","v"], + ["variable.instance","$v"], ["paren.rparen","]"] ],[ "commandItem", - ["text","\t\t}"] + ["text","\t\t"], + ["paren.rparen","}"] ],[ "commandItem", - ["text","\t }"] + ["text","\t "], + ["paren.rparen","}"] ],[ "commandItem", - ["text","\t}"] + ["text","\t"], + ["paren.rparen","}"] ],[ "commandItem", ["text"," "] @@ -385,11 +362,11 @@ ["text"," "], ["identifier","graph"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","u"] + ["variable.instance","$u"] ],[ "commandItem", - ["text"," }"] + ["text"," "], + ["paren.rparen","}"] ],[ "start", ["text"," "], @@ -398,13 +375,11 @@ ["paren.lparen","["], ["keyword","list"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","dist"], + ["variable.instance","$dist"], ["text"," "], - ["variable.instancce","$"], - ["variable.instance","path"], + ["variable.instance","$path"], ["paren.rparen","]"] ],[ "commandItem", - ["text","}"] + ["paren.rparen","}"] ]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_typescript.json b/lib/ace/mode/_test/tokens_typescript.json index f8402571..46077218 100644 --- a/lib/ace/mode/_test/tokens_typescript.json +++ b/lib/ace/mode/_test/tokens_typescript.json @@ -128,7 +128,8 @@ ["paren.lparen","("], ["entity.name.function.ts","greeter.greet"], ["paren.lparen","("], - ["paren.rparen","))"] + ["paren.rparen",")"], + ["paren.rparen",")"] ],[ "start", ["paren.rparen","}"] diff --git a/lib/ace/mode/_test/tokens_xml.json b/lib/ace/mode/_test/tokens_xml.json index 19762eca..f7c1ed64 100644 --- a/lib/ace/mode/_test/tokens_xml.json +++ b/lib/ace/mode/_test/tokens_xml.json @@ -1,539 +1,43 @@ [[ "start", - ["xml-pe",""] -],[ - "tag_embed_attribute_list", ["meta.tag","<"], - ["meta.tag.tag-name","query"], - ["text"," "], - ["entity.other.attribute-name","xmlns:yahoo"], - ["keyword.operator","="], - ["string","\"http://www.yahooapis.com/v1/base.rng\""] -],[ - "start", - ["text"," "], - ["entity.other.attribute-name","yahoo:count"], - ["keyword.operator","="], - ["string","\"7\""], - ["text"," "], - ["entity.other.attribute-name","yahoo:created"], - ["keyword.operator","="], - ["string","\"2011-10-11T08:40:23Z\""], - ["text"," "], - ["entity.other.attribute-name","yahoo:lang"], - ["keyword.operator","="], - ["string","\"en-US\""], - ["meta.tag.r",">"] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","diagnostics"], - ["meta.tag.r",">"] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","publiclyCallable"], + ["meta.tag.tag-name","Juhu"], ["meta.tag.r",">"], - ["text","true"], + ["text","//Juhu Kinners"], ["meta.tag",""] ],[ "start", - ["text"," "], + ["text","test: two tags in the same lines should be in separate tokens\""] +],[ + "start", ["meta.tag","<"], - ["meta.tag.tag-name","url"], + ["meta.tag.tag-name","Juhu"], + ["meta.tag.r",">"], + ["meta.tag","<"], + ["meta.tag.tag-name","Kinners"], + ["meta.tag.r",">"] +],[ + "start", + ["text","test: multiline attributes\""] +],[ + "tag_qqstring", + ["meta.tag","<"], + ["meta.tag.tag-name","copy"], ["text"," "], - ["entity.other.attribute-name","execution-start-time"], + ["entity.other.attribute-name","set"], ["keyword.operator","="], - ["string","\"0\""], + ["string","\"{"] +],[ + "tag_qqstring", + ["string","}\""], ["text"," "], - ["entity.other.attribute-name","execution-stop-time"], + ["entity.other.attribute-name","undo"], ["keyword.operator","="], - ["string","\"25\""], - ["text"," "], - ["entity.other.attribute-name","execution-time"], - ["keyword.operator","="], - ["string","\"25\""], - ["meta.tag.r",">"], - ["text",""], - ["meta.tag",""] + ["string","\"{"] ],[ "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","user-time"], - ["meta.tag.r",">"], - ["text","26"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","service-time"], - ["meta.tag.r",">"], - ["text","25"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","build-version"], - ["meta.tag.r",">"], - ["text","21978"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag",""], - ["text"," "] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","results"], - ["meta.tag.r",">"] -],[ - "tag_embed_attribute_list", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","place"], - ["text"," "], - ["entity.other.attribute-name","xmlns"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/schema.rng\""] -],[ - "start", - ["text"," "], - ["entity.other.attribute-name","xml:lang"], - ["keyword.operator","="], - ["string","\"en-US\""], - ["text"," "], - ["entity.other.attribute-name","yahoo:uri"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/place/24865670\""], - ["meta.tag.r",">"] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","woeid"], - ["meta.tag.r",">"], - ["text","24865670"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","placeTypeName"], - ["text"," "], - ["entity.other.attribute-name","code"], - ["keyword.operator","="], - ["string","\"29\""], - ["meta.tag.r",">"], - ["text","Continent"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","name"], - ["meta.tag.r",">"], - ["text","Africa"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "tag_embed_attribute_list", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","place"], - ["text"," "], - ["entity.other.attribute-name","xmlns"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/schema.rng\""] -],[ - "start", - ["text"," "], - ["entity.other.attribute-name","xml:lang"], - ["keyword.operator","="], - ["string","\"en-US\""], - ["text"," "], - ["entity.other.attribute-name","yahoo:uri"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/place/24865675\""], - ["meta.tag.r",">"] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","woeid"], - ["meta.tag.r",">"], - ["text","24865675"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","placeTypeName"], - ["text"," "], - ["entity.other.attribute-name","code"], - ["keyword.operator","="], - ["string","\"29\""], - ["meta.tag.r",">"], - ["text","Continent"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","name"], - ["meta.tag.r",">"], - ["text","Europe"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "tag_embed_attribute_list", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","place"], - ["text"," "], - ["entity.other.attribute-name","xmlns"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/schema.rng\""] -],[ - "start", - ["text"," "], - ["entity.other.attribute-name","xml:lang"], - ["keyword.operator","="], - ["string","\"en-US\""], - ["text"," "], - ["entity.other.attribute-name","yahoo:uri"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/place/24865673\""], - ["meta.tag.r",">"] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","woeid"], - ["meta.tag.r",">"], - ["text","24865673"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","placeTypeName"], - ["text"," "], - ["entity.other.attribute-name","code"], - ["keyword.operator","="], - ["string","\"29\""], - ["meta.tag.r",">"], - ["text","Continent"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","name"], - ["meta.tag.r",">"], - ["text","South America"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "tag_embed_attribute_list", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","place"], - ["text"," "], - ["entity.other.attribute-name","xmlns"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/schema.rng\""] -],[ - "start", - ["text"," "], - ["entity.other.attribute-name","xml:lang"], - ["keyword.operator","="], - ["string","\"en-US\""], - ["text"," "], - ["entity.other.attribute-name","yahoo:uri"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/place/28289421\""], - ["meta.tag.r",">"] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","woeid"], - ["meta.tag.r",">"], - ["text","28289421"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","placeTypeName"], - ["text"," "], - ["entity.other.attribute-name","code"], - ["keyword.operator","="], - ["string","\"29\""], - ["meta.tag.r",">"], - ["text","Continent"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","name"], - ["meta.tag.r",">"], - ["text","Antarctic"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "tag_embed_attribute_list", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","place"], - ["text"," "], - ["entity.other.attribute-name","xmlns"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/schema.rng\""] -],[ - "start", - ["text"," "], - ["entity.other.attribute-name","xml:lang"], - ["keyword.operator","="], - ["string","\"en-US\""], - ["text"," "], - ["entity.other.attribute-name","yahoo:uri"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/place/24865671\""], - ["meta.tag.r",">"] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","woeid"], - ["meta.tag.r",">"], - ["text","24865671"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","placeTypeName"], - ["text"," "], - ["entity.other.attribute-name","code"], - ["keyword.operator","="], - ["string","\"29\""], - ["meta.tag.r",">"], - ["text","Continent"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","name"], - ["meta.tag.r",">"], - ["text","Asia"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "tag_embed_attribute_list", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","place"], - ["text"," "], - ["entity.other.attribute-name","xmlns"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/schema.rng\""] -],[ - "start", - ["text"," "], - ["entity.other.attribute-name","xml:lang"], - ["keyword.operator","="], - ["string","\"en-US\""], - ["text"," "], - ["entity.other.attribute-name","yahoo:uri"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/place/24865672\""], - ["meta.tag.r",">"] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","woeid"], - ["meta.tag.r",">"], - ["text","24865672"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","placeTypeName"], - ["text"," "], - ["entity.other.attribute-name","code"], - ["keyword.operator","="], - ["string","\"29\""], - ["meta.tag.r",">"], - ["text","Continent"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","name"], - ["meta.tag.r",">"], - ["text","North America"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "tag_embed_attribute_list", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","place"], - ["text"," "], - ["entity.other.attribute-name","xmlns"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/schema.rng\""] -],[ - "start", - ["text"," "], - ["entity.other.attribute-name","xml:lang"], - ["keyword.operator","="], - ["string","\"en-US\""], - ["text"," "], - ["entity.other.attribute-name","yahoo:uri"], - ["keyword.operator","="], - ["string","\"http://where.yahooapis.com/v1/place/55949070\""], - ["meta.tag.r",">"] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","woeid"], - ["meta.tag.r",">"], - ["text","55949070"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","placeTypeName"], - ["text"," "], - ["entity.other.attribute-name","code"], - ["keyword.operator","="], - ["string","\"29\""], - ["meta.tag.r",">"], - ["text","Continent"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag","<"], - ["meta.tag.tag-name","name"], - ["meta.tag.r",">"], - ["text","Australia"], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "start", - ["meta.tag",""] + ["string","}\""], + ["meta.tag.r","/>"] ]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_xquery.json b/lib/ace/mode/_test/tokens_xquery.json index b1e01ab4..93f43af3 100644 --- a/lib/ace/mode/_test/tokens_xquery.json +++ b/lib/ace/mode/_test/tokens_xquery.json @@ -20,12 +20,14 @@ ],[ "start", ["keyword","return"], - ["text"," <"], + ["text"," "], + ["text","<"], ["meta.tag","results"], ["text",">"] ],[ "start", - ["text"," <"], + ["text"," "], + ["text","<"], ["meta.tag","message"], ["text",">"], ["lparen","{"], diff --git a/lib/ace/mode/coldfusion_highlight_rules.js b/lib/ace/mode/coldfusion_highlight_rules.js index a3b4003f..536431c2 100644 --- a/lib/ace/mode/coldfusion_highlight_rules.js +++ b/lib/ace/mode/coldfusion_highlight_rules.js @@ -66,24 +66,12 @@ var ColdfusionHighlightRules = function() { token : "meta.tag", // opening tag regex : "<\\/?", next : "tag" - }, { - token : "text", - regex : "\\s+" - }, { - token : "text", - regex : "[^<]+" } ], cdata : [ { token : "text", regex : "\\]\\]>", next : "start" - }, { - token : "text", - regex : "\\s+" - }, { - token : "text", - regex : ".+" } ], comment : [ { @@ -91,8 +79,7 @@ var ColdfusionHighlightRules = function() { regex : ".*?-->", next : "start" }, { - token : "comment", - regex : ".+" + defaultToken : "comment" } ] }; diff --git a/lib/ace/mode/css_highlight_rules_test.js b/lib/ace/mode/css_highlight_rules_test.js deleted file mode 100644 index 7bc2a8e0..00000000 --- a/lib/ace/mode/css_highlight_rules_test.js +++ /dev/null @@ -1,92 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var CssMode = require("./css").Mode; -var assert = require("../test/assertions"); - -module.exports = { - - name: "CSS Tokenizer", - - setUp : function() { - this.tokenizer = new CssMode().getTokenizer(); - }, - - "test: tokenize pixel number" : function() { - var line = "-12px"; - var tokens = this.tokenizer.getLineTokens(line, "ruleset").tokens; - - assert.equal(2, tokens.length); - assert.equal("constant.numeric", tokens[0].type); - }, - - "test: tokenize hex3 color" : function() { - var tokens = this.tokenizer.getLineTokens("#abc", "ruleset").tokens; - - assert.equal(1, tokens.length); - assert.equal("constant.numeric", tokens[0].type); - }, - - "test: tokenize hex6 color" : function() { - var tokens = this.tokenizer.getLineTokens("#abc012", "ruleset").tokens; - - assert.equal(1, tokens.length); - assert.equal("constant.numeric", tokens[0].type); - }, - - "test: tokenize parens" : function() { - var tokens = this.tokenizer.getLineTokens("{()}", "start").tokens; - - assert.equal(3, tokens.length); - assert.equal("paren.lparen", tokens[0].type); - assert.equal("text", tokens[1].type); - assert.equal("paren.rparen", tokens[2].type); - }, - - "test for last rule in ruleset to catch capturing group bugs" : function() { - var tokens = this.tokenizer.getLineTokens("top", "ruleset").tokens; - - assert.equal(1, tokens.length); - assert.equal("support.type", tokens[0].type); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/ace/mode/html_highlight_rules.js b/lib/ace/mode/html_highlight_rules.js index 6106be1a..d072a933 100644 --- a/lib/ace/mode/html_highlight_rules.js +++ b/lib/ace/mode/html_highlight_rules.js @@ -94,21 +94,12 @@ var HtmlHighlightRules = function() { }, { token : "constant.character.entity", regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, { - token : "text", - regex : "[^<]+" - } ], + }], cdata : [ { token : "text", regex : "\\]\\]>", next : "start" - }, { - token : "text", - regex : "\\s+" - }, { - token : "text", - regex : ".+" } ], comment : [ { @@ -116,8 +107,7 @@ var HtmlHighlightRules = function() { regex : ".*?-->", next : "start" }, { - token : "comment", - regex : ".+" + defaultToken : "comment" } ] }; diff --git a/lib/ace/mode/html_highlight_rules_test.js b/lib/ace/mode/html_highlight_rules_test.js deleted file mode 100644 index d20a30e1..00000000 --- a/lib/ace/mode/html_highlight_rules_test.js +++ /dev/null @@ -1,186 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var HtmlMode = require("./html").Mode; -var assert = require("../test/assertions"); - -var testData = { - "test: tokenize embedded script" : [{ - text: "'123'", - state: ["start", "start"], - tokens: [{ - type: "meta.tag", - value: "<" - }, { - type: "meta.tag.tag-name.script", - value: "script" - }, { - type: "text", - value: " " - }, { - type: "entity.other.attribute-name", - value: "a" - }, { - type: "keyword.operator", - value: "=" - }, { - type: "string", - value: "'a'" - }, { - type: "meta.tag.r", - value: ">" - }, { - type: "storage.type", - value: "var" - }, { - type: "meta.tag", - value: "" - }, { - type: "text", - value: "'123'" - }] - }], - - "test: tokenize multiline attribute value with double quotes": [{ - text: "", - state: [ "tag_qqstring", "start" ], - tokens: [ { - type: "string", - value: "def\"" - }, { - type: "meta.tag.r", - value: ">" - } - ] - }], - - "test: tokenize multiline attribute value with single quotes": [{ - text: "", - state: [ "tag_qstring", "start" ], - tokens: [ { - type: "string", - value: "def\"'" - }, { - type: "meta.tag.r", - value: ">" - } - ] - }] -}; - -function generateTest(exampleData) { - return function testTokenizer() { - for (var i = 0; i < exampleData.length; i++) { - var s = exampleData[i]; - var lineTokens = tokenizer.getLineTokens(s.text, s.state[0]); - - assert.equal( - JSON.stringify(lineTokens, null, 4), - JSON.stringify({tokens:s.tokens, state: s.state[1]}, null, 4) - ); - } - } -} - -var tokenizer; -module.exports = { - setUp : function() { - tokenizer = new HtmlMode().getTokenizer(); - } -} - -for (var i in testData) { - module.exports[i] = generateTest(testData[i]) -} - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); -} diff --git a/lib/ace/mode/liquid_highlight_rules.js b/lib/ace/mode/liquid_highlight_rules.js index 2d64b1c9..4a94f466 100644 --- a/lib/ace/mode/liquid_highlight_rules.js +++ b/lib/ace/mode/liquid_highlight_rules.js @@ -104,24 +104,12 @@ var LiquidHighlightRules = function() { token : "meta.tag", // opening tag regex : "<\\/?", next : "tag" - }, { - token : "text", - regex : "\\s+" - }, { - token : "text", - regex : "[^<]+" } ], cdata : [ { token : "text", regex : "\\]\\]>", next : "start" - }, { - token : "text", - regex : "\\s+" - }, { - token : "text", - regex : ".+" } ], comment : [ { @@ -129,8 +117,7 @@ var LiquidHighlightRules = function() { regex : ".*?-->", next : "start" }, { - token : "comment", - regex : ".+" + defaultToken : "comment" } ] , liquid_start : [{ diff --git a/lib/ace/mode/liquid_highlight_rules_test.js b/lib/ace/mode/liquid_highlight_rules_test.js deleted file mode 100644 index b3be028e..00000000 --- a/lib/ace/mode/liquid_highlight_rules_test.js +++ /dev/null @@ -1,80 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { - -var LiquidMode = require("./liquid").Mode; -var assert = require("../test/assertions"); - -module.exports = { - - name: "Liquid Tokenizer", - - setUp : function() { - this.tokenizer = new LiquidMode().getTokenizer(); - }, - - "test: tokenize tags" : function() { - var line = "for one in many"; - - var tokens = this.tokenizer.getLineTokens(line, "liquid_start").tokens; - - assert.equal(7, tokens.length); - assert.equal("keyword", tokens[0].type); - assert.equal("text", tokens[1].type); - assert.equal("identifier", tokens[2].type); - assert.equal("text", tokens[3].type); - assert.equal("keyword", tokens[4].type); - assert.equal("text", tokens[5].type); - assert.equal("identifier", tokens[6].type); - }, - - "test: tokenize parens" : function() { - var line = "[{( )}]"; - - var tokens = this.tokenizer.getLineTokens(line, "liquid_start").tokens; - - assert.equal(3, tokens.length); - assert.equal("paren.lparen", tokens[0].type); - assert.equal("text", tokens[1].type); - assert.equal("paren.rparen", tokens[2].type); - } - -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/ace/mode/xml_highlight_rules.js b/lib/ace/mode/xml_highlight_rules.js index bf8af68e..02003b3d 100644 --- a/lib/ace/mode/xml_highlight_rules.js +++ b/lib/ace/mode/xml_highlight_rules.js @@ -47,8 +47,7 @@ var XmlHighlightRules = function() { { token : "constant.character.entity", regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }, - {token : "text", regex : "[^<]+"} + } ], cdata : [ diff --git a/lib/ace/mode/yaml_highlight_rules.js b/lib/ace/mode/yaml_highlight_rules.js index b049af1d..ccf3ad8c 100644 --- a/lib/ace/mode/yaml_highlight_rules.js +++ b/lib/ace/mode/yaml_highlight_rules.js @@ -95,12 +95,6 @@ var YamlHighlightRules = function() { }, { token : "paren.rparen", regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - }, { - token : "text", - regex : "\\w+" } ], "qqstring" : [