From 08e621b443d6db92e81f4ec5e5d668eee2d13824 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 28 Dec 2012 19:13:30 +0400 Subject: [PATCH 01/17] allow array of states in tokenizer --- lib/ace/background_tokenizer.js | 2 +- lib/ace/tokenizer.js | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/ace/background_tokenizer.js b/lib/ace/background_tokenizer.js index 28d11994..d75305f9 100644 --- a/lib/ace/background_tokenizer.js +++ b/lib/ace/background_tokenizer.js @@ -236,7 +236,7 @@ var BackgroundTokenizer = function(tokenizer, editor) { data.state = "start"; } - if (this.states[row] !== data.state) { + if (this.states[row] + "" !== data.state + "") { this.states[row] = data.state; this.lines[row + 1] = null; if (this.currentLine > row + 1) diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index f468602c..3f21c475 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -54,15 +54,14 @@ var Tokenizer = function(rules, flag) { this.regExps = {}; this.matchMappings = {}; - for ( var key in this.rules) { + for (var key in this.rules) { var rule = this.rules[key]; var state = rule; var ruleRegExps = []; var matchTotal = 0; var mapping = this.matchMappings[key] = {}; - for ( var i = 0; i < state.length; i++) { - + for (var i = 0; i < state.length; i++) { if (state[i].regex instanceof RegExp) state[i].regex = state[i].regex.toString().slice(1, -1); @@ -75,7 +74,7 @@ var Tokenizer = function(rules, flag) { return "\\" + (parseInt(digit, 10) + matchTotal + 1); }); - if (matchcount > 1 && state[i].token.length !== matchcount-1) + if (matchcount > 1 && typeof state[i].token == "string" && state[i].token.length !== matchcount-1) throw new Error("For " + state[i].regex + " the matching groups (" +(matchcount-1) + ") and length of the token array (" + state[i].token.length + ") don't match (rule #" + i + " of state " + key + ")"); mapping[matchTotal] = { @@ -98,6 +97,12 @@ var Tokenizer = function(rules, flag) { * @returns {Object} **/ this.getLineTokens = function(line, startState) { + if (startState && typeof startState != "string") { + var stack = startState.slice(0); + startState = stack[0]; + } else { + var stack = [] + } var currentState = startState || "start"; var state = this.rules[currentState]; var mapping = this.matchMappings[currentState]; @@ -129,7 +134,7 @@ var Tokenizer = function(rules, flag) { // compute token type if (typeof rule.token == "function") - type = rule.token.apply(this, value); + type = rule.token(value.length == 1 ? value[0] : value, currentState, stack); else type = rule.token; @@ -142,7 +147,7 @@ var Tokenizer = function(rules, flag) { re = this.regExps[currentState]; if (re === undefined) { - throw new Error("You indicated a state of " + rule.next + " to go to, but it doesn't exist!"); + throw new Error("You indicated a state of " + rule.next + " to go to, but it doesn't exist!"); } re.lastIndex = lastIndex; @@ -184,7 +189,7 @@ var Tokenizer = function(rules, flag) { return { tokens : tokens, - state : currentState + state : stack.length ? stack : currentState }; }; From 4cdc48cf635d8cc210309487afecd43fc3199b63 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 28 Dec 2012 19:13:57 +0400 Subject: [PATCH 02/17] simplify lua highlight rules --- lib/ace/mode/lua_highlight_rules.js | 315 ++++++---------------------- 1 file changed, 68 insertions(+), 247 deletions(-) diff --git a/lib/ace/mode/lua_highlight_rules.js b/lib/ace/mode/lua_highlight_rules.js index 1ffd8b06..342eee47 100644 --- a/lib/ace/mode/lua_highlight_rules.js +++ b/lib/ace/mode/lua_highlight_rules.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * 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 @@ -86,8 +86,6 @@ var LuaHighlightRules = function() { "variable.language": "this" }, "identifier"); - var strPre = ""; - var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; var integer = "(?:" + decimalInteger + "|" + hexInteger + ")"; @@ -97,138 +95,73 @@ var LuaHighlightRules = function() { var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; var floatNumber = "(?:" + pointFloat + ")"; - var comment_stack = []; - this.$rules = { - "start" : - - - // bracketed comments - [{ - token : "comment", // --[[ comment - regex : strPre + '\\-\\-\\[\\[.*\\]\\]' - }, { - token : "comment", // --[=[ comment - regex : strPre + '\\-\\-\\[\\=\\[.*\\]\\=\\]' - }, { - token : "comment", // --[==[ comment - regex : strPre + '\\-\\-\\[\\={2}\\[.*\\]\\={2}\\]' - }, { - token : "comment", // --[===[ comment - regex : strPre + '\\-\\-\\[\\={3}\\[.*\\]\\={3}\\]' - }, { - token : "comment", // --[====[ comment - regex : strPre + '\\-\\-\\[\\={4}\\[.*\\]\\={4}\\]' - }, { - token : "comment", // --[====+[ comment - regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]' - }, - - // multiline bracketed comments - { - token : "comment", // --[[ comment - regex : strPre + '\\-\\-\\[\\[.*$', - next : "qcomment" - }, { - token : "comment", // --[=[ comment - regex : strPre + '\\-\\-\\[\\=\\[.*$', - next : "qcomment1" - }, { - token : "comment", // --[==[ comment - regex : strPre + '\\-\\-\\[\\={2}\\[.*$', - next : "qcomment2" - }, { - token : "comment", // --[===[ comment - regex : strPre + '\\-\\-\\[\\={3}\\[.*$', - next : "qcomment3" - }, { - token : "comment", // --[====[ comment - regex : strPre + '\\-\\-\\[\\={4}\\[.*$', - next : "qcomment4" - }, { - token : function(value){ // --[====+[ comment - // WARNING: EXTREMELY SLOW, but this is the only way to circumvent the - // limits imposed by the current automaton. - // I've never personally seen any practical code where 5 or more '='s are - // used for string or commenting, so this will rarely be invoked. - var pattern = /\-\-\[(\=+)\[/, match; - // you can never be too paranoid ;) - if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined) - comment_stack.push(match.length); - + "start" : [{ + stateName: "bracketedComment", + token : function(value, currentState, stack){ + stack.unshift("bracketedComment", value.length); return "comment"; }, - regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*$', - next : "qcomment5" + regex : /\-\-\[=*\[/, + next : [ + { + token : function(value, currentState, stack) { + if (value.length == stack[1]) { + stack.shift(); + stack.shift(); + this.next = "start"; + } else { + this.next = ""; + } + return "comment"; + }, + regex : /(?:[^\\]|\\.)*?\]=*\]/, + next : "start" + }, { + token : "comment", + regex : '.+' + } + ] }, - // single line comments { token : "comment", regex : "\\-\\-.*$" }, - - // bracketed strings { - token : "string", // [[ string - regex : strPre + '\\[\\[.*\\]\\]' - }, { - token : "string", // [=[ string - regex : strPre + '\\[\\=\\[.*\\]\\=\\]' - }, { - token : "string", // [==[ string - regex : strPre + '\\[\\={2}\\[.*\\]\\={2}\\]' - }, { - token : "string", // [===[ string - regex : strPre + '\\[\\={3}\\[.*\\]\\={3}\\]' - }, { - token : "string", // [====[ string - regex : strPre + '\\[\\={4}\\[.*\\]\\={4}\\]' - }, { - token : "string", // [====+[ string - regex : strPre + '\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]' - }, - - // multiline bracketed strings - { - token : "string", // [[ string - regex : strPre + '\\[\\[.*$', - next : "qstring" - }, { - token : "string", // [=[ string - regex : strPre + '\\[\\=\\[.*$', - next : "qstring1" - }, { - token : "string", // [==[ string - regex : strPre + '\\[\\={2}\\[.*$', - next : "qstring2" - }, { - token : "string", // [===[ string - regex : strPre + '\\[\\={3}\\[.*$', - next : "qstring3" - }, { - token : "string", // [====[ string - regex : strPre + '\\[\\={4}\\[.*$', - next : "qstring4" - }, { - token : function(value){ // --[====+[ string - // WARNING: EXTREMELY SLOW, see above. - var pattern = /\[(\=+)\[/, match; - if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined) - comment_stack.push(match.length); - - return "string"; + stateName: "bracketedString", + token : function(value, currentState, stack){ + stack.unshift("bracketedString", value.length); + return "comment"; }, - regex : strPre + '\\[\\={5}\\=*\\[.*$', - next : "qstring5" + regex : /\[=*\[/, + next : [ + { + token : function(value, currentState, stack) { + if (value.length == stack[1]) { + stack.shift(); + stack.shift(); + this.next = "start"; + } else { + this.next = ""; + } + return "comment"; + }, + + regex : /(?:[^\\]|\\.)*?\]=*\]/, + next : "start" + }, { + token : "comment", + regex : '.+' + } + ] }, - { token : "string", // " string - regex : strPre + '"(?:[^\\\\]|\\\\.)*?"' + regex : '"(?:[^\\\\]|\\\\.)*?"' }, { token : "string", // ' string - regex : strPre + "'(?:[^\\\\]|\\\\.)*?'" + regex : "'(?:[^\\\\]|\\\\.)*?'" }, { token : "constant.numeric", // float regex : floatNumber @@ -249,135 +182,23 @@ var LuaHighlightRules = function() { regex : "[\\]\\)\\}]" }, { token : "text", - regex : "\\s+" - } ], - - "qcomment": [ { - token : "comment", - regex : "(?:[^\\\\]|\\\\.)*?\\]\\]", - next : "start" - }, { - token : "comment", - regex : '.+' - } ], - "qcomment1": [ { - token : "comment", - regex : "(?:[^\\\\]|\\\\.)*?\\]\\=\\]", - next : "start" - }, { - token : "comment", - regex : '.+' - } ], - "qcomment2": [ { - token : "comment", - regex : "(?:[^\\\\]|\\\\.)*?\\]\\={2}\\]", - next : "start" - }, { - token : "comment", - regex : '.+' - } ], - "qcomment3": [ { - token : "comment", - regex : "(?:[^\\\\]|\\\\.)*?\\]\\={3}\\]", - next : "start" - }, { - token : "comment", - regex : '.+' - } ], - "qcomment4": [ { - token : "comment", - regex : "(?:[^\\\\]|\\\\.)*?\\]\\={4}\\]", - next : "start" - }, { - token : "comment", - regex : '.+' - } ], - "qcomment5": [ { - token : function(value){ - // very hackish, mutates the qcomment5 field on the fly. - var pattern = /\](\=+)\]/, rule = this.rules.qcomment5[0], match; - rule.next = "start"; - if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined){ - var found = match.length, expected; - if ((expected = comment_stack.pop()) != found){ - comment_stack.push(expected); - rule.next = "qcomment5"; - } - } - - return "comment"; - }, - regex : "(?:[^\\\\]|\\\\.)*?\\]\\={5}\\=*\\]", - next : "start" - }, { - token : "comment", - regex : '.+' - } ], - - "qstring": [ { - token : "string", - regex : "(?:[^\\\\]|\\\\.)*?\\]\\]", - next : "start" - }, { - token : "string", - regex : '.+' - } ], - "qstring1": [ { - token : "string", - regex : "(?:[^\\\\]|\\\\.)*?\\]\\=\\]", - next : "start" - }, { - token : "string", - regex : '.+' - } ], - "qstring2": [ { - token : "string", - regex : "(?:[^\\\\]|\\\\.)*?\\]\\={2}\\]", - next : "start" - }, { - token : "string", - regex : '.+' - } ], - "qstring3": [ { - token : "string", - regex : "(?:[^\\\\]|\\\\.)*?\\]\\={3}\\]", - next : "start" - }, { - token : "string", - regex : '.+' - } ], - "qstring4": [ { - token : "string", - regex : "(?:[^\\\\]|\\\\.)*?\\]\\={4}\\]", - next : "start" - }, { - token : "string", - regex : '.+' - } ], - "qstring5": [ { - token : function(value){ - // very hackish, mutates the qstring5 field on the fly. - var pattern = /\](\=+)\]/, rule = this.rules.qstring5[0], match; - rule.next = "start"; - if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined){ - var found = match.length, expected; - if ((expected = comment_stack.pop()) != found){ - comment_stack.push(expected); - rule.next = "qstring5"; - } - } - - return "string"; - }, - regex : "(?:[^\\\\]|\\\\.)*?\\]\\={5}\\=*\\]", - next : "start" - }, { - token : "string", - regex : '.+' + regex : "\\s+|\\w+" } ] - }; - + + var id = 0; + for (var key in this.$rules) { + var rule = this.$rules[key]; + for (var i = 0; i < rule.length; i++) { + var state = rule[i]; + if (state.next && Array.isArray(state.next)) { + console.log(state.next) + var stateName = state.stateName || ("state" + id++); + this.$rules[stateName] = state.next; + state.next = stateName; + } + } + } } oop.inherits(LuaHighlightRules, TextHighlightRules); From d2d42499ca4d3e22742b716b0ac8324e9f1ce0ca Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 28 Dec 2012 15:35:19 +0400 Subject: [PATCH 03/17] #1069 support ruby heredocs --- demo/kitchen-sink/docs/ruby.rb | 14 ++++- lib/ace/mode/lua_highlight_rules.js | 14 +---- lib/ace/mode/ruby_highlight_rules.js | 87 ++++++++++++++++++++-------- lib/ace/mode/text_highlight_rules.js | 29 +++++++++- 4 files changed, 104 insertions(+), 40 deletions(-) diff --git a/demo/kitchen-sink/docs/ruby.rb b/demo/kitchen-sink/docs/ruby.rb index 48e26ae0..c4d73d19 100644 --- a/demo/kitchen-sink/docs/ruby.rb +++ b/demo/kitchen-sink/docs/ruby.rb @@ -20,4 +20,16 @@ class Range end end -{:id => 34, :sdfasdfasdf => "asdasdads"} \ No newline at end of file +{:id => 34, :key => "value"} + + + herDocs = [<<'FOO', <" + }, { + stateName: "heredoc", + token : function(value, currentState, stack) { + var next = value[0].length == 2 ? "heredoc" : "indentedHeredoc" + stack.push(next, value[2]) + return ["constant", "string", "support.class", "string"] + }, + regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)", + rules: { + heredoc: [{ + token: function(value, currentState, stack) { + if (value == stack[1]) { + stack.shift(); + stack.shift(); + return "support.class"; + } + return "string"; + }, + regex: ".*$", + "next": "start" + }], + indentedHeredoc: [{ + token: "string", + regex: "^ +" + }, { + token: function(value, currentState, stack) { + if (value == stack[1]) { + stack.shift(); + stack.shift(); + return "support.class"; + } + return "string"; + }, + regex: ".*$", + "next": "start" + }] + } }, { token : "keyword.operator", regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" @@ -196,6 +233,8 @@ var RubyHighlightRules = function() { } ] }; + + this.normalizeRules(); }; oop.inherits(RubyHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/text_highlight_rules.js b/lib/ace/mode/text_highlight_rules.js index 2dd176f4..25a8bc87 100644 --- a/lib/ace/mode/text_highlight_rules.js +++ b/lib/ace/mode/text_highlight_rules.js @@ -54,7 +54,7 @@ var TextHighlightRules = function() { this.addRules = function(rules, prefix) { for (var key in rules) { var state = rules[key]; - for (var i=0; i Date: Fri, 28 Dec 2012 16:42:22 +0400 Subject: [PATCH 04/17] add php heredoc support --- lib/ace/mode/php_highlight_rules.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/ace/mode/php_highlight_rules.js b/lib/ace/mode/php_highlight_rules.js index 299a16b1..430fc0ec 100644 --- a/lib/ace/mode/php_highlight_rules.js +++ b/lib/ace/mode/php_highlight_rules.js @@ -974,6 +974,16 @@ var PhpLangHighlightRules = function() { // TODO: Unicode escape sequences // TODO: Unicode identifiers regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : function(value, currentSate, state) { + value = value.substr(3); + if (value[0] == "'" || value[0] == '"') + value = value.slice(1, -1); + state.unshift(this.next, value); + return "markup.list"; + }, + regex : /<<<(?:\w+|'\w+'|"\w+")$/, + next: "heredoc" }, { token : "keyword.operator", regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" @@ -988,6 +998,22 @@ var PhpLangHighlightRules = function() { regex : "\\s+" } ], + "heredoc" : [ + { + token : function(value, currentSate, stack) { + if (stack[1] + ";" != value) + return "string"; + stack.shift(); + stack.shift(); + return "markup.list" + }, + regex : "^\\w+;$", + next: "start" + }, { + token: "string", + regex : ".*", + } + ], "comment" : [ { token : "comment", // closing comment From 4012a11208bcdb7a9fe729b55e566afcad5dd4a1 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 28 Dec 2012 02:53:05 +0400 Subject: [PATCH 05/17] fix bracket matching in tcl mode --- lib/ace/mode/tcl_highlight_rules.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ace/mode/tcl_highlight_rules.js b/lib/ace/mode/tcl_highlight_rules.js index 24f631cb..8886e06f 100644 --- a/lib/ace/mode/tcl_highlight_rules.js +++ b/lib/ace/mode/tcl_highlight_rules.js @@ -66,7 +66,7 @@ var TclHighlightRules = function() { regex : '[ ]*["]', next : "qqstring" }, { - token : "variable.instancce", // variable xotcl with braces + token : "variable.instance", // variable xotcl with braces regex : "[$]", next : "variable" }, { @@ -103,7 +103,7 @@ var TclHighlightRules = function() { token : "string", // single line regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' }, { - token : "variable.instancce", // variable xotcl with braces + token : "variable.instance", // variable xotcl with braces regex : "[$]", next : "variable" }, { @@ -118,6 +118,9 @@ var TclHighlightRules = function() { token : "support.function", regex : "(?:[:][:])", next : "commandItem" + }, { + token : "paren.rparen", + regex : "[\\])}]" }, { token : "support.function", regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::" From 3da1f3f3ba168dae3c17f4277349be05d1c3855b Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 28 Dec 2012 20:20:37 +0400 Subject: [PATCH 06/17] do not break the editor if highlighter is malformed --- lib/ace/tokenizer.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index 3f21c475..8d161d74 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -141,15 +141,14 @@ var Tokenizer = function(rules, flag) { if (rule.next) { currentState = rule.next; state = this.rules[currentState]; + if (!state) { + window.console && console.error && console.error(currentState, "doesn't exist"); + currentState = "start"; + state = this.rules[currentState]; + } mapping = this.matchMappings[currentState]; lastIndex = re.lastIndex; - re = this.regExps[currentState]; - - if (re === undefined) { - throw new Error("You indicated a state of " + rule.next + " to go to, but it doesn't exist!"); - } - re.lastIndex = lastIndex; } break; From cfa3171ac462b9761cd3123a4031a93c48a5b850 Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 3 Jan 2013 01:35:21 +0400 Subject: [PATCH 07/17] add mode for textmate snippets --- demo/kitchen-sink/doclist.js | 1 + demo/kitchen-sink/docs/tmSnippet.tmSnippet | 19 +++++ demo/kitchen-sink/modelist.js | 1 + lib/ace/mode/tm_snippet.js | 86 ++++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 demo/kitchen-sink/docs/tmSnippet.tmSnippet create mode 100644 lib/ace/mode/tm_snippet.js diff --git a/demo/kitchen-sink/doclist.js b/demo/kitchen-sink/doclist.js index f75e6e86..103763a5 100644 --- a/demo/kitchen-sink/doclist.js +++ b/demo/kitchen-sink/doclist.js @@ -119,6 +119,7 @@ var docs = { "docs/tcl.tcl": "Tcl", "docs/tex.tex": "Tex", "docs/textile.textile": {name: "Textile", wrapped: true}, + "docs/tmSnippet.tmSnippet": "tmSnippet", "docs/typescript.ts": "Typescript", "docs/vbscript.vbs": "VBScript", "docs/xml.xml": "XML", diff --git a/demo/kitchen-sink/docs/tmSnippet.tmSnippet b/demo/kitchen-sink/docs/tmSnippet.tmSnippet new file mode 100644 index 00000000..6ea4117f --- /dev/null +++ b/demo/kitchen-sink/docs/tmSnippet.tmSnippet @@ -0,0 +1,19 @@ +$$------------------------------------ +tabTrigger: t +name: Heading 3 +scope: language +content: ----------------------------- +\begin{${1:documnet}} + ${2:$TM_SELECTED_TEXT:some latex} + ${3:$TM_SELECTED_TEXT/a/b/c} + ${4:${TM_SELECTED_TEXT/(.)/\\u$1/g:7}} +\end{$1} +$0\\$$ +$$------------------------------------ +tabTrigger: ^3 +name: Heading 3 +scope: language +content: ----------------------------- + +${TM_CURRENT_LINE/./^/g} +$$------------------------------------ \ No newline at end of file diff --git a/demo/kitchen-sink/modelist.js b/demo/kitchen-sink/modelist.js index ec2ce2d6..d3a33ba8 100644 --- a/demo/kitchen-sink/modelist.js +++ b/demo/kitchen-sink/modelist.js @@ -91,6 +91,7 @@ var modesByName = { tex: ["Tex" , "tex"], text: ["Text" , "txt"], textile: ["Textile" , "textile"], + tm_snippet: ["tmSnippet" , "tmSnippet"], typescript: ["Typescript" , "typescript|ts|str"], vbscript: ["VBScript" , "vbs"], xml: ["XML" , "xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"], diff --git a/lib/ace/mode/tm_snippet.js b/lib/ace/mode/tm_snippet.js new file mode 100644 index 00000000..7b7ace08 --- /dev/null +++ b/lib/ace/mode/tm_snippet.js @@ -0,0 +1,86 @@ +define(function(require, exports, module) { +"use strict"; + +var oop = require("../lib/oop"); +var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var SnippetHighlightRules = function() { + + var builtins = "SELECTION|CURRENT_WORD|SELECTED_TEXT|CURRENT_LINE|LINE_INDEX|" + + "LINE_NUMBER|SOFT_TABS|TAB_SIZE|FILENAME|FILEPATH|FULLNAME"; + + this.$rules = { + "start" : [ + {token:"constant.language.escape", regex: /\\[\$}`\\]/}, + {token:"keyword", regex: "\\$(?:TM_)?(?:" + builtins + ")\\b"}, + {token:"variable", regex: "\\$\\w+"}, + {token: function(value, state, stack) { + if (stack[1]) + stack[1]++; + else + stack.unshift("start", 1); + return this.tokenName; + }, tokenName: "markup.list", regex: "\\${", next: "varDecl"}, + {token: function(value, state, stack) { + if (!stack[1]) + return "text"; + stack[1]--; + if (!stack[1]) + stack.splice(0,2); + return this.tokenName; + }, tokenName: "markup.list", regex: "}"}, + {token: "doc,comment", regex:/^\${2}-{5,}$/} + ], + "varDecl" : [ + {regex: /\d+\b/, token: "constant.numeric"}, + {token:"keyword", regex: "(?:TM_)?(?:" + builtins + ")\\b"}, + {token:"variable", regex: "\\w+"}, + {regex: /:/, token: "punctuation.operator", next: "start"}, + {regex: /\//, token: "string.regex", next: "regexp"}, + {regex: "", next: "start"} + ], + "regexp" : [ + {regex: /\\./, token: "escape"}, + {regex: /\[/, token: "regex.start", next: "charClass"}, + {regex: "/", token: "string.regex", next: "format"}, + //{"default": "string.regex"}, + {"token": "string.regex", regex:"."}, + ], + charClass : [ + {regex: "\\.", token: "escape"}, + {regex: "\\]", token: "regex.end", next: "regexp"}, + {"token": "string.regex", regex:"."}, + ], + "format" : [ + {regex: /\\[ulULE]/, token: "keyword"}, + {regex: /\$\d+/, token: "variable"}, + {regex: "/[gim]*:?", token: "string.regex", next: "start"}, + // {"default": "string"}, + {"token": "string", regex:"."}, + ] + }; +}; + +oop.inherits(SnippetHighlightRules, TextHighlightRules); + +exports.SnippetHighlightRules = SnippetHighlightRules; + + +var Mode = function() { + var highlighter = new SnippetHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); +}; +oop.inherits(Mode, TextMode); + +(function() { + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; +}).call(Mode.prototype); +exports.Mode = Mode; + + +}); From 903b7a1951035a5e06b0f5c2c5d38c048552d7d9 Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 3 Jan 2013 18:31:28 +0400 Subject: [PATCH 08/17] minimize number of capturing groups --- lib/ace/tokenizer.js | 116 +++++++++++++++++++++++++++---------------- 1 file changed, 73 insertions(+), 43 deletions(-) diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index 8d161d74..af476878 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * 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 @@ -32,7 +32,7 @@ define(function(require, exports, module) { "use strict"; /** - * + * * * This class takes a set of highlighting rules, and creates a tokenizer out of them. For more information, see [the wiki on extending highlighters](https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode#wiki-extendingTheHighlighter). * @class Tokenizer @@ -43,9 +43,9 @@ define(function(require, exports, module) { * @param {Object} rules The highlighting rules * @param {String} flag Any additional regular expression flags to pass (like "i" for case insensitive) * - * * - * + * + * * @constructor **/ var Tokenizer = function(rules, flag) { @@ -62,21 +62,42 @@ var Tokenizer = function(rules, flag) { var mapping = this.matchMappings[key] = {}; for (var i = 0; i < state.length; i++) { - if (state[i].regex instanceof RegExp) - state[i].regex = state[i].regex.toString().slice(1, -1); + var rule = state[i]; + if (rule.regex instanceof RegExp) + rule.regex = rule.regex.toString().slice(1, -1); // Count number of matching groups. 2 extra groups from the full match // And the catch-all on the end (used to force a match); - var matchcount = new RegExp("(?:(" + state[i].regex + ")|(.))").exec("a").length - 2; - - // Replace any backreferences and offset appropriately. - var adjustedregex = state[i].regex.replace(/\\([0-9]+)/g, function (match, digit) { - return "\\" + (parseInt(digit, 10) + matchTotal + 1); - }); - - if (matchcount > 1 && typeof state[i].token == "string" && state[i].token.length !== matchcount-1) - throw new Error("For " + state[i].regex + " the matching groups (" +(matchcount-1) + ") and length of the token array (" + state[i].token.length + ") don't match (rule #" + i + " of state " + key + ")"); + var adjustedregex = rule.regex + var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2; + if (Array.isArray(rule.token)) { + if (rule.token.length != matchcount - 1) { + throw new Error( + "For " + rule.regex + + " the matching groups (" +(matchcount-1) + + ") and length of the token array (" + rule.token.length + + ") don't match (rule #" + i + " of state " + key + ")" + ); + } + + rule.tokenArray = rule.token; + rule.token = this.$splitHelper; + } + if (matchcount > 1) { + if (/\\\d/.test(rule.regex)) { + // Replace any backreferences and offset appropriately. + adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function (match, digit) { + return "\\" + (parseInt(digit, 10) + matchTotal + 1); + }); + } else { + matchcount = 1; + adjustedregex = this.nonCapturingRegexp(rule.regex); + } + if (!rule.splitRegex) + rule.splitRegex = new RegExp(rule.regex) + } + mapping[matchTotal] = { rule: i, len: matchcount @@ -85,12 +106,33 @@ var Tokenizer = function(rules, flag) { ruleRegExps.push(adjustedregex); } + console.log(key, ruleRegExps) this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", flag); } }; (function() { + this.$splitHelper = function(str) { + var values = str.split(this.splitRegex) + var tokens = []; + var types = this.tokenArray; + for (var i = 0; i < types.length; i++) { + if (values[i + 1]) { + tokens[tokens.length] = { + type: types[i], + value: values[i + 1] + }; + } + } + return tokens; + } + this.nonCapturingRegexp = function(src) { + return src.replace( + /\[(?:\\.|[^\]])*?\]|\\.|\((?:\?:|\?=|!=)|(\()/g, + function(x, y) {return y ? "(?:" : x;} + ); + }; /** * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. @@ -100,9 +142,9 @@ var Tokenizer = function(rules, flag) { if (startState && typeof startState != "string") { var stack = startState.slice(0); startState = stack[0]; - } else { + } else var stack = [] - } + var currentState = startState || "start"; var state = this.rules[currentState]; var mapping = this.matchMappings[currentState]; @@ -110,18 +152,14 @@ var Tokenizer = function(rules, flag) { re.lastIndex = 0; var match, tokens = []; - var lastIndex = 0; - var token = { - type: null, - value: "" - }; + var token = {type: null, value: ""}; while (match = re.exec(line)) { var type = "text"; var rule = null; - var value = [match[0]]; + var value = match[0]; for (var i = 0; i < match.length-2; i++) { if (match[i + 1] === undefined) @@ -129,12 +167,9 @@ var Tokenizer = function(rules, flag) { rule = state[mapping[i].rule]; - if (mapping[i].len > 1) - value = match.slice(i+2, i+1+mapping[i].len); - // compute token type if (typeof rule.token == "function") - type = rule.token(value.length == 1 ? value[0] : value, currentState, stack); + type = rule.token(value, currentState, stack); else type = rule.token; @@ -154,26 +189,21 @@ var Tokenizer = function(rules, flag) { break; } - if (value[0]) { + if (value) { if (typeof type == "string") { - value = [value.join("")]; - type = [type]; - } - for (var i = 0; i < value.length; i++) { - if (!value[i]) - continue; - - if ((!rule || rule.merge !== false) && token.type === type[i]) { - token.value += value[i]; + if ((!rule || rule.merge !== false) && token.type === type) { + token.value += value; } else { if (token.type) tokens.push(token); - - token = { - type: type[i], - value: value[i] - }; + token = {type: type, value: value}; } + } else { + if (token.type) + tokens.push(token); + token = {type: null, value: ""}; + for (var i = 0; i < type.length; i++) + tokens.push(type[i]); } } From 0e7a7b9ebed3d6422752849fae95662b19228928 Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 3 Jan 2013 20:52:36 +0400 Subject: [PATCH 09/17] do not require highlighter to match every letter --- lib/ace/tokenizer.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index af476878..d78058d8 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -106,9 +106,8 @@ var Tokenizer = function(rules, flag) { ruleRegExps.push(adjustedregex); } - console.log(key, ruleRegExps) - this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", flag); + this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag); } }; @@ -143,7 +142,7 @@ var Tokenizer = function(rules, flag) { var stack = startState.slice(0); startState = stack[0]; } else - var stack = [] + var stack = []; var currentState = startState || "start"; var state = this.rules[currentState]; @@ -160,7 +159,16 @@ var Tokenizer = function(rules, flag) { var type = "text"; var rule = null; var value = match[0]; - + var index = re.lastIndex; + + if (index - value.length > lastIndex) { + if (token.type) + tokens.push(token); + token = { + type: "regex", + value: line.substring(lastIndex, index - value.length) + }; + } for (var i = 0; i < match.length-2; i++) { if (match[i + 1] === undefined) continue; @@ -182,9 +190,9 @@ var Tokenizer = function(rules, flag) { state = this.rules[currentState]; } mapping = this.matchMappings[currentState]; - lastIndex = re.lastIndex; + lastIndex = index; re = this.regExps[currentState]; - re.lastIndex = lastIndex; + re.lastIndex = index; } break; } @@ -210,7 +218,7 @@ var Tokenizer = function(rules, flag) { if (lastIndex == line.length) break; - lastIndex = re.lastIndex; + lastIndex = index; } if (token.type) From ea857f23c231a28c24f9dbb3692e74d5390b5e87 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 4 Jan 2013 16:41:54 +0400 Subject: [PATCH 10/17] add {defaultToken: "..."} rules for skipped text --- lib/ace/tokenizer.js | 96 ++++++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 44 deletions(-) diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index d78058d8..1073e3c2 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -50,19 +50,22 @@ define(function(require, exports, module) { **/ var Tokenizer = function(rules, flag) { flag = flag ? "g" + flag : "g"; - this.rules = rules; + this.states = rules; this.regExps = {}; this.matchMappings = {}; - for (var key in this.rules) { - var rule = this.rules[key]; - var state = rule; + for (var key in this.states) { + var state = this.states[key]; var ruleRegExps = []; var matchTotal = 0; - var mapping = this.matchMappings[key] = {}; + var mapping = this.matchMappings[key] = {defaultToken: "text"}; for (var i = 0; i < state.length; i++) { var rule = state[i]; + if (rule.defaultToken) { + mapping.defaultToken = rule.defaultToken; + continue; + } if (rule.regex instanceof RegExp) rule.regex = rule.regex.toString().slice(1, -1); @@ -71,17 +74,12 @@ var Tokenizer = function(rules, flag) { var adjustedregex = rule.regex var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2; if (Array.isArray(rule.token)) { - if (rule.token.length != matchcount - 1) { - throw new Error( - "For " + rule.regex + - " the matching groups (" +(matchcount-1) + - ") and length of the token array (" + rule.token.length + - ") don't match (rule #" + i + " of state " + key + ")" - ); + if (rule.token.length == 1) { + rule.token = rule.token[0]; + } else { + rule.tokenArray = rule.token; + rule.token = this.$arrayTokens; } - - rule.tokenArray = rule.token; - rule.token = this.$splitHelper; } if (matchcount > 1) { @@ -89,19 +87,16 @@ var Tokenizer = function(rules, flag) { // Replace any backreferences and offset appropriately. adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function (match, digit) { return "\\" + (parseInt(digit, 10) + matchTotal + 1); - }); + }); } else { matchcount = 1; - adjustedregex = this.nonCapturingRegexp(rule.regex); + adjustedregex = this.removeCapturingGroups(rule.regex); } if (!rule.splitRegex) - rule.splitRegex = new RegExp(rule.regex) + rule.splitRegex = this.createSplitterRegexp(rule.regex, flag); } - - mapping[matchTotal] = { - rule: i, - len: matchcount - }; + + mapping[matchTotal] = i; matchTotal += matchcount; ruleRegExps.push(adjustedregex); @@ -112,10 +107,14 @@ var Tokenizer = function(rules, flag) { }; (function() { - this.$splitHelper = function(str) { + this.$arrayTokens = function(str) { var values = str.split(this.splitRegex) var tokens = []; var types = this.tokenArray; + if (types.length != values.length - 2) { + console.log(types.length , values.length - 2, str, this.splitRegex) + return [{type: "error.invalid", value: str}]; + } for (var i = 0; i < types.length; i++) { if (values[i + 1]) { tokens[tokens.length] = { @@ -125,12 +124,19 @@ var Tokenizer = function(rules, flag) { } } return tokens; - } - this.nonCapturingRegexp = function(src) { - return src.replace( - /\[(?:\\.|[^\]])*?\]|\\.|\((?:\?:|\?=|!=)|(\()/g, + }; + + this.removeCapturingGroups = function(src) { + var r = src.replace( + /\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g, function(x, y) {return y ? "(?:" : x;} ); + return r; + }; + + this.createSplitterRegexp = function(src, flag) { + src = src.replace(/\(\?=([^()]|\\.)*?\)$/, ""); + return new RegExp(src, flag); }; /** @@ -145,7 +151,7 @@ var Tokenizer = function(rules, flag) { var stack = []; var currentState = startState || "start"; - var state = this.rules[currentState]; + var state = this.states[currentState]; var mapping = this.matchMappings[currentState]; var re = this.regExps[currentState]; re.lastIndex = 0; @@ -156,38 +162,40 @@ var Tokenizer = function(rules, flag) { var token = {type: null, value: ""}; while (match = re.exec(line)) { - var type = "text"; + var type = mapping.defaultToken; var rule = null; var value = match[0]; var index = re.lastIndex; - + if (index - value.length > lastIndex) { - if (token.type) - tokens.push(token); - token = { - type: "regex", - value: line.substring(lastIndex, index - value.length) - }; + var skipped = line.substring(lastIndex, index - value.length); + if (token.type == type) { + token.value += skipped; + } else { + if (token.type) + tokens.push(token); + token = {type: type, value: skipped}; + } } + for (var i = 0; i < match.length-2; i++) { if (match[i + 1] === undefined) continue; - rule = state[mapping[i].rule]; + rule = state[mapping[i]]; // compute token type - if (typeof rule.token == "function") - type = rule.token(value, currentState, stack); - else - type = rule.token; + type = typeof rule.token == "function" + ? rule.token(value, currentState, stack) + : rule.token; if (rule.next) { currentState = rule.next; - state = this.rules[currentState]; + state = this.states[currentState]; if (!state) { window.console && console.error && console.error(currentState, "doesn't exist"); currentState = "start"; - state = this.rules[currentState]; + state = this.states[currentState]; } mapping = this.matchMappings[currentState]; lastIndex = index; From b06e57b4c258dddd5dccd9a9832e505f1e530300 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 4 Jan 2013 16:43:53 +0400 Subject: [PATCH 11/17] use new tokenizer features --- lib/ace/mode/abap_highlight_rules.js | 2 +- lib/ace/mode/dart_highlight_rules.js | 2 +- lib/ace/mode/diff_highlight_rules.js | 8 ++-- lib/ace/mode/doc_comment_highlight_rules.js | 13 ++---- lib/ace/mode/haml_highlight_rules.js | 4 +- lib/ace/mode/jade_highlight_rules.js | 2 +- lib/ace/mode/javascript_highlight_rules.js | 52 +++++++-------------- lib/ace/mode/lua_highlight_rules.js | 14 +++--- lib/ace/mode/markdown_highlight_rules.js | 12 ++--- lib/ace/mode/objectivec_highlight_rules.js | 6 +-- lib/ace/tokenizer.js | 7 ++- 11 files changed, 50 insertions(+), 72 deletions(-) diff --git a/lib/ace/mode/abap_highlight_rules.js b/lib/ace/mode/abap_highlight_rules.js index 38c50bd0..8cc50c07 100644 --- a/lib/ace/mode/abap_highlight_rules.js +++ b/lib/ace/mode/abap_highlight_rules.js @@ -113,7 +113,7 @@ var AbapHighlightRules = function() { {token : "variable.parameter", regex : /sy|pa?\d\d\d\d\|t\d\d\d\.|innnn/}, {token : "keyword", regex : compoundKeywords}, {token : "variable.parameter", regex : /\w+-\w+(?:-\w+)*/}, - {token : keywordMapper, regex : "\\w+\\b"}, + {token : keywordMapper, regex : "\\b\\w+\\b"}, ], "qstring" : [ {token : "constant.language.escape", regex : "''"}, diff --git a/lib/ace/mode/dart_highlight_rules.js b/lib/ace/mode/dart_highlight_rules.js index 531a40d8..c957ef9c 100644 --- a/lib/ace/mode/dart_highlight_rules.js +++ b/lib/ace/mode/dart_highlight_rules.js @@ -51,7 +51,7 @@ var DartHighlightRules = function() { "regex": "^(#!.*)$" }, { - "token": [ "keyword.other.import.dart", "meta.declaration.dart"], + "token": "keyword.other.import.dart", "regex": "#(?:\\b)(?:library|import|source|resource)(?:\\b)" }, { diff --git a/lib/ace/mode/diff_highlight_rules.js b/lib/ace/mode/diff_highlight_rules.js index f232da31..87d021e4 100644 --- a/lib/ace/mode/diff_highlight_rules.js +++ b/lib/ace/mode/diff_highlight_rules.js @@ -63,7 +63,7 @@ var DiffHighlightRules = function() { ], "name": "meta." }, { - "regex": "^(?:(\\-{3}|\\+{3}|\\*{3})( .+))$", + "regex": "^(\\-{3}|\\+{3}|\\*{3})( .+)$", "token": [ "constant.numeric", "meta.tag" @@ -89,8 +89,10 @@ var DiffHighlightRules = function() { "regex": "^Index.+$", "token": "variable" }, { - "regex": "^(.*?)(\\s*)$", - "token": ["invisible", "invalid"] + "regex": "\\s*$", + "token": "invalid" + }, { + "defaultToken": "invisible" } ] }; diff --git a/lib/ace/mode/doc_comment_highlight_rules.js b/lib/ace/mode/doc_comment_highlight_rules.js index 20a1ade6..5262a8e8 100644 --- a/lib/ace/mode/doc_comment_highlight_rules.js +++ b/lib/ace/mode/doc_comment_highlight_rules.js @@ -41,17 +41,10 @@ var DocCommentHighlightRules = function() { token : "comment.doc.tag", regex : "@[\\w\\d_]+" // TODO: fix email addresses }, { - token : "comment.doc", - regex : "\\s+" + token : "comment.doc.tag", + regex : "\\bTODO\\b" }, { - token : "comment.doc", - regex : "TODO" - }, { - token : "comment.doc", - regex : "[^@\\*]+" - }, { - token : "comment.doc", - regex : "." + defaultToken : "comment.doc" }] }; }; diff --git a/lib/ace/mode/haml_highlight_rules.js b/lib/ace/mode/haml_highlight_rules.js index 7d71b67c..9c2a8e12 100644 --- a/lib/ace/mode/haml_highlight_rules.js +++ b/lib/ace/mode/haml_highlight_rules.js @@ -75,8 +75,8 @@ var HamlHighlightRules = function() { "next": "start" }, { - "token": ["text", "punctuation"], - "regex": "($)|((?!\\.|#|\\{|\\[|=|-|~|\\/))", + "token": "empty", + "regex": "$|(?!\\.|#|\\{|\\[|=|-|~|\\/)", "next": "start" } ], diff --git a/lib/ace/mode/jade_highlight_rules.js b/lib/ace/mode/jade_highlight_rules.js index 6a985d97..a7108964 100644 --- a/lib/ace/mode/jade_highlight_rules.js +++ b/lib/ace/mode/jade_highlight_rules.js @@ -136,7 +136,7 @@ var JadeHighlightRules = function() { }, // Match any tag, id or class. skip AST filters { - "token": ["meta.tag.any.jade", "entity.variable.tag.jade"], + "token": "meta.tag.any.jade", "regex": /^\s*(?!\w+\:)(?:[\w]+|(?=\.|#)])/, "next": "tag_single" }, diff --git a/lib/ace/mode/javascript_highlight_rules.js b/lib/ace/mode/javascript_highlight_rules.js index fcef1c57..24cee3ba 100644 --- a/lib/ace/mode/javascript_highlight_rules.js +++ b/lib/ace/mode/javascript_highlight_rules.js @@ -61,7 +61,8 @@ var JavaScriptHighlightRules = function() { "constant.language": "null|Infinity|NaN|undefined", "support.function": - "alert" + "alert", + "constant.language.boolean": "true|false" }, "identifier"); // keywords which can be followed by regular expressions @@ -161,9 +162,6 @@ var JavaScriptHighlightRules = function() { ], regex : "(:)(\\s*)(function)(\\s*)(\\()", next: "function_arguments" - }, { - token : "constant.language.boolean", - regex : /(?:true|false)\b/ }, { token : "keyword", regex : "(?:" + kwBeforeRe + ")\\b", @@ -205,9 +203,6 @@ var JavaScriptHighlightRules = function() { }, { token: "comment", regex: /^#!.*$/ - }, { - token : "text", - regex : /\s+/ } ], // regular expressions are only allowed after certain tokens. This @@ -253,18 +248,20 @@ var JavaScriptHighlightRules = function() { }, { // operators token : "constant.language.escape", - regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[(|)$^+*?]/ + regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[()$^+*?]/ }, { - token: "string.regexp", - regex: /{|[^{\[\/\\(|)$^+*?]+/, + token : "constant.language.delimiter", + regex: /\|/ }, { token: "constant.language.escape", regex: /\[\^?/, next: "regex_character_class", }, { token: "empty", - regex: "", + regex: "$", next: "start" + }, { + defaultToken: "string.regexp" } ], "regex_character_class": [ @@ -278,13 +275,12 @@ var JavaScriptHighlightRules = function() { }, { token: "constant.language.escape", regex: "-" - }, { - token: "string.regexp.charachterclass", - regex: /[^\]\-\\]+/, }, { token: "empty", - regex: "", + regex: "$", next: "start" + }, { + defaultToken: "string.regexp.charachterclass" } ], "function_arguments": [ @@ -304,24 +300,12 @@ var JavaScriptHighlightRules = function() { } ], "comment_regex_allowed" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "regex_allowed" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } + {token : "comment", regex : "\\*\\/", next : "regex_allowed"}, + {defaultToken : "comment"} ], "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } + {token : "comment", regex : "\\*\\/", next : "start"}, + {defaultToken : "comment"} ], "qqstring" : [ { @@ -336,8 +320,7 @@ var JavaScriptHighlightRules = function() { regex : '"|$', next : "start", }, { - token : "string", - regex : '.|\\w+|\\s+', + defaultToken: "string" } ], "qstring" : [ @@ -353,8 +336,7 @@ var JavaScriptHighlightRules = function() { regex : "'|$", next : "start", }, { - token : "string", - regex : '.|\\w+|\\s+', + defaultToken: "string" } ] }; diff --git a/lib/ace/mode/lua_highlight_rules.js b/lib/ace/mode/lua_highlight_rules.js index 77a29f97..4a762ab4 100644 --- a/lib/ace/mode/lua_highlight_rules.js +++ b/lib/ace/mode/lua_highlight_rules.js @@ -99,7 +99,7 @@ var LuaHighlightRules = function() { "start" : [{ stateName: "bracketedComment", token : function(value, currentState, stack){ - stack.unshift("bracketedComment", value.length); + stack.unshift(this.next, value.length, currentState); return "comment"; }, regex : /\-\-\[=*\[/, @@ -109,7 +109,7 @@ var LuaHighlightRules = function() { if (value.length == stack[1]) { stack.shift(); stack.shift(); - this.next = "start"; + this.next = stack.shift(); } else { this.next = ""; } @@ -118,8 +118,7 @@ var LuaHighlightRules = function() { regex : /(?:[^\\]|\\.)*?\]=*\]/, next : "start" }, { - token : "comment", - regex : '.+' + defaultToken : "comment" } ] }, @@ -131,7 +130,7 @@ var LuaHighlightRules = function() { { stateName: "bracketedString", token : function(value, currentState, stack){ - stack.unshift("bracketedString", value.length); + stack.unshift(this.next, value.length, currentState); return "comment"; }, regex : /\[=*\[/, @@ -141,7 +140,7 @@ var LuaHighlightRules = function() { if (value.length == stack[1]) { stack.shift(); stack.shift(); - this.next = "start"; + this.next = stack.shift(); } else { this.next = ""; } @@ -151,8 +150,7 @@ var LuaHighlightRules = function() { regex : /(?:[^\\]|\\.)*?\]=*\]/, next : "start" }, { - token : "comment", - regex : '.+' + defaultToken : "comment" } ] }, diff --git a/lib/ace/mode/markdown_highlight_rules.js b/lib/ace/mode/markdown_highlight_rules.js index 033cf88a..3da5bd83 100644 --- a/lib/ace/mode/markdown_highlight_rules.js +++ b/lib/ace/mode/markdown_highlight_rules.js @@ -56,8 +56,8 @@ var MarkdownHighlightRules = function() { token : "empty_line", regex : '^$' }, { // code span ` - token : ["support.function", "support.function", "support.function"], - regex : "(`+)([^\\r]*?[^`])(\\1)" + token : "support.function", + regex : "(`+)(.*?[^`])(\\1)" }, { // code block token : "support.function", regex : "^[ ]{4}.+" @@ -112,11 +112,11 @@ var MarkdownHighlightRules = function() { regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", next : "listblock" }, { // strong ** __ - token : ["string", "string", "string"], - regex : "([*]{2}|[_]{2}(?=\\S))([^\\r]*?\\S[*_]*)(\\1)" + token : "string", + regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)" }, { // emphasis * _ - token : ["string", "string", "string"], - regex : "([*]|[_](?=\\S))([^\\r]*?\\S[*_]*)(\\1)" + token : "string", + regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)" }, { // token : ["text", "url", "text"], regex : "(<)("+ diff --git a/lib/ace/mode/objectivec_highlight_rules.js b/lib/ace/mode/objectivec_highlight_rules.js index adc95e39..e05c5448 100644 --- a/lib/ace/mode/objectivec_highlight_rules.js +++ b/lib/ace/mode/objectivec_highlight_rules.js @@ -92,8 +92,8 @@ var ObjectiveCHighlightRules = function() { "regex": "(@)(class|protocol)\\b" }, { - "token": [ "punctuation.definition.storage.type.objc", "punctuation.definition.storage.type.objc", "punctuation"], - "regex": "(@)(selector)(\\s*\\()", + "token": [ "punctuation.definition.storage.type.objc", "punctuation"], + "regex": "(@selector)(\\s*\\()", "next": "selectors" }, { @@ -231,7 +231,7 @@ var ObjectiveCHighlightRules = function() { "next": "start" }, { - "token": ["support.function.any-method.objc", "punctuation.separator.arguments.objc"], + "token": "support.function.any-method.objc", "regex": "\\w+(?::|(?=\]))", "next": "start" } diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index 1073e3c2..c7d6bee9 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -71,7 +71,7 @@ var Tokenizer = function(rules, flag) { // Count number of matching groups. 2 extra groups from the full match // And the catch-all on the end (used to force a match); - var adjustedregex = rule.regex + var adjustedregex = rule.regex; var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2; if (Array.isArray(rule.token)) { if (rule.token.length == 1) { @@ -108,11 +108,14 @@ var Tokenizer = function(rules, flag) { (function() { this.$arrayTokens = function(str) { + if (!str) + return []; var values = str.split(this.splitRegex) var tokens = []; var types = this.tokenArray; if (types.length != values.length - 2) { - console.log(types.length , values.length - 2, str, this.splitRegex) + if (window.console) + console.error(types.length , values.length - 2, str, this.splitRegex); return [{type: "error.invalid", value: str}]; } for (var i = 0; i < types.length; i++) { From 92935b48967a09a957441da453b44be124ab1a5a Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 12 Jan 2013 12:49:20 +0400 Subject: [PATCH 12/17] fix highlighting of CoffeeScript function arguments issue #1168 --- lib/ace/mode/coffee_highlight_rules.js | 117 ++++--------------------- 1 file changed, 16 insertions(+), 101 deletions(-) diff --git a/lib/ace/mode/coffee_highlight_rules.js b/lib/ace/mode/coffee_highlight_rules.js index 78e0bf6e..22298451 100644 --- a/lib/ace/mode/coffee_highlight_rules.js +++ b/lib/ace/mode/coffee_highlight_rules.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * 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 @@ -86,23 +86,9 @@ define(function(require, exports, module) { "variable.language": variableLanguage }, "identifier"); - var functionRules = { - "({args})->": { - token: ["paren.lparen", "text", "paren.lparen", "text", "variable.parameter", "text", "paren.rparen", "text", "paren.rparen", "text", "storage.type"], - regex: "(\\()(\\s*)(\\{)(\\s*)([$@A-Za-z_\\x7f-\\uffff][$@\\w\\s,\\x7f-\\uffff]*)(\\s*)(\\})(\\s*)(\\))(\\s*)([\\-=]>)" - }, - "({})->": { - token: ["paren.lparen", "text", "paren.lparen", "text", "paren.rparen", "text", "paren.rparen", "text", "storage.type"], - regex: "(\\()(\\s*)(\\{)(\\s*)(\\})(\\s*)(\\))(\\s*)([\\-=]>)" - }, - "(args)->": { - token: ["paren.lparen", "text", "variable.parameter", "text", "paren.rparen", "text", "storage.type"], - regex: "(\\()(\\s*)([$@A-Za-z_\\x7f-\\uffff][\\s\\x21-\\uffff]*)(\\s*)(\\))(\\s*)([\\-=]>)" - }, - "()->": { - token: ["paren.lparen", "text", "paren.rparen", "text", "storage.type"], - regex: "(\\()(\\s*)(\\))(\\s*)([\\-=]>)" - } + var functionRule = { + token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"], + regex: /(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()\"'\/])*?)(\))(\s*)([\-=]>)/ }; this.$rules = { @@ -145,94 +131,23 @@ define(function(require, exports, module) { token : "comment", regex : "#.*" }, { - token : [ - "punctuation.operator", "identifier" - ], - regex : "(\\.)(" + illegal + ")" + token : ["punctuation.operator", "text", "identifier"], + regex : "(\\.)(\\s*)(" + identifier + ")" }, { token : "punctuation.operator", regex : "\\." }, { //class A extends B - token : [ - "keyword", "text", "language.support.class", "text", "keyword", "text", "language.support.class" - ], - regex : "(class)(\\s+)(" + identifier + ")(\\s+)(extends)(\\s+)(" + identifier + ")" + token : ["keyword", "text", "language.support.class", + "text", "keyword", "text", "language.support.class"], + regex : "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?" }, { - //class A - token : [ - "keyword", "text", "language.support.class" - ], - regex : "(class)(\\s+)(" + identifier + ")" - }, { - //play = ({args}) -> - token : [ - "entity.name.function", "text", "keyword.operator", "text" - ].concat(functionRules["({args})->"].token), - regex : "(" + identifier + ")(\\s*)(=)(\\s*)" + functionRules["({args})->"].regex - }, { - //play : ({args}) -> - token : [ - "entity.name.function", "text", "punctuation.operator", "text" - ].concat(functionRules["({args})->"].token), - regex : "(" + identifier + ")(\\s*)(:)(\\s*)" + functionRules["({args})->"].regex - }, { - //play = ({}) -> - token : [ - "entity.name.function", "text", "keyword.operator", "text" - ].concat(functionRules["({})->"].token), - regex : "(" + identifier + ")(\\s*)(=)(\\s*)" + functionRules["({})->"].regex - }, { - //play : ({}) -> - token : [ - "entity.name.function", "text", "punctuation.operator", "text" - ].concat(functionRules["({})->"].token), - regex : "(" + identifier + ")(\\s*)(:)(\\s*)" + functionRules["({})->"].regex - }, { - //play = (args) -> - token : [ - "entity.name.function", "text", "keyword.operator", "text" - ].concat(functionRules["(args)->"].token), - regex : "(" + identifier + ")(\\s*)(=)(\\s*)" + functionRules["(args)->"].regex - }, { - //play : (args) -> - token : [ - "entity.name.function", "text", "punctuation.operator", "text" - ].concat(functionRules["(args)->"].token), - regex : "(" + identifier + ")(\\s*)(:)(\\s*)" + functionRules["(args)->"].regex - }, { - //play = () -> - token : [ - "entity.name.function", "text", "keyword.operator", "text" - ].concat(functionRules["()->"].token), - regex : "(" + identifier + ")(\\s*)(=)(\\s*)" + functionRules["()->"].regex - }, { - //play : () -> - token : [ - "entity.name.function", "text", "punctuation.operator", "text" - ].concat(functionRules["()->"].token), - regex : "(" + identifier + ")(\\s*)(:)(\\s*)" + functionRules["()->"].regex - }, { - //play = -> - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type" - ], - regex : "(" + identifier + ")(\\s*)(=)(\\s*)([\\-=]>)" - }, { - //play : -> - token : [ - "entity.name.function", "text", "punctuation.operator", "text", "storage.type" - ], - regex : "(" + identifier + ")(\\s*)(:)(\\s*)([\\-=]>)" + //play = (...) -> + token : ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token), + regex : "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex }, - functionRules["({args})->"], - functionRules["({})->"], - functionRules["(args)->"], - functionRules["()->"] - , { - token : "identifier", - regex : "(?:(?:\\.|::)\\s*)" + identifier - }, { + functionRule, + { token : "variable", regex : "@(?:" + identifier + ")?" }, { @@ -240,7 +155,7 @@ define(function(require, exports, module) { regex : identifier }, { token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\." + regex : "\\,|\\." }, { token : "storage.type", regex : "[\\-=]>" From c477184f2a0e2a0e89a88b63e0569b1ca077a826 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 12 Jan 2013 20:31:42 +0400 Subject: [PATCH 13/17] update more highlighters --- lib/ace/mode/coffee_highlight_rules.js | 84 ++++------ lib/ace/mode/markdown_highlight_rules.js | 131 ++++++++------- lib/ace/mode/php_highlight_rules.js | 27 +--- lib/ace/mode/text_highlight_rules.js | 28 ++-- lib/ace/mode/xml_util.js | 2 +- lib/ace/tokenizer_dev.js | 197 ++++++++++++++--------- tool/mode_creator.js | 2 +- 7 files changed, 258 insertions(+), 213 deletions(-) diff --git a/lib/ace/mode/coffee_highlight_rules.js b/lib/ace/mode/coffee_highlight_rules.js index 22298451..7731da88 100644 --- a/lib/ace/mode/coffee_highlight_rules.js +++ b/lib/ace/mode/coffee_highlight_rules.js @@ -38,10 +38,6 @@ define(function(require, exports, module) { function CoffeeHighlightRules() { var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; - var stringfill = { - token : "string", - regex : ".+" - }; var keywords = ( "this|throw|then|try|typeof|super|switch|return|break|by|continue|" + @@ -91,31 +87,50 @@ define(function(require, exports, module) { regex: /(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()\"'\/])*?)(\))(\s*)([\-=]>)/ }; + var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/; + this.$rules = { start : [ { token : "constant.numeric", regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)" }, { - token : "string", - regex : "'''", - next : "qdoc" + stateName: "qdoc", + token : "string", regex : "'''", next : [ + {token : "string", regex : "'''", next : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"}, + ] }, { + stateName: "qqdoc", token : "string", regex : '"""', - next : "qqdoc" + next : [ + {token : "string", regex : '"""', next : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"} + ] }, { - token : "string", - regex : "'", - next : "qstring" + stateName: "qstring", + token : "string", regex : "'", next : [ + {token : "string", regex : "'", next : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"}, + ] }, { - token : "string", - regex : '"', - next : "qqstring" + stateName: "qqstring", + token : "string.start", regex : '"', next : [ + {token : "string.end", regex : '"', next : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"}, + ] }, { - token : "string", - regex : "`", - next : "js" + stateName: "js", + token : "string", regex : "`", next : [ + {token : "string", regex : "`", next : "start"}, + {token : "constant.language.escape", regex : stringEscape}, + {defaultToken: "string"}, + ] }, { token : "string.regex", regex : "///", @@ -173,35 +188,6 @@ define(function(require, exports, module) { regex : "\\s+" }], - qdoc : [{ - token : "string", - regex : ".*?'''", - next : "start" - }, stringfill], - - qqdoc : [{ - token : "string", - regex : '.*?"""', - next : "start" - }, stringfill], - - qstring : [{ - token : "string", - regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'", - next : "start" - }, stringfill], - - qqstring : [{ - token : "string", - regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', - next : "start" - }, stringfill], - - js : [{ - token : "string", - regex : "[^\\\\`]*(?:\\\\.[^\\\\`]*)*`", - next : "start" - }, stringfill], heregex : [{ token : "string.regex", @@ -217,13 +203,13 @@ define(function(require, exports, module) { comment : [{ token : "comment", - regex : '.*?###', + regex : '###', next : "start" }, { - token : "comment", - regex : ".+" + defaultToken : "comment", }] }; + this.normalizeRules(); } exports.CoffeeHighlightRules = CoffeeHighlightRules; diff --git a/lib/ace/mode/markdown_highlight_rules.js b/lib/ace/mode/markdown_highlight_rules.js index 3da5bd83..6a62d7e1 100644 --- a/lib/ace/mode/markdown_highlight_rules.js +++ b/lib/ace/mode/markdown_highlight_rules.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * 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 @@ -52,38 +52,9 @@ var MarkdownHighlightRules = function() { // regexps are ordered -> the first match is used this.$rules = { - "start" : [ { - token : "empty_line", - regex : '^$' - }, { // code span ` + "basic" : [{ // code span ` token : "support.function", regex : "(`+)(.*?[^`])(\\1)" - }, { // code block - token : "support.function", - regex : "^[ ]{4}.+" - }, { // h1 - token: "markup.heading.1", - regex: "^=+(?=\\s*$)" - }, { // h2 - token: "markup.heading.2", - regex: "^\\-+(?=\\s*$)" - }, { // header - token : function(value) { - return "markup.heading." + value.search(/[^#]/); - }, - regex : "^#{1,6}(?:[^ #].*| +.*(?:[^ #].*|[^ ]+.* +#+ *))$" - }, github_embed("(?:javascript|js)", "js-"), - github_embed("xml", "xml-"), - github_embed("html", "html-"), - github_embed("css", "css-"), - { // Github style block - token : "support.function", - regex : "^```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$", - next : "githubblock" - }, { // block quote - token : "string", - regex : "^>[ ].+$", - next : "blockquote" }, { // reference token : ["text", "constant", "text", "url", "string", "text"], regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$" @@ -98,46 +69,87 @@ var MarkdownHighlightRules = function() { "(?)"+ "((?:[ \t]*\"(?:.*?)\"[ \\t]*)?)"+ "(\\))" - }, { // HR * - token : "constant", - regex : "^[ ]{0,2}(?:[ ]?\\*[ ]?){3,}\\s*$" - }, { // HR - - token : "constant", - regex : "^[ ]{0,2}(?:[ ]?\\-[ ]?){3,}\\s*$" - }, { // HR _ - token : "constant", - regex : "^[ ]{0,2}(?:[ ]?\\_[ ]?){3,}\\s*$" - }, { // list - token : "markup.list", - regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", - next : "listblock" }, { // strong ** __ token : "string", regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)" }, { // emphasis * _ token : "string", regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)" - }, { // + }, { // token : ["text", "url", "text"], regex : "(<)("+ "(?:https?|ftp|dict):[^'\">\\s]+"+ "|"+ "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+ ")(>)" + }], + + // code block + "allowBlock": [ + {token : "support.function", regex : "^ {4}.+", next : "allowBlock"}, + {token : "empty", regex : "", next : "start"} + ], + + "start" : [{ + token : "empty_line", + regex : '^$', + next: "allowBlock" + }, { // h1 + token: "markup.heading.1", + regex: "^=+(?=\\s*$)" + }, { // h2 + token: "markup.heading.2", + regex: "^\\-+(?=\\s*$)" + }, { // header + token : function(value) { + return "markup.heading." + value.search(/[^#]/); + }, + regex : "^#{1,6}(?:[^ #].*| +.*(?:[^ #].*|[^ ]+.* +#+ *))$" + }, + github_embed("(?:javascript|js)", "js-"), + github_embed("xml", "xml-"), + github_embed("html", "html-"), + github_embed("css", "css-"), + { // Github style block + token : "support.function", + regex : "^```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$", + next : "githubblock" + }, { // block quote + token : "string", + regex : "^>[ ].+$", + next : "blockquote" + }, { // HR * - _ + token : "constant", + regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$", + next: "allowBlock" + }, { // list + token : "markup.list", + regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", + next : "listblock-start" }, { - token : "text", - regex : "[^\\*_%$`\\[#<>]+" - } ], - + include : "basic" + }], + + "listblock-start" : [{ + token : "support.variable", + regex : /(?:\[[ x]\])?/, + next : "listblock" + }], + "listblock" : [ { // Lists only escape on completely blank lines. token : "empty_line", regex : "^$", next : "start" }, { + include : "basic", noEscape: true + }, { // list token : "markup.list", - regex : ".+" + regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", + next : "listblock-start" + }, { + defaultToken : "markup.list" } ], - + "blockquote" : [ { // BLockquotes only escape on blank lines. token : "empty_line", regex : "^\\s*$", @@ -146,7 +158,7 @@ var MarkdownHighlightRules = function() { token : "string", regex : ".+" } ], - + "githubblock" : [ { token : "support.function", regex : "^```", @@ -156,31 +168,31 @@ var MarkdownHighlightRules = function() { regex : ".+" } ] }; - + this.embedRules(JavaScriptHighlightRules, "js-", [{ token : "support.function", regex : "^```", next : "start" }]); - + this.embedRules(HtmlHighlightRules, "html-", [{ token : "support.function", regex : "^```", next : "start" }]); - + this.embedRules(CssHighlightRules, "css-", [{ token : "support.function", regex : "^```", next : "start" }]); - + this.embedRules(XmlHighlightRules, "xml-", [{ token : "support.function", regex : "^```", next : "start" }]); - + var html = new HtmlHighlightRules().getRules(); for (var i in html) { if (this.$rules[i]) @@ -188,7 +200,8 @@ var MarkdownHighlightRules = function() { else this.$rules[i] = html[i]; } - + + this.normalizeRules(); }; oop.inherits(MarkdownHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/php_highlight_rules.js b/lib/ace/mode/php_highlight_rules.js index 430fc0ec..b772f759 100644 --- a/lib/ace/mode/php_highlight_rules.js +++ b/lib/ace/mode/php_highlight_rules.js @@ -1030,31 +1030,18 @@ var PhpLangHighlightRules = function() { regex : '\\\\(?:[nrtvef\\\\"$]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2})' }, { token : "constant.language.escape", - regex : /\$[\w\d]+(?:\[[\w\d]+\])?/ + regex : /\$[\w]+(?:\[[\w\]+]|=>\w+)?/ }, { token : "constant.language.escape", regex : /\$\{[^"\}]+\}?/ // this is wrong but ok for now - }, { - token : "string", - regex : '"', - next : "start" - }, { - token : "string", - regex : '.+?' - } + }, + {token : "string", regex : '"', next : "start"}, + {defaultToken : "string"} ], "qstring" : [ - { - token : "constant.language.escape", - regex : "\\\\['\\\\]" - }, { - token : "string", - regex : "'", - next : "start" - }, { - token : "string", - regex : ".+?" - } + {token : "constant.language.escape", regex : /\\['\\]/}, + {token : "string", regex : "'", next : "start"}, + {defaultToken : "string"} ] }; diff --git a/lib/ace/mode/text_highlight_rules.js b/lib/ace/mode/text_highlight_rules.js index 25a8bc87..2d11602c 100644 --- a/lib/ace/mode/text_highlight_rules.js +++ b/lib/ace/mode/text_highlight_rules.js @@ -99,24 +99,30 @@ var TextHighlightRules = function() { this.normalizeRules = function() { var id = 0; for (var key in this.$rules) { - var rule = this.$rules[key]; - for (var i = 0; i < rule.length; i++) { - var state = rule[i]; - if (state.next && Array.isArray(state.next)) { - var stateName = state.stateName || ("state" + id++); - this.$rules[stateName] = state.next; - state.next = stateName; + var state = this.$rules[key]; + for (var i = 0; i < state.length; i++) { + var rule = state[i]; + if (rule.next && Array.isArray(rule.next)) { + var stateName = rule.stateName || ("state" + id++); + this.$rules[stateName] = rule.next; + rule.next = stateName; } - if (state.rules) { - for (var r in state.rules) { + if (rule.rules) { + for (var r in rule.rules) { if (this.$rules[r]) { if (this.$rules[r].push) - this.$rules[r].push.apply(this.$rules[r], state.rules[r]); + this.$rules[r].push.apply(this.$rules[r], rule.rules[r]); } else { - this.$rules[r] = state.rules[r]; + this.$rules[r] = rule.rules[r]; } } } + if (rule.include || typeof rule == "string") { + var args = [i, 1].concat(this.$rules[rule.include || rule]); + if (rule.noEscape) + args = args.filter(function(x) {return !x.next;}); + state.splice.apply(state, args); + } } } }; diff --git a/lib/ace/mode/xml_util.js b/lib/ace/mode/xml_util.js index 781249f8..abae6075 100644 --- a/lib/ace/mode/xml_util.js +++ b/lib/ace/mode/xml_util.js @@ -50,7 +50,7 @@ function multiLineString(quote, state) { token : "constant.language.escape", regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" }, - {token : "string", regex : '\\w+|.|\\s+'} + {defaultToken : "string"} ]; } diff --git a/lib/ace/tokenizer_dev.js b/lib/ace/tokenizer_dev.js index 6022c4ae..2ec56692 100644 --- a/lib/ace/tokenizer_dev.js +++ b/lib/ace/tokenizer_dev.js @@ -37,51 +37,111 @@ define(function(require, exports, module) { **/ var Tokenizer = function(rules, flag) { flag = flag ? "g" + flag : "g"; - this.rules = rules; + this.states = rules; this.regExps = {}; this.matchMappings = {}; - for ( var key in this.rules) { - var rule = this.rules[key]; - var state = rule; + for (var key in this.states) { + var state = this.states[key]; var ruleRegExps = []; var matchTotal = 0; - var mapping = this.matchMappings[key] = {}; + var mapping = this.matchMappings[key] = {defaultToken: "default.text"}; - for ( var i = 0; i < state.length; i++) { - - if (state[i].regex instanceof RegExp) - state[i].regex = state[i].regex.toString().slice(1, -1); + for (var i = 0; i < state.length; i++) { + var rule = state[i]; + if (rule.defaultToken) { + mapping.defaultToken = rule.defaultToken; + continue; + } + if (rule.regex instanceof RegExp) + rule.regex = rule.regex.toString().slice(1, -1); // Count number of matching groups. 2 extra groups from the full match // And the catch-all on the end (used to force a match); - var matchcount = new RegExp("(?:(" + state[i].regex + ")|(.))").exec("a").length - 2; + var adjustedregex = rule.regex; + var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2; + if (Array.isArray(rule.token)) { + if (rule.token.length == 1) { + rule.token = rule.token[0]; + } else { + rule.tokenArray = rule.token; + rule.token = this.$arrayTokens; + } + } - // Replace any backreferences and offset appropriately. - var adjustedregex = state[i].regex.replace(/\\([0-9]+)/g, function (match, digit) { - return "\\" + (parseInt(digit, 10) + matchTotal + 1); - }); + if (matchcount > 1) { + if (/\\\d/.test(rule.regex)) { + // Replace any backreferences and offset appropriately. + adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function (match, digit) { + return "\\" + (parseInt(digit, 10) + matchTotal + 1); + }); + } else { + matchcount = 1; + adjustedregex = this.removeCapturingGroups(rule.regex); + } + if (!rule.splitRegex) + rule.splitRegex = this.createSplitterRegexp(rule.regex, flag); + } - if (matchcount > 1 && state[i].token.length !== matchcount-1) - throw new Error("For " + state[i].regex + " the matching groups and length of the token array don't match (rule #" + i + " of state " + key + ")"); - - mapping[matchTotal] = { - rule: i, - len: matchcount - }; + mapping[matchTotal] = i; matchTotal += matchcount; ruleRegExps.push(adjustedregex); } - this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", flag); + this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag); } }; (function() { + this.$arrayTokens = function(str) { + if (!str) + return []; + var values = str.split(this.splitRegex) + var tokens = []; + var types = this.tokenArray; + if (types.length != values.length - 2) { + if (window.console) + console.error(types.length , values.length - 2, str, this.splitRegex); + return [{type: "error.invalid", value: str}]; + } + for (var i = 0; i < types.length; i++) { + if (values[i + 1]) { + tokens[tokens.length] = { + type: types[i], + value: values[i + 1] + }; + } + } + return tokens; + }; + + this.removeCapturingGroups = function(src) { + var r = src.replace( + /\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g, + function(x, y) {return y ? "(?:" : x;} + ); + return r; + }; + + this.createSplitterRegexp = function(src, flag) { + src = src.replace(/\(\?=([^()]|\\.)*?\)$/, ""); + return new RegExp(src, flag); + }; + + /** + * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. + * @returns {Object} + **/ this.getLineTokens = function(line, startState) { + if (startState && typeof startState != "string") { + var stack = startState.slice(0); + startState = stack[0]; + } else + var stack = []; + var currentState = startState || "start"; - var state = this.rules[currentState]; + var state = this.states[currentState]; var mapping = this.matchMappings[currentState]; var re = this.regExps[currentState]; re.lastIndex = 0; @@ -110,92 +170,85 @@ var Tokenizer = function(rules, flag) { var maxRecur = 10000; while (match = re.exec(line)) { - var type = "default.text"; + var type = mapping.defaultToken; var rule = null; - var value = [match[0]]; + var value = match[0]; + var index = re.lastIndex; + + if (index - value.length > lastIndex) { + var skipped = line.substring(lastIndex, index - value.length); + if (token.type == type) { + token.value += skipped; + } else { + if (token.type) + tokens.push(token); + token = {type: type, value: skipped}; + } + } for (var i = 0; i < match.length-2; i++) { if (match[i + 1] === undefined) continue; if (!maxRecur--) { - throw "infinite" + mapping[i].rule + currentState + throw "infinite" + state[mapping[i]] + currentState } - rule = state[mapping[i].rule]; - - if (mapping[i].len > 1) - value = match.slice(i+2, i+1+mapping[i].len); + rule = state[mapping[i]]; // compute token type - if (typeof rule.token == "function") - type = rule.token.apply(this, value); - else - type = rule.token; + type = typeof rule.token == "function" + ? rule.token(value, currentState, stack) + : rule.token; if (rule.next) { currentState = rule.next; - state = this.rules[currentState]; - mapping = this.matchMappings[currentState]; - lastIndex = re.lastIndex; - - re = this.regExps[currentState]; - - if (re === undefined) { - throw new Error("You indicated a state of " + rule.next + " to go to, but it doesn't exist!"); + state = this.states[currentState]; + if (!state) { + window.console && console.error && console.error(currentState, "doesn't exist"); + currentState = "start"; + state = this.states[currentState]; } - - re.lastIndex = lastIndex; + mapping = this.matchMappings[currentState]; + lastIndex = index; + re = this.regExps[currentState]; + re.lastIndex = index; onStateChange(); } break; } - if (value[0]) { + if (value) { if (typeof type == "string") { - value = [value.join("")]; - type = [type]; - } - for (var i = 0; i < value.length; i++) { - if (!value[i]) - continue; - - var mergeable = (!rule || rule.merge || type[i] === "text") && token.type === type[i]; - - if (false && mergeable) { - token.value += value[i]; + if ((!rule || rule.merge !== false) && token.type === type) { + token.value += value; } else { - if (token.type) { - token.stateTransitions = stateTransitions; + if (token.type) tokens.push(token); - initState() - } - - token = { - type: type[i], - value: value[i], - state: currentState, - mergeable: mergeable - }; + token = {type: type, value: value}; } + } else { + if (token.type) + tokens.push(token); + token = {type: null, value: ""}; + for (var i = 0; i < type.length; i++) + tokens.push(type[i]); } } if (lastIndex == line.length) break; - lastIndex = re.lastIndex; + lastIndex = index; } - if (token.type) { - token.stateTransitions = stateTransitions; + if (token.type) tokens.push(token); - } return { tokens : tokens, - state : currentState + state : stack.length ? stack : currentState }; }; diff --git a/tool/mode_creator.js b/tool/mode_creator.js index 70ee3225..f87a9622 100644 --- a/tool/mode_creator.js +++ b/tool/mode_creator.js @@ -118,7 +118,7 @@ function run() { var path = "ace/mode/new"; var deps = getDeps(src, path); src = src.replace("define(", 'define("' + path +'", ["require","exports","module",' + deps +'],'); - src += ';require(["ace/mode/new"], continueRun, function(e){console.log(e);require.undef("ace/mode/new")})'; + src += ';require(["ace/mode/new"], continueRun, function(e){console.log(e);window.require.undef("ace/mode/new")})'; try { eval(src); } catch(e) { From 4ecfa6b38dddcd686a8e928cf1eedf40a5d2ecf4 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 12 Jan 2013 21:26:36 +0400 Subject: [PATCH 14/17] fix coffeescript tests --- lib/ace/mode/coffee_highlight_rules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ace/mode/coffee_highlight_rules.js b/lib/ace/mode/coffee_highlight_rules.js index 7731da88..7ff612f5 100644 --- a/lib/ace/mode/coffee_highlight_rules.js +++ b/lib/ace/mode/coffee_highlight_rules.js @@ -84,7 +84,7 @@ define(function(require, exports, module) { var functionRule = { token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"], - regex: /(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()\"'\/])*?)(\))(\s*)([\-=]>)/ + regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()\"'\/])*?)(\))(\s*))?([\-=]>)/.source }; var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/; @@ -147,7 +147,7 @@ define(function(require, exports, module) { regex : "#.*" }, { token : ["punctuation.operator", "text", "identifier"], - regex : "(\\.)(\\s*)(" + identifier + ")" + regex : "(\\.)(\\s*)(" + illegal + ")" }, { token : "punctuation.operator", regex : "\\." From 77a02fc109fe26a36d6961ff878706939fd1c41e Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 28 Dec 2012 20:44:05 +0400 Subject: [PATCH 15/17] code style --- lib/ace/mode/dart_highlight_rules.js | 126 +++++------ lib/ace/mode/diff_highlight_rules.js | 40 ++-- lib/ace/mode/haml_highlight_rules.js | 86 +++---- lib/ace/mode/jade_highlight_rules.js | 160 ++++++------- lib/ace/mode/lisp_highlight_rules.js | 53 ++--- lib/ace/mode/makefile_highlight_rules.js | 44 ++-- lib/ace/mode/objectivec_highlight_rules.js | 252 ++++++++++----------- lib/ace/mode/ruby_highlight_rules.js | 4 +- lib/ace/mode/stylus_highlight_rules.js | 46 ++-- lib/ace/mode/typescript_highlight_rules.js | 32 +-- 10 files changed, 420 insertions(+), 423 deletions(-) diff --git a/lib/ace/mode/dart_highlight_rules.js b/lib/ace/mode/dart_highlight_rules.js index c957ef9c..e79229da 100644 --- a/lib/ace/mode/dart_highlight_rules.js +++ b/lib/ace/mode/dart_highlight_rules.js @@ -38,101 +38,101 @@ var DartHighlightRules = function() { { "start": [ { - "token" : "comment", - "regex" : /\/\/.*$/ + token : "comment", + regex : /\/\/.*$/ }, { - "token" : "comment", // multi line comment - "regex" : /\/\*/, - "next" : "comment" + token : "comment", // multi line comment + regex : /\/\*/, + next : "comment" }, { - "token": ["meta.preprocessor.script.dart"], - "regex": "^(#!.*)$" + token: ["meta.preprocessor.script.dart"], + regex: "^(#!.*)$" }, { - "token": "keyword.other.import.dart", - "regex": "#(?:\\b)(?:library|import|source|resource)(?:\\b)" + token: "keyword.other.import.dart", + regex: "#(?:\\b)(?:library|import|source|resource)(?:\\b)" }, { - "token" : ["keyword.other.import.dart", "text"], - "regex" : "(?:\\b)(prefix)(\\s*:)" + token : ["keyword.other.import.dart", "text"], + regex : "(?:\\b)(prefix)(\\s*:)" }, { - "regex": "\\bas\\b", - "token": "keyword.cast.dart" + regex: "\\bas\\b", + token: "keyword.cast.dart" }, { - "regex": "\\?|:", - "token": "keyword.control.ternary.dart" + regex: "\\?|:", + token: "keyword.control.ternary.dart" }, { - "regex": "(?:\\b)(is\\!?)(?:\\b)", - "token": ["keyword.operator.dart"] + regex: "(?:\\b)(is\\!?)(?:\\b)", + token: ["keyword.operator.dart"] }, { - "regex": "(<<|>>>?|~|\\^|\\||&)", - "token": ["keyword.operator.bitwise.dart"] + regex: "(<<|>>>?|~|\\^|\\||&)", + token: ["keyword.operator.bitwise.dart"] }, { - "regex": "((?:&|\\^|\\||<<|>>>?)=)", - "token": ["keyword.operator.assignment.bitwise.dart"] + regex: "((?:&|\\^|\\||<<|>>>?)=)", + token: ["keyword.operator.assignment.bitwise.dart"] }, { - "regex": "(===?|!==?|<=?|>=?)", - "token": ["keyword.operator.comparison.dart"] + regex: "(===?|!==?|<=?|>=?)", + token: ["keyword.operator.comparison.dart"] }, { - "regex": "((?:[+*/%-]|\\~)=)", - "token": ["keyword.operator.assignment.arithmetic.dart"] + regex: "((?:[+*/%-]|\\~)=)", + token: ["keyword.operator.assignment.arithmetic.dart"] }, { - "regex": "=", - "token": "keyword.operator.assignment.dart" + regex: "=", + token: "keyword.operator.assignment.dart" }, { - "token" : "string", - "regex" : "'''", - "next" : "qdoc" + token : "string", + regex : "'''", + next : "qdoc" }, { - "token" : "string", - "regex" : '"""', - "next" : "qqdoc" + token : "string", + regex : '"""', + next : "qqdoc" }, { - "token" : "string", - "regex" : "'", - "next" : "qstring" + token : "string", + regex : "'", + next : "qstring" }, { - "token" : "string", - "regex" : '"', - "next" : "qqstring" + token : "string", + regex : '"', + next : "qqstring" }, { - "regex": "(\\-\\-|\\+\\+)", - "token": ["keyword.operator.increment-decrement.dart"] + regex: "(\\-\\-|\\+\\+)", + token: ["keyword.operator.increment-decrement.dart"] }, { - "regex": "(\\-|\\+|\\*|\\/|\\~\\/|%)", - "token": ["keyword.operator.arithmetic.dart"] + regex: "(\\-|\\+|\\*|\\/|\\~\\/|%)", + token: ["keyword.operator.arithmetic.dart"] }, { - "regex": "(!|&&|\\|\\|)", - "token": ["keyword.operator.logical.dart"] + regex: "(!|&&|\\|\\|)", + token: ["keyword.operator.logical.dart"] }, { - "token" : "constant.numeric", // hex - "regex" : "0[xX][0-9a-fA-F]+\\b" + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+\\b" }, { - "token" : "constant.numeric", // float - "regex" : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" }, { - "token" : keywordMapper, - "regex" : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" } ], "comment" : [ @@ -147,30 +147,30 @@ var DartHighlightRules = function() { ], "qdoc" : [ { - "token" : "string", - "regex" : ".*?'''", - "next" : "start" + token : "string", + regex : ".*?'''", + next : "start" }, stringfill], "qqdoc" : [ { - "token" : "string", - "regex" : '.*?"""', - "next" : "start" + token : "string", + regex : '.*?"""', + next : "start" }, stringfill], "qstring" : [ { - "token" : "string", - "regex" : "[^\\\\']*(?:\\\\.[^\\\\']*)*'", - "next" : "start" + token : "string", + regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'", + next : "start" }, stringfill], "qqstring" : [ { - "token" : "string", - "regex" : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', - "next" : "start" + token : "string", + regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', + next : "start" }, stringfill] } diff --git a/lib/ace/mode/diff_highlight_rules.js b/lib/ace/mode/diff_highlight_rules.js index 87d021e4..b91fb867 100644 --- a/lib/ace/mode/diff_highlight_rules.js +++ b/lib/ace/mode/diff_highlight_rules.js @@ -40,20 +40,20 @@ var DiffHighlightRules = function() { this.$rules = { "start" : [{ - "regex": "^(?:\\*{15}|={67}|-{3}|\\+{3})$", - "token": "punctuation.definition.separator.diff", + regex: "^(?:\\*{15}|={67}|-{3}|\\+{3})$", + token: "punctuation.definition.separator.diff", "name": "keyword" }, { //diff.range.unified - "regex": "^(@@)(\\s*.+?\\s*)(@@)(.*)$", - "token": [ + regex: "^(@@)(\\s*.+?\\s*)(@@)(.*)$", + token: [ "constant", "constant.numeric", "constant", "comment.doc.tag" ] }, { //diff.range.normal - "regex": "^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$", - "token": [ + regex: "^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$", + token: [ "constant.numeric", "punctuation.definition.range.diff", "constant.function", @@ -63,36 +63,36 @@ var DiffHighlightRules = function() { ], "name": "meta." }, { - "regex": "^(\\-{3}|\\+{3}|\\*{3})( .+)$", - "token": [ + regex: "^(\\-{3}|\\+{3}|\\*{3})( .+)$", + token: [ "constant.numeric", "meta.tag" ] }, { // added - "regex": "^([!+>])(.*?)(\\s*)$", - "token": [ + regex: "^([!+>])(.*?)(\\s*)$", + token: [ "support.constant", "text", "invalid" ] }, { // removed - "regex": "^([<\\-])(.*?)(\\s*)$", - "token": [ + regex: "^([<\\-])(.*?)(\\s*)$", + token: [ "support.function", "string", "invalid" ] }, { - "regex": "^(diff)(\\s+--\\w+)?(.+?)( .+)?$", - "token": ["variable", "variable", "keyword", "variable"] + regex: "^(diff)(\\s+--\\w+)?(.+?)( .+)?$", + token: ["variable", "variable", "keyword", "variable"] }, { - "regex": "^Index.+$", - "token": "variable" + regex: "^Index.+$", + token: "variable" }, { - "regex": "\\s*$", - "token": "invalid" - }, { - "defaultToken": "invisible" + regex: "\\s*$", + token: "invalid" + }, { + defaultToken: "invisible" } ] }; diff --git a/lib/ace/mode/haml_highlight_rules.js b/lib/ace/mode/haml_highlight_rules.js index 9c2a8e12..6219bc70 100644 --- a/lib/ace/mode/haml_highlight_rules.js +++ b/lib/ace/mode/haml_highlight_rules.js @@ -15,69 +15,69 @@ var HamlHighlightRules = function() { { "start": [ { - "token" : "punctuation.section.comment", - "regex" : /^\s*\/.*/ + token : "punctuation.section.comment", + regex : /^\s*\/.*/ }, { - "token" : "punctuation.section.comment", - "regex" : /^\s*#.*/ + token : "punctuation.section.comment", + regex : /^\s*#.*/ }, { - "token": "string.quoted.double", - "regex": "==.+?==" + token: "string.quoted.double", + regex: "==.+?==" }, { - "token": "keyword.other.doctype", - "regex": "^!!!\\s*(?:[a-zA-Z0-9-_]+)?" + token: "keyword.other.doctype", + regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?" }, RubyExports.qString, RubyExports.qqString, RubyExports.tString, { - "token": ["entity.name.tag.haml"], - "regex": /^\s*%[\w:]+/, - "next": "tag_single" + token: ["entity.name.tag.haml"], + regex: /^\s*%[\w:]+/, + next: "tag_single" }, { - "token": [ "meta.escape.haml" ], - "regex": "^\\s*\\\\." + token: [ "meta.escape.haml" ], + regex: "^\\s*\\\\." }, RubyExports.constantNumericHex, RubyExports.constantNumericFloat, RubyExports.constantOtherSymbol, { - "token": "text", - "regex": "=|-|~", - "next": "embedded_ruby" + token: "text", + regex: "=|-|~", + next: "embedded_ruby" } ], "tag_single": [ { - "token": "entity.other.attribute-name.class.haml", - "regex": "\\.[\\w-]+" + token: "entity.other.attribute-name.class.haml", + regex: "\\.[\\w-]+" }, { - "token": "entity.other.attribute-name.id.haml", - "regex": "#[\\w-]+" + token: "entity.other.attribute-name.id.haml", + regex: "#[\\w-]+" }, { - "token": "punctuation.section", - "regex": "\\{", - "next": "section" + token: "punctuation.section", + regex: "\\{", + next: "section" }, RubyExports.constantOtherSymbol, { - "token": "text", - "regex": /\s/, - "next": "start" + token: "text", + regex: /\s/, + next: "start" }, { - "token": "empty", - "regex": "$|(?!\\.|#|\\{|\\[|=|-|~|\\/)", - "next": "start" + token: "empty", + regex: "$|(?!\\.|#|\\{|\\[|=|-|~|\\/)", + next: "start" } ], "section": [ @@ -90,9 +90,9 @@ var HamlHighlightRules = function() { RubyExports.constantNumericHex, RubyExports.constantNumericFloat, { - "token": "punctuation.section", - "regex": "\\}", - "next": "start" + token: "punctuation.section", + regex: "\\}", + next: "start" } ], "embedded_ruby": [ @@ -103,23 +103,23 @@ var HamlHighlightRules = function() { regex : "[A-Z][a-zA-Z_\\d]+" }, { - "token" : new RubyHighlightRules().getKeywords(), - "regex" : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + token : new RubyHighlightRules().getKeywords(), + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { - "token" : ["keyword", "text", "text"], - "regex" : "(?:do|\\{)(?: \\|[^|]+\\|)?$", - "next" : "start" + token : ["keyword", "text", "text"], + regex : "(?:do|\\{)(?: \\|[^|]+\\|)?$", + next : "start" }, { - "token" : ["text"], - "regex" : "^$", - "next" : "start" + token : ["text"], + regex : "^$", + next : "start" }, { - "token" : ["text"], - "regex" : "^(?!.*\\|\\s*$)", - "next" : "start" + token : ["text"], + regex : "^(?!.*\\|\\s*$)", + next : "start" } ] } diff --git a/lib/ace/mode/jade_highlight_rules.js b/lib/ace/mode/jade_highlight_rules.js index a7108964..ea7e7dbd 100644 --- a/lib/ace/mode/jade_highlight_rules.js +++ b/lib/ace/mode/jade_highlight_rules.js @@ -73,23 +73,23 @@ var JadeHighlightRules = function() { { "start": [ { - "token": "keyword.control.import.include.jade", - "regex": "\\s*\\binclude\\b" + token: "keyword.control.import.include.jade", + regex: "\\s*\\binclude\\b" }, { - "token": "keyword.other.doctype.jade", - "regex": "^!!!\\s*(?:[a-zA-Z0-9-_]+)?" + token: "keyword.other.doctype.jade", + regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?" }, { - "token" : "punctuation.section.comment", - "regex" : "^\\s*\/\/(?:\\s*[^-\\s]|\\s+\\S)(?:.*$)" + token : "punctuation.section.comment", + regex : "^\\s*\/\/(?:\\s*[^-\\s]|\\s+\\S)(?:.*$)" }, { - "token" : function(space, text) { + token : function(space, text) { return "punctuation.section.comment"; }, - "regex" : "^((\\s*)\/\/)(?:\\s*$)", - "next": "comment_block" + regex : "^((\\s*)\/\/)(?:\\s*$)", + next: "comment_block" }, mixin_embed("markdown", "markdown-"), mixin_embed("sass", "sass-"), @@ -97,100 +97,100 @@ var JadeHighlightRules = function() { mixin_embed("coffee", "coffee-"), /* { - "token": { + token: { "2": { "name": "entity.name.function.jade" } }, - "regex": "^(\\s*)(\\:cdata)", - "next": "state_9" + regex: "^(\\s*)(\\:cdata)", + next: "state_9" },*/ // match stuff like: mixin dialog-title-desc(title, desc) { - "token": [ "storage.type.function.jade", + token: [ "storage.type.function.jade", "entity.name.function.jade", "punctuation.definition.parameters.begin.jade", "variable.parameter.function.jade", "punctuation.definition.parameters.end.jade" ], - "regex": "^(\\s*mixin)( [\\w\\-]+)(\\s*\\()(.*?)(\\))" + regex: "^(\\s*mixin)( [\\w\\-]+)(\\s*\\()(.*?)(\\))" }, // match stuff like: mixin dialog-title-desc { - "token": [ "storage.type.function.jade", "entity.name.function.jade"], - "regex": "^(\\s*mixin)( [\\w\\-]+)" + token: [ "storage.type.function.jade", "entity.name.function.jade"], + regex: "^(\\s*mixin)( [\\w\\-]+)" }, { - "token": "source.js.embedded.jade", - "regex": "^\\s*(?:-|=|!=)", - "next": "js-start" + token: "source.js.embedded.jade", + regex: "^\\s*(?:-|=|!=)", + next: "js-start" }, /*{ - "token": "entity.name.tag.script.jade", - "regex": "^\\s*script", - "next": "js_code_tag" + token: "entity.name.tag.script.jade", + regex: "^\\s*script", + next: "js_code_tag" },*/ { - "token": "string.interpolated.jade", - "regex": "[#!]\\{[^\\}]+\\}" + token: "string.interpolated.jade", + regex: "[#!]\\{[^\\}]+\\}" }, // Match any tag, id or class. skip AST filters { - "token": "meta.tag.any.jade", - "regex": /^\s*(?!\w+\:)(?:[\w]+|(?=\.|#)])/, - "next": "tag_single" + token: "meta.tag.any.jade", + regex: /^\s*(?!\w+\:)(?:[\w]+|(?=\.|#)])/, + next: "tag_single" }, { - "token": "suport.type.attribute.id.jade", - "regex": "#\\w+" + token: "suport.type.attribute.id.jade", + regex: "#\\w+" }, { - "token": "suport.type.attribute.class.jade", - "regex": "\\.\\w+" + token: "suport.type.attribute.class.jade", + regex: "\\.\\w+" }, { - "token": "punctuation", - "regex": "\\s*(?:\\()", - "next": "tag_attributes" + token: "punctuation", + regex: "\\s*(?:\\()", + next: "tag_attributes" } ], "comment_block": [ { - "token": function(text) { + token: function(text) { return "text"; }, - "regex": "^(\\1\\S|$)", + regex: "^(\\1\\S|$)", "captures": "1", - "next": "start" + next: "start" }, { - "token": "comment.block.jade", - "regex" : ".+" + token: "comment.block.jade", + regex : ".+" } ], /* "state_9": [ { - "token": "TODO", - "regex": "^(?!\\1\\s+)", - "next": "start" + token: "TODO", + regex: "^(?!\\1\\s+)", + next: "start" }, { - "token": "TODO", - "regex": ".+", - "next": "state_9" + token: "TODO", + regex: ".+", + next: "state_9" } ],*/ /*"js_code": [ { - "token": "keyword.control.js", - "regex": "\\beach\\b" + token: "keyword.control.js", + regex: "\\beach\\b" }, { - "token": "text", - "regex": "$", - "next": "start" + token: "text", + regex: "$", + next: "start" } ],*/ /*"js_code_tag": [ @@ -198,62 +198,62 @@ var JadeHighlightRules = function() { "include": "source.js" }, { - "token": "TODO", - "regex": "^((?=(\\1)([\\w#\\.]|$\\n?))|^$\\n?)", - "next": "start" + token: "TODO", + regex: "^((?=(\\1)([\\w#\\.]|$\\n?))|^$\\n?)", + next: "start" } ],*/ "tag_single": [ { - "token": "entity.other.attribute-name.class.jade", - "regex": "\\.[\\w-]+" + token: "entity.other.attribute-name.class.jade", + regex: "\\.[\\w-]+" }, { - "token": "entity.other.attribute-name.id.jade", - "regex": "#[\\w-]+" + token: "entity.other.attribute-name.id.jade", + regex: "#[\\w-]+" }, { - "token": ["text", "punctuation"], - "regex": "($)|((?!\\.|#|=|-))", - "next": "start" + token: ["text", "punctuation"], + regex: "($)|((?!\\.|#|=|-))", + next: "start" } ], "tag_attributes": [ { - "token" : "string", - "regex" : "'(?=.)", - "next" : "qstring" + token : "string", + regex : "'(?=.)", + next : "qstring" }, { - "token" : "string", - "regex" : '"(?=.)', - "next" : "qqstring" + token : "string", + regex : '"(?=.)', + next : "qqstring" }, { - "token": "entity.other.attribute-name.jade", - "regex": "\\b[a-zA-Z\\-:]+" + token: "entity.other.attribute-name.jade", + regex: "\\b[a-zA-Z\\-:]+" }, { - "token": ["entity.other.attribute-name.jade", "punctuation"], - "regex": "\\b([a-zA-Z:\\.-]+)(=)", - "next": "attribute_strings" + token: ["entity.other.attribute-name.jade", "punctuation"], + regex: "\\b([a-zA-Z:\\.-]+)(=)", + next: "attribute_strings" }, { - "token": "punctuation", - "regex": "\\)", - "next": "start" + token: "punctuation", + regex: "\\)", + next: "start" } ], "attribute_strings": [ { - "token" : "string", - "regex" : "'(?=.)", - "next" : "qstring" + token : "string", + regex : "'(?=.)", + next : "qstring" }, { - "token" : "string", - "regex" : '"(?=.)', - "next" : "qqstring" + token : "string", + regex : '"(?=.)', + next : "qqstring" } ], "qqstring" : [ diff --git a/lib/ace/mode/lisp_highlight_rules.js b/lib/ace/mode/lisp_highlight_rules.js index b33f9e07..06f7344e 100644 --- a/lib/ace/mode/lisp_highlight_rules.js +++ b/lib/ace/mode/lisp_highlight_rules.js @@ -67,54 +67,51 @@ var LispHighlightRules = function() { regex : ";.*$" }, { - "token": ["storage.type.function-type.lisp", "text", "entity.name.function.lisp"], - "regex": "(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)" + token: ["storage.type.function-type.lisp", "text", "entity.name.function.lisp"], + regex: "(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)" }, { - "token": ["punctuation.definition.constant.character.lisp", "constant.character.lisp"], - "regex": "(#)((?:\\w|[\\\\+-=<>'\"&#])+)" + token: ["punctuation.definition.constant.character.lisp", "constant.character.lisp"], + regex: "(#)((?:\\w|[\\\\+-=<>'\"&#])+)" }, { - "token": ["punctuation.definition.variable.lisp", "variable.other.global.lisp", "punctuation.definition.variable.lisp"], - "regex": "(\\*)(\\S*)(\\*)" + token: ["punctuation.definition.variable.lisp", "variable.other.global.lisp", "punctuation.definition.variable.lisp"], + regex: "(\\*)(\\S*)(\\*)" }, { - "token" : "constant.numeric", // hex - "regex" : "0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + token : "constant.numeric", // hex + regex : "0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" }, { - "token" : "constant.numeric", // float - "regex" : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + token : "constant.numeric", // float + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" }, { - "token" : keywordMapper, - "regex" : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + token : keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { - "token" : "string", - "regex" : '"(?=.)', - "next" : "qqstring" + token : "string", + regex : '"(?=.)', + next : "qqstring" } ], "qqstring": [ { - "token": "constant.character.escape.lisp", - "regex": "\\\\." + token: "constant.character.escape.lisp", + regex: "\\\\." }, { - "token" : "string", - "regex" : '[^"\\\\]+', - "merge" : true + token : "string", + regex : '[^"\\\\]+' }, { - "token" : "string", - "regex" : "\\\\$", - "next" : "qqstring", - "merge" : true + token : "string", + regex : "\\\\$", + next : "qqstring" }, { - "token" : "string", - "regex" : '"|$', - "next" : "start", - "merge" : true + token : "string", + regex : '"|$', + next : "start" } ] } diff --git a/lib/ace/mode/makefile_highlight_rules.js b/lib/ace/mode/makefile_highlight_rules.js index 38267547..53ef1d05 100644 --- a/lib/ace/mode/makefile_highlight_rules.js +++ b/lib/ace/mode/makefile_highlight_rules.js @@ -21,48 +21,48 @@ var MakefileHighlightRules = function() { { "start": [ { - "token": "string.interpolated.backtick.makefile", - "regex": "`", - "next": "shell-start" + token: "string.interpolated.backtick.makefile", + regex: "`", + next: "shell-start" }, { - "token": "punctuation.definition.comment.makefile", - "regex": /#(?=.)/, - "next": "comment" + token: "punctuation.definition.comment.makefile", + regex: /#(?=.)/, + next: "comment" }, { - "token": [ "keyword.control.makefile"], - "regex": "^(?:\\s*\\b)(\\-??include|ifeq|ifneq|ifdef|ifndef|else|endif|vpath|export|unexport|define|endef|override)(?:\\b)" + token: [ "keyword.control.makefile"], + regex: "^(?:\\s*\\b)(\\-??include|ifeq|ifneq|ifdef|ifndef|else|endif|vpath|export|unexport|define|endef|override)(?:\\b)" }, {// ^([^\t ]+(\s[^\t ]+)*:(?!\=))\s*.* - "token": ["entity.name.function.makefile", "text"], - "regex": "^([^\\t ]+(?:\\s[^\\t ]+)*:)(\\s*.*)" + token: ["entity.name.function.makefile", "text"], + regex: "^([^\\t ]+(?:\\s[^\\t ]+)*:)(\\s*.*)" } ], "comment": [ { - "token" : "punctuation.definition.comment.makefile", - "regex" : /.+\\/ + token : "punctuation.definition.comment.makefile", + regex : /.+\\/ }, { - "token" : "punctuation.definition.comment.makefile", - "regex" : ".+", - "next" : "start" + token : "punctuation.definition.comment.makefile", + regex : ".+", + next : "start" } ], "shell-start": [ { - "token": keywordMapper, - "regex" : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + token: keywordMapper, + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { - "token": "string", - "regex" : "\\w+" + token: "string", + regex : "\\w+" }, { - "token" : "string.interpolated.backtick.makefile", - "regex" : "`", - "next" : "start" + token : "string.interpolated.backtick.makefile", + regex : "`", + next : "start" } ] } diff --git a/lib/ace/mode/objectivec_highlight_rules.js b/lib/ace/mode/objectivec_highlight_rules.js index e05c5448..0161098b 100644 --- a/lib/ace/mode/objectivec_highlight_rules.js +++ b/lib/ace/mode/objectivec_highlight_rules.js @@ -18,11 +18,11 @@ var ObjectiveCHighlightRules = function() { "x[a-zA-Z0-9]+)"; var specialVariables = [{ - "regex": "\\b_cmd\\b", - "token": "variable.other.selector.objc" + regex: "\\b_cmd\\b", + token: "variable.other.selector.objc" }, { - "regex": "\\b(?:self|super)\\b", - "token": "variable.language.objc" + regex: "\\b(?:self|super)\\b", + token: "variable.language.objc" } ]; @@ -42,250 +42,250 @@ var ObjectiveCHighlightRules = function() { next : "comment" }, { - "token": [ "storage.type.objc", "punctuation.definition.storage.type.objc", + token: [ "storage.type.objc", "punctuation.definition.storage.type.objc", "entity.name.type.objc", "text", "entity.other.inherited-class.objc" ], - "regex": "(@)(interface|protocol)(?!.+;)(\\s+[A-Za-z_][A-Za-z0-9_]*)(\\s*:\\s*)([A-Za-z]+)" + regex: "(@)(interface|protocol)(?!.+;)(\\s+[A-Za-z_][A-Za-z0-9_]*)(\\s*:\\s*)([A-Za-z]+)" }, { - "token": [ "storage.type.objc" ], - "regex": "(@end)" + token: [ "storage.type.objc" ], + regex: "(@end)" }, { - "token": [ "storage.type.objc", "entity.name.type.objc", + token: [ "storage.type.objc", "entity.name.type.objc", "entity.other.inherited-class.objc" ], - "regex": "(@implementation)(\\s+[A-Za-z_][A-Za-z0-9_]*)(\\s*?::\\s*(?:[A-Za-z][A-Za-z0-9]*))?" + regex: "(@implementation)(\\s+[A-Za-z_][A-Za-z0-9_]*)(\\s*?::\\s*(?:[A-Za-z][A-Za-z0-9]*))?" }, { - "token": "string.begin.objc", - "regex": '@"', - "next": "constant_NSString" + token: "string.begin.objc", + regex: '@"', + next: "constant_NSString" }, { - "token": "storage.type.objc", - "regex": "\\bid\\s*<", - "next": "protocol_list" + token: "storage.type.objc", + regex: "\\bid\\s*<", + next: "protocol_list" }, { - "token": "keyword.control.macro.objc", - "regex": "\\bNS_DURING|NS_HANDLER|NS_ENDHANDLER\\b" + token: "keyword.control.macro.objc", + regex: "\\bNS_DURING|NS_HANDLER|NS_ENDHANDLER\\b" }, { - "token": ["punctuation.definition.keyword.objc", "keyword.control.exception.objc"], - "regex": "(@)(try|catch|finally|throw)\\b" + token: ["punctuation.definition.keyword.objc", "keyword.control.exception.objc"], + regex: "(@)(try|catch|finally|throw)\\b" }, { - "token": ["punctuation.definition.keyword.objc", "keyword.other.objc"], - "regex": "(@)(defs|encode)\\b" + token: ["punctuation.definition.keyword.objc", "keyword.other.objc"], + regex: "(@)(defs|encode)\\b" }, { - "token": ["storage.type.id.objc", "text"], - "regex": "(\\bid\\b)(\\s|\\n)?" + token: ["storage.type.id.objc", "text"], + regex: "(\\bid\\b)(\\s|\\n)?" }, { - "token": "storage.type.objc", - "regex": "\\bIBOutlet|IBAction|BOOL|SEL|id|unichar|IMP|Class\\b" + token: "storage.type.objc", + regex: "\\bIBOutlet|IBAction|BOOL|SEL|id|unichar|IMP|Class\\b" }, { - "token": [ "punctuation.definition.storage.type.objc", "storage.type.objc"], - "regex": "(@)(class|protocol)\\b" + token: [ "punctuation.definition.storage.type.objc", "storage.type.objc"], + regex: "(@)(class|protocol)\\b" }, { - "token": [ "punctuation.definition.storage.type.objc", "punctuation"], - "regex": "(@selector)(\\s*\\()", - "next": "selectors" + token: [ "punctuation.definition.storage.type.objc", "punctuation"], + regex: "(@selector)(\\s*\\()", + next: "selectors" }, { - "token": [ "punctuation.definition.storage.modifier.objc", "storage.modifier.objc"], - "regex": "(@)(synchronized|public|private|protected|package)\\b" + token: [ "punctuation.definition.storage.modifier.objc", "storage.modifier.objc"], + regex: "(@)(synchronized|public|private|protected|package)\\b" }, { - "token": "constant.language.objc", - "regex": "\\bYES|NO|Nil|nil\\b" + token: "constant.language.objc", + regex: "\\bYES|NO|Nil|nil\\b" }, { - "token": "support.variable.foundation", - "regex": "\\bNSApp\\b" + token: "support.variable.foundation", + regex: "\\bNSApp\\b" }, { - "token": [ "support.function.cocoa.leopard"], - "regex": "(?:\\b)(NS(?:Rect(?:ToCGRect|FromCGRect)|MakeCollectable|S(?:tringFromProtocol|ize(?:ToCGSize|FromCGSize))|Draw(?:NinePartImage|ThreePartImage)|P(?:oint(?:ToCGPoint|FromCGPoint)|rotocolFromString)|EventMaskFromType|Value))(?:\\b)" + token: [ "support.function.cocoa.leopard"], + regex: "(?:\\b)(NS(?:Rect(?:ToCGRect|FromCGRect)|MakeCollectable|S(?:tringFromProtocol|ize(?:ToCGSize|FromCGSize))|Draw(?:NinePartImage|ThreePartImage)|P(?:oint(?:ToCGPoint|FromCGPoint)|rotocolFromString)|EventMaskFromType|Value))(?:\\b)" }, { - "token": ["support.function.cocoa"], - "regex": "(?:\\b)(NS(?:R(?:ound(?:DownToMultipleOfPageSize|UpToMultipleOfPageSize)|un(?:CriticalAlertPanel(?:RelativeToWindow)?|InformationalAlertPanel(?:RelativeToWindow)?|AlertPanel(?:RelativeToWindow)?)|e(?:set(?:MapTable|HashTable)|c(?:ycleZone|t(?:Clip(?:List)?|F(?:ill(?:UsingOperation|List(?:UsingOperation|With(?:Grays|Colors(?:UsingOperation)?))?)?|romString))|ordAllocationEvent)|turnAddress|leaseAlertPanel|a(?:dPixel|l(?:MemoryAvailable|locateCollectable))|gisterServicesProvider)|angeFromString)|Get(?:SizeAndAlignment|CriticalAlertPanel|InformationalAlertPanel|UncaughtExceptionHandler|FileType(?:s)?|WindowServerMemory|AlertPanel)|M(?:i(?:n(?:X|Y)|d(?:X|Y))|ouseInRect|a(?:p(?:Remove|Get|Member|Insert(?:IfAbsent|KnownAbsent)?)|ke(?:R(?:ect|ange)|Size|Point)|x(?:Range|X|Y)))|B(?:itsPer(?:SampleFromDepth|PixelFromDepth)|e(?:stDepth|ep|gin(?:CriticalAlertSheet|InformationalAlertSheet|AlertSheet)))|S(?:ho(?:uldRetainWithZone|w(?:sServicesMenuItem|AnimationEffect))|tringFrom(?:R(?:ect|ange)|MapTable|S(?:ize|elector)|HashTable|Class|Point)|izeFromString|e(?:t(?:ShowsServicesMenuItem|ZoneName|UncaughtExceptionHandler|FocusRingStyle)|lectorFromString|archPathForDirectoriesInDomains)|wap(?:Big(?:ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(?:ToHost|LongToHost))|Short|Host(?:ShortTo(?:Big|Little)|IntTo(?:Big|Little)|DoubleTo(?:Big|Little)|FloatTo(?:Big|Little)|Long(?:To(?:Big|Little)|LongTo(?:Big|Little)))|Int|Double|Float|L(?:ittle(?:ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(?:ToHost|LongToHost))|ong(?:Long)?)))|H(?:ighlightRect|o(?:stByteOrder|meDirectory(?:ForUser)?)|eight|ash(?:Remove|Get|Insert(?:IfAbsent|KnownAbsent)?)|FSType(?:CodeFromFileType|OfFile))|N(?:umberOfColorComponents|ext(?:MapEnumeratorPair|HashEnumeratorItem))|C(?:o(?:n(?:tainsRect|vert(?:GlyphsToPackedGlyphs|Swapped(?:DoubleToHost|FloatToHost)|Host(?:DoubleToSwapped|FloatToSwapped)))|unt(?:MapTable|HashTable|Frames|Windows(?:ForContext)?)|py(?:M(?:emoryPages|apTableWithZone)|Bits|HashTableWithZone|Object)|lorSpaceFromDepth|mpare(?:MapTables|HashTables))|lassFromString|reate(?:MapTable(?:WithZone)?|HashTable(?:WithZone)?|Zone|File(?:namePboardType|ContentsPboardType)))|TemporaryDirectory|I(?:s(?:ControllerMarker|EmptyRect|FreedObject)|n(?:setRect|crementExtraRefCount|te(?:r(?:sect(?:sRect|ionR(?:ect|ange))|faceStyleForKey)|gralRect)))|Zone(?:Realloc|Malloc|Name|Calloc|Fr(?:omPointer|ee))|O(?:penStepRootDirectory|ffsetRect)|D(?:i(?:sableScreenUpdates|videRect)|ottedFrameRect|e(?:c(?:imal(?:Round|Multiply|S(?:tring|ubtract)|Normalize|Co(?:py|mpa(?:ct|re))|IsNotANumber|Divide|Power|Add)|rementExtraRefCountWasZero)|faultMallocZone|allocate(?:MemoryPages|Object))|raw(?:Gr(?:oove|ayBezel)|B(?:itmap|utton)|ColorTiledRects|TiledRects|DarkBezel|W(?:hiteBezel|indowBackground)|LightBezel))|U(?:serName|n(?:ionR(?:ect|ange)|registerServicesProvider)|pdateDynamicServices)|Java(?:Bundle(?:Setup|Cleanup)|Setup(?:VirtualMachine)?|Needs(?:ToLoadClasses|VirtualMachine)|ClassesF(?:orBundle|romPath)|ObjectNamedInPath|ProvidesClasses)|P(?:oint(?:InRect|FromString)|erformService|lanarFromDepth|ageSize)|E(?:n(?:d(?:MapTableEnumeration|HashTableEnumeration)|umerate(?:MapTable|HashTable)|ableScreenUpdates)|qual(?:R(?:ects|anges)|Sizes|Points)|raseRect|xtraRefCount)|F(?:ileTypeForHFSTypeCode|ullUserName|r(?:ee(?:MapTable|HashTable)|ame(?:Rect(?:WithWidth(?:UsingOperation)?)?|Address)))|Wi(?:ndowList(?:ForContext)?|dth)|Lo(?:cationInRange|g(?:v|PageSize)?)|A(?:ccessibility(?:R(?:oleDescription(?:ForUIElement)?|aiseBadArgumentException)|Unignored(?:Children(?:ForOnlyChild)?|Descendant|Ancestor)|PostNotification|ActionDescription)|pplication(?:Main|Load)|vailableWindowDepths|ll(?:MapTable(?:Values|Keys)|HashTableObjects|ocate(?:MemoryPages|Collectable|Object)))))(?:\\b)" + token: ["support.function.cocoa"], + regex: "(?:\\b)(NS(?:R(?:ound(?:DownToMultipleOfPageSize|UpToMultipleOfPageSize)|un(?:CriticalAlertPanel(?:RelativeToWindow)?|InformationalAlertPanel(?:RelativeToWindow)?|AlertPanel(?:RelativeToWindow)?)|e(?:set(?:MapTable|HashTable)|c(?:ycleZone|t(?:Clip(?:List)?|F(?:ill(?:UsingOperation|List(?:UsingOperation|With(?:Grays|Colors(?:UsingOperation)?))?)?|romString))|ordAllocationEvent)|turnAddress|leaseAlertPanel|a(?:dPixel|l(?:MemoryAvailable|locateCollectable))|gisterServicesProvider)|angeFromString)|Get(?:SizeAndAlignment|CriticalAlertPanel|InformationalAlertPanel|UncaughtExceptionHandler|FileType(?:s)?|WindowServerMemory|AlertPanel)|M(?:i(?:n(?:X|Y)|d(?:X|Y))|ouseInRect|a(?:p(?:Remove|Get|Member|Insert(?:IfAbsent|KnownAbsent)?)|ke(?:R(?:ect|ange)|Size|Point)|x(?:Range|X|Y)))|B(?:itsPer(?:SampleFromDepth|PixelFromDepth)|e(?:stDepth|ep|gin(?:CriticalAlertSheet|InformationalAlertSheet|AlertSheet)))|S(?:ho(?:uldRetainWithZone|w(?:sServicesMenuItem|AnimationEffect))|tringFrom(?:R(?:ect|ange)|MapTable|S(?:ize|elector)|HashTable|Class|Point)|izeFromString|e(?:t(?:ShowsServicesMenuItem|ZoneName|UncaughtExceptionHandler|FocusRingStyle)|lectorFromString|archPathForDirectoriesInDomains)|wap(?:Big(?:ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(?:ToHost|LongToHost))|Short|Host(?:ShortTo(?:Big|Little)|IntTo(?:Big|Little)|DoubleTo(?:Big|Little)|FloatTo(?:Big|Little)|Long(?:To(?:Big|Little)|LongTo(?:Big|Little)))|Int|Double|Float|L(?:ittle(?:ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(?:ToHost|LongToHost))|ong(?:Long)?)))|H(?:ighlightRect|o(?:stByteOrder|meDirectory(?:ForUser)?)|eight|ash(?:Remove|Get|Insert(?:IfAbsent|KnownAbsent)?)|FSType(?:CodeFromFileType|OfFile))|N(?:umberOfColorComponents|ext(?:MapEnumeratorPair|HashEnumeratorItem))|C(?:o(?:n(?:tainsRect|vert(?:GlyphsToPackedGlyphs|Swapped(?:DoubleToHost|FloatToHost)|Host(?:DoubleToSwapped|FloatToSwapped)))|unt(?:MapTable|HashTable|Frames|Windows(?:ForContext)?)|py(?:M(?:emoryPages|apTableWithZone)|Bits|HashTableWithZone|Object)|lorSpaceFromDepth|mpare(?:MapTables|HashTables))|lassFromString|reate(?:MapTable(?:WithZone)?|HashTable(?:WithZone)?|Zone|File(?:namePboardType|ContentsPboardType)))|TemporaryDirectory|I(?:s(?:ControllerMarker|EmptyRect|FreedObject)|n(?:setRect|crementExtraRefCount|te(?:r(?:sect(?:sRect|ionR(?:ect|ange))|faceStyleForKey)|gralRect)))|Zone(?:Realloc|Malloc|Name|Calloc|Fr(?:omPointer|ee))|O(?:penStepRootDirectory|ffsetRect)|D(?:i(?:sableScreenUpdates|videRect)|ottedFrameRect|e(?:c(?:imal(?:Round|Multiply|S(?:tring|ubtract)|Normalize|Co(?:py|mpa(?:ct|re))|IsNotANumber|Divide|Power|Add)|rementExtraRefCountWasZero)|faultMallocZone|allocate(?:MemoryPages|Object))|raw(?:Gr(?:oove|ayBezel)|B(?:itmap|utton)|ColorTiledRects|TiledRects|DarkBezel|W(?:hiteBezel|indowBackground)|LightBezel))|U(?:serName|n(?:ionR(?:ect|ange)|registerServicesProvider)|pdateDynamicServices)|Java(?:Bundle(?:Setup|Cleanup)|Setup(?:VirtualMachine)?|Needs(?:ToLoadClasses|VirtualMachine)|ClassesF(?:orBundle|romPath)|ObjectNamedInPath|ProvidesClasses)|P(?:oint(?:InRect|FromString)|erformService|lanarFromDepth|ageSize)|E(?:n(?:d(?:MapTableEnumeration|HashTableEnumeration)|umerate(?:MapTable|HashTable)|ableScreenUpdates)|qual(?:R(?:ects|anges)|Sizes|Points)|raseRect|xtraRefCount)|F(?:ileTypeForHFSTypeCode|ullUserName|r(?:ee(?:MapTable|HashTable)|ame(?:Rect(?:WithWidth(?:UsingOperation)?)?|Address)))|Wi(?:ndowList(?:ForContext)?|dth)|Lo(?:cationInRange|g(?:v|PageSize)?)|A(?:ccessibility(?:R(?:oleDescription(?:ForUIElement)?|aiseBadArgumentException)|Unignored(?:Children(?:ForOnlyChild)?|Descendant|Ancestor)|PostNotification|ActionDescription)|pplication(?:Main|Load)|vailableWindowDepths|ll(?:MapTable(?:Values|Keys)|HashTableObjects|ocate(?:MemoryPages|Collectable|Object)))))(?:\\b)" }, { - "token": ["support.class.cocoa.leopard"], - "regex": "(?:\\b)(NS(?:RuleEditor|G(?:arbageCollector|radient)|MapTable|HashTable|Co(?:ndition|llectionView(?:Item)?)|T(?:oolbarItemGroup|extInputClient|r(?:eeNode|ackingArea))|InvocationOperation|Operation(?:Queue)?|D(?:ictionaryController|ockTile)|P(?:ointer(?:Functions|Array)|athC(?:o(?:ntrol(?:Delegate)?|mponentCell)|ell(?:Delegate)?)|r(?:intPanelAccessorizing|edicateEditor(?:RowTemplate)?))|ViewController|FastEnumeration|Animat(?:ionContext|ablePropertyContainer)))(?:\\b)" + token: ["support.class.cocoa.leopard"], + regex: "(?:\\b)(NS(?:RuleEditor|G(?:arbageCollector|radient)|MapTable|HashTable|Co(?:ndition|llectionView(?:Item)?)|T(?:oolbarItemGroup|extInputClient|r(?:eeNode|ackingArea))|InvocationOperation|Operation(?:Queue)?|D(?:ictionaryController|ockTile)|P(?:ointer(?:Functions|Array)|athC(?:o(?:ntrol(?:Delegate)?|mponentCell)|ell(?:Delegate)?)|r(?:intPanelAccessorizing|edicateEditor(?:RowTemplate)?))|ViewController|FastEnumeration|Animat(?:ionContext|ablePropertyContainer)))(?:\\b)" }, { - "token": ["support.class.cocoa"], - "regex": "(?:\\b)(NS(?:R(?:u(?:nLoop|ler(?:Marker|View))|e(?:sponder|cursiveLock|lativeSpecifier)|an(?:domSpecifier|geSpecifier))|G(?:etCommand|lyph(?:Generator|Storage|Info)|raphicsContext)|XML(?:Node|D(?:ocument|TD(?:Node)?)|Parser|Element)|M(?:iddleSpecifier|ov(?:ie(?:View)?|eCommand)|utable(?:S(?:tring|et)|C(?:haracterSet|opying)|IndexSet|D(?:ictionary|ata)|URLRequest|ParagraphStyle|A(?:ttributedString|rray))|e(?:ssagePort(?:NameServer)?|nu(?:Item(?:Cell)?|View)?|t(?:hodSignature|adata(?:Item|Query(?:ResultGroup|AttributeValueTuple)?)))|a(?:ch(?:BootstrapServer|Port)|trix))|B(?:itmapImageRep|ox|u(?:ndle|tton(?:Cell)?)|ezierPath|rowser(?:Cell)?)|S(?:hadow|c(?:anner|r(?:ipt(?:SuiteRegistry|C(?:o(?:ercionHandler|mmand(?:Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(?:er|View)|een))|t(?:epper(?:Cell)?|atus(?:Bar|Item)|r(?:ing|eam))|imple(?:HorizontalTypesetter|CString)|o(?:cketPort(?:NameServer)?|und|rtDescriptor)|p(?:e(?:cifierTest|ech(?:Recognizer|Synthesizer)|ll(?:Server|Checker))|litView)|e(?:cureTextField(?:Cell)?|t(?:Command)?|archField(?:Cell)?|rializer|gmentedC(?:ontrol|ell))|lider(?:Cell)?|avePanel)|H(?:ost|TTP(?:Cookie(?:Storage)?|URLResponse)|elpManager)|N(?:ib(?:Con(?:nector|trolConnector)|OutletConnector)?|otification(?:Center|Queue)?|u(?:ll|mber(?:Formatter)?)|etService(?:Browser)?|ameSpecifier)|C(?:ha(?:ngeSpelling|racterSet)|o(?:n(?:stantString|nection|trol(?:ler)?|ditionLock)|d(?:ing|er)|unt(?:Command|edSet)|pying|lor(?:Space|P(?:ick(?:ing(?:Custom|Default)|er)|anel)|Well|List)?|m(?:p(?:oundPredicate|arisonPredicate)|boBox(?:Cell)?))|u(?:stomImageRep|rsor)|IImageRep|ell|l(?:ipView|o(?:seCommand|neCommand)|assDescription)|a(?:ched(?:ImageRep|URLResponse)|lendar(?:Date)?)|reateCommand)|T(?:hread|ypesetter|ime(?:Zone|r)|o(?:olbar(?:Item(?:Validations)?)?|kenField(?:Cell)?)|ext(?:Block|Storage|Container|Tab(?:le(?:Block)?)?|Input|View|Field(?:Cell)?|List|Attachment(?:Cell)?)?|a(?:sk|b(?:le(?:Header(?:Cell|View)|Column|View)|View(?:Item)?))|reeController)|I(?:n(?:dex(?:S(?:pecifier|et)|Path)|put(?:Manager|S(?:tream|erv(?:iceProvider|er(?:MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(?:Rep|Cell|View)?)|O(?:ut(?:putStream|lineView)|pen(?:GL(?:Context|Pixel(?:Buffer|Format)|View)|Panel)|bj(?:CTypeSerializationCallBack|ect(?:Controller)?))|D(?:i(?:st(?:antObject(?:Request)?|ributed(?:NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(?:Controller)?|e(?:serializer|cimalNumber(?:Behaviors|Handler)?|leteCommand)|at(?:e(?:Components|Picker(?:Cell)?|Formatter)?|a)|ra(?:wer|ggingInfo))|U(?:ser(?:InterfaceValidations|Defaults(?:Controller)?)|RL(?:Re(?:sponse|quest)|Handle(?:Client)?|C(?:onnection|ache|redential(?:Storage)?)|Download(?:Delegate)?|Prot(?:ocol(?:Client)?|ectionSpace)|AuthenticationChallenge(?:Sender)?)?|n(?:iqueIDSpecifier|doManager|archiver))|P(?:ipe|o(?:sitionalSpecifier|pUpButton(?:Cell)?|rt(?:Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(?:steboard|nel|ragraphStyle|geLayout)|r(?:int(?:Info|er|Operation|Panel)|o(?:cessInfo|tocolChecker|perty(?:Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(?:numerator|vent|PSImageRep|rror|x(?:ception|istsCommand|pression))|V(?:iew(?:Animation)?|al(?:idated(?:ToobarItem|UserInterfaceItem)|ue(?:Transformer)?))|Keyed(?:Unarchiver|Archiver)|Qui(?:ckDrawView|tCommand)|F(?:ile(?:Manager|Handle|Wrapper)|o(?:nt(?:Manager|Descriptor|Panel)?|rm(?:Cell|atter)))|W(?:hoseSpecifier|indow(?:Controller)?|orkspace)|L(?:o(?:c(?:k(?:ing)?|ale)|gicalTest)|evelIndicator(?:Cell)?|ayoutManager)|A(?:ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(?:ication|e(?:Script|Event(?:Manager|Descriptor)))|ffineTransform|lert|r(?:chiver|ray(?:Controller)?))))(?:\\b)", + token: ["support.class.cocoa"], + regex: "(?:\\b)(NS(?:R(?:u(?:nLoop|ler(?:Marker|View))|e(?:sponder|cursiveLock|lativeSpecifier)|an(?:domSpecifier|geSpecifier))|G(?:etCommand|lyph(?:Generator|Storage|Info)|raphicsContext)|XML(?:Node|D(?:ocument|TD(?:Node)?)|Parser|Element)|M(?:iddleSpecifier|ov(?:ie(?:View)?|eCommand)|utable(?:S(?:tring|et)|C(?:haracterSet|opying)|IndexSet|D(?:ictionary|ata)|URLRequest|ParagraphStyle|A(?:ttributedString|rray))|e(?:ssagePort(?:NameServer)?|nu(?:Item(?:Cell)?|View)?|t(?:hodSignature|adata(?:Item|Query(?:ResultGroup|AttributeValueTuple)?)))|a(?:ch(?:BootstrapServer|Port)|trix))|B(?:itmapImageRep|ox|u(?:ndle|tton(?:Cell)?)|ezierPath|rowser(?:Cell)?)|S(?:hadow|c(?:anner|r(?:ipt(?:SuiteRegistry|C(?:o(?:ercionHandler|mmand(?:Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(?:er|View)|een))|t(?:epper(?:Cell)?|atus(?:Bar|Item)|r(?:ing|eam))|imple(?:HorizontalTypesetter|CString)|o(?:cketPort(?:NameServer)?|und|rtDescriptor)|p(?:e(?:cifierTest|ech(?:Recognizer|Synthesizer)|ll(?:Server|Checker))|litView)|e(?:cureTextField(?:Cell)?|t(?:Command)?|archField(?:Cell)?|rializer|gmentedC(?:ontrol|ell))|lider(?:Cell)?|avePanel)|H(?:ost|TTP(?:Cookie(?:Storage)?|URLResponse)|elpManager)|N(?:ib(?:Con(?:nector|trolConnector)|OutletConnector)?|otification(?:Center|Queue)?|u(?:ll|mber(?:Formatter)?)|etService(?:Browser)?|ameSpecifier)|C(?:ha(?:ngeSpelling|racterSet)|o(?:n(?:stantString|nection|trol(?:ler)?|ditionLock)|d(?:ing|er)|unt(?:Command|edSet)|pying|lor(?:Space|P(?:ick(?:ing(?:Custom|Default)|er)|anel)|Well|List)?|m(?:p(?:oundPredicate|arisonPredicate)|boBox(?:Cell)?))|u(?:stomImageRep|rsor)|IImageRep|ell|l(?:ipView|o(?:seCommand|neCommand)|assDescription)|a(?:ched(?:ImageRep|URLResponse)|lendar(?:Date)?)|reateCommand)|T(?:hread|ypesetter|ime(?:Zone|r)|o(?:olbar(?:Item(?:Validations)?)?|kenField(?:Cell)?)|ext(?:Block|Storage|Container|Tab(?:le(?:Block)?)?|Input|View|Field(?:Cell)?|List|Attachment(?:Cell)?)?|a(?:sk|b(?:le(?:Header(?:Cell|View)|Column|View)|View(?:Item)?))|reeController)|I(?:n(?:dex(?:S(?:pecifier|et)|Path)|put(?:Manager|S(?:tream|erv(?:iceProvider|er(?:MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(?:Rep|Cell|View)?)|O(?:ut(?:putStream|lineView)|pen(?:GL(?:Context|Pixel(?:Buffer|Format)|View)|Panel)|bj(?:CTypeSerializationCallBack|ect(?:Controller)?))|D(?:i(?:st(?:antObject(?:Request)?|ributed(?:NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(?:Controller)?|e(?:serializer|cimalNumber(?:Behaviors|Handler)?|leteCommand)|at(?:e(?:Components|Picker(?:Cell)?|Formatter)?|a)|ra(?:wer|ggingInfo))|U(?:ser(?:InterfaceValidations|Defaults(?:Controller)?)|RL(?:Re(?:sponse|quest)|Handle(?:Client)?|C(?:onnection|ache|redential(?:Storage)?)|Download(?:Delegate)?|Prot(?:ocol(?:Client)?|ectionSpace)|AuthenticationChallenge(?:Sender)?)?|n(?:iqueIDSpecifier|doManager|archiver))|P(?:ipe|o(?:sitionalSpecifier|pUpButton(?:Cell)?|rt(?:Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(?:steboard|nel|ragraphStyle|geLayout)|r(?:int(?:Info|er|Operation|Panel)|o(?:cessInfo|tocolChecker|perty(?:Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(?:numerator|vent|PSImageRep|rror|x(?:ception|istsCommand|pression))|V(?:iew(?:Animation)?|al(?:idated(?:ToobarItem|UserInterfaceItem)|ue(?:Transformer)?))|Keyed(?:Unarchiver|Archiver)|Qui(?:ckDrawView|tCommand)|F(?:ile(?:Manager|Handle|Wrapper)|o(?:nt(?:Manager|Descriptor|Panel)?|rm(?:Cell|atter)))|W(?:hoseSpecifier|indow(?:Controller)?|orkspace)|L(?:o(?:c(?:k(?:ing)?|ale)|gicalTest)|evelIndicator(?:Cell)?|ayoutManager)|A(?:ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(?:ication|e(?:Script|Event(?:Manager|Descriptor)))|ffineTransform|lert|r(?:chiver|ray(?:Controller)?))))(?:\\b)", }, { - "token": ["support.type.cocoa.leopard"], - "regex": "(?:\\b)(NS(?:R(?:u(?:nLoop|ler(?:Marker|View))|e(?:sponder|cursiveLock|lativeSpecifier)|an(?:domSpecifier|geSpecifier))|G(?:etCommand|lyph(?:Generator|Storage|Info)|raphicsContext)|XML(?:Node|D(?:ocument|TD(?:Node)?)|Parser|Element)|M(?:iddleSpecifier|ov(?:ie(?:View)?|eCommand)|utable(?:S(?:tring|et)|C(?:haracterSet|opying)|IndexSet|D(?:ictionary|ata)|URLRequest|ParagraphStyle|A(?:ttributedString|rray))|e(?:ssagePort(?:NameServer)?|nu(?:Item(?:Cell)?|View)?|t(?:hodSignature|adata(?:Item|Query(?:ResultGroup|AttributeValueTuple)?)))|a(?:ch(?:BootstrapServer|Port)|trix))|B(?:itmapImageRep|ox|u(?:ndle|tton(?:Cell)?)|ezierPath|rowser(?:Cell)?)|S(?:hadow|c(?:anner|r(?:ipt(?:SuiteRegistry|C(?:o(?:ercionHandler|mmand(?:Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(?:er|View)|een))|t(?:epper(?:Cell)?|atus(?:Bar|Item)|r(?:ing|eam))|imple(?:HorizontalTypesetter|CString)|o(?:cketPort(?:NameServer)?|und|rtDescriptor)|p(?:e(?:cifierTest|ech(?:Recognizer|Synthesizer)|ll(?:Server|Checker))|litView)|e(?:cureTextField(?:Cell)?|t(?:Command)?|archField(?:Cell)?|rializer|gmentedC(?:ontrol|ell))|lider(?:Cell)?|avePanel)|H(?:ost|TTP(?:Cookie(?:Storage)?|URLResponse)|elpManager)|N(?:ib(?:Con(?:nector|trolConnector)|OutletConnector)?|otification(?:Center|Queue)?|u(?:ll|mber(?:Formatter)?)|etService(?:Browser)?|ameSpecifier)|C(?:ha(?:ngeSpelling|racterSet)|o(?:n(?:stantString|nection|trol(?:ler)?|ditionLock)|d(?:ing|er)|unt(?:Command|edSet)|pying|lor(?:Space|P(?:ick(?:ing(?:Custom|Default)|er)|anel)|Well|List)?|m(?:p(?:oundPredicate|arisonPredicate)|boBox(?:Cell)?))|u(?:stomImageRep|rsor)|IImageRep|ell|l(?:ipView|o(?:seCommand|neCommand)|assDescription)|a(?:ched(?:ImageRep|URLResponse)|lendar(?:Date)?)|reateCommand)|T(?:hread|ypesetter|ime(?:Zone|r)|o(?:olbar(?:Item(?:Validations)?)?|kenField(?:Cell)?)|ext(?:Block|Storage|Container|Tab(?:le(?:Block)?)?|Input|View|Field(?:Cell)?|List|Attachment(?:Cell)?)?|a(?:sk|b(?:le(?:Header(?:Cell|View)|Column|View)|View(?:Item)?))|reeController)|I(?:n(?:dex(?:S(?:pecifier|et)|Path)|put(?:Manager|S(?:tream|erv(?:iceProvider|er(?:MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(?:Rep|Cell|View)?)|O(?:ut(?:putStream|lineView)|pen(?:GL(?:Context|Pixel(?:Buffer|Format)|View)|Panel)|bj(?:CTypeSerializationCallBack|ect(?:Controller)?))|D(?:i(?:st(?:antObject(?:Request)?|ributed(?:NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(?:Controller)?|e(?:serializer|cimalNumber(?:Behaviors|Handler)?|leteCommand)|at(?:e(?:Components|Picker(?:Cell)?|Formatter)?|a)|ra(?:wer|ggingInfo))|U(?:ser(?:InterfaceValidations|Defaults(?:Controller)?)|RL(?:Re(?:sponse|quest)|Handle(?:Client)?|C(?:onnection|ache|redential(?:Storage)?)|Download(?:Delegate)?|Prot(?:ocol(?:Client)?|ectionSpace)|AuthenticationChallenge(?:Sender)?)?|n(?:iqueIDSpecifier|doManager|archiver))|P(?:ipe|o(?:sitionalSpecifier|pUpButton(?:Cell)?|rt(?:Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(?:steboard|nel|ragraphStyle|geLayout)|r(?:int(?:Info|er|Operation|Panel)|o(?:cessInfo|tocolChecker|perty(?:Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(?:numerator|vent|PSImageRep|rror|x(?:ception|istsCommand|pression))|V(?:iew(?:Animation)?|al(?:idated(?:ToobarItem|UserInterfaceItem)|ue(?:Transformer)?))|Keyed(?:Unarchiver|Archiver)|Qui(?:ckDrawView|tCommand)|F(?:ile(?:Manager|Handle|Wrapper)|o(?:nt(?:Manager|Descriptor|Panel)?|rm(?:Cell|atter)))|W(?:hoseSpecifier|indow(?:Controller)?|orkspace)|L(?:o(?:c(?:k(?:ing)?|ale)|gicalTest)|evelIndicator(?:Cell)?|ayoutManager)|A(?:ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(?:ication|e(?:Script|Event(?:Manager|Descriptor)))|ffineTransform|lert|r(?:chiver|ray(?:Controller)?))))(?:\\b)" + token: ["support.type.cocoa.leopard"], + regex: "(?:\\b)(NS(?:R(?:u(?:nLoop|ler(?:Marker|View))|e(?:sponder|cursiveLock|lativeSpecifier)|an(?:domSpecifier|geSpecifier))|G(?:etCommand|lyph(?:Generator|Storage|Info)|raphicsContext)|XML(?:Node|D(?:ocument|TD(?:Node)?)|Parser|Element)|M(?:iddleSpecifier|ov(?:ie(?:View)?|eCommand)|utable(?:S(?:tring|et)|C(?:haracterSet|opying)|IndexSet|D(?:ictionary|ata)|URLRequest|ParagraphStyle|A(?:ttributedString|rray))|e(?:ssagePort(?:NameServer)?|nu(?:Item(?:Cell)?|View)?|t(?:hodSignature|adata(?:Item|Query(?:ResultGroup|AttributeValueTuple)?)))|a(?:ch(?:BootstrapServer|Port)|trix))|B(?:itmapImageRep|ox|u(?:ndle|tton(?:Cell)?)|ezierPath|rowser(?:Cell)?)|S(?:hadow|c(?:anner|r(?:ipt(?:SuiteRegistry|C(?:o(?:ercionHandler|mmand(?:Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(?:er|View)|een))|t(?:epper(?:Cell)?|atus(?:Bar|Item)|r(?:ing|eam))|imple(?:HorizontalTypesetter|CString)|o(?:cketPort(?:NameServer)?|und|rtDescriptor)|p(?:e(?:cifierTest|ech(?:Recognizer|Synthesizer)|ll(?:Server|Checker))|litView)|e(?:cureTextField(?:Cell)?|t(?:Command)?|archField(?:Cell)?|rializer|gmentedC(?:ontrol|ell))|lider(?:Cell)?|avePanel)|H(?:ost|TTP(?:Cookie(?:Storage)?|URLResponse)|elpManager)|N(?:ib(?:Con(?:nector|trolConnector)|OutletConnector)?|otification(?:Center|Queue)?|u(?:ll|mber(?:Formatter)?)|etService(?:Browser)?|ameSpecifier)|C(?:ha(?:ngeSpelling|racterSet)|o(?:n(?:stantString|nection|trol(?:ler)?|ditionLock)|d(?:ing|er)|unt(?:Command|edSet)|pying|lor(?:Space|P(?:ick(?:ing(?:Custom|Default)|er)|anel)|Well|List)?|m(?:p(?:oundPredicate|arisonPredicate)|boBox(?:Cell)?))|u(?:stomImageRep|rsor)|IImageRep|ell|l(?:ipView|o(?:seCommand|neCommand)|assDescription)|a(?:ched(?:ImageRep|URLResponse)|lendar(?:Date)?)|reateCommand)|T(?:hread|ypesetter|ime(?:Zone|r)|o(?:olbar(?:Item(?:Validations)?)?|kenField(?:Cell)?)|ext(?:Block|Storage|Container|Tab(?:le(?:Block)?)?|Input|View|Field(?:Cell)?|List|Attachment(?:Cell)?)?|a(?:sk|b(?:le(?:Header(?:Cell|View)|Column|View)|View(?:Item)?))|reeController)|I(?:n(?:dex(?:S(?:pecifier|et)|Path)|put(?:Manager|S(?:tream|erv(?:iceProvider|er(?:MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(?:Rep|Cell|View)?)|O(?:ut(?:putStream|lineView)|pen(?:GL(?:Context|Pixel(?:Buffer|Format)|View)|Panel)|bj(?:CTypeSerializationCallBack|ect(?:Controller)?))|D(?:i(?:st(?:antObject(?:Request)?|ributed(?:NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(?:Controller)?|e(?:serializer|cimalNumber(?:Behaviors|Handler)?|leteCommand)|at(?:e(?:Components|Picker(?:Cell)?|Formatter)?|a)|ra(?:wer|ggingInfo))|U(?:ser(?:InterfaceValidations|Defaults(?:Controller)?)|RL(?:Re(?:sponse|quest)|Handle(?:Client)?|C(?:onnection|ache|redential(?:Storage)?)|Download(?:Delegate)?|Prot(?:ocol(?:Client)?|ectionSpace)|AuthenticationChallenge(?:Sender)?)?|n(?:iqueIDSpecifier|doManager|archiver))|P(?:ipe|o(?:sitionalSpecifier|pUpButton(?:Cell)?|rt(?:Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(?:steboard|nel|ragraphStyle|geLayout)|r(?:int(?:Info|er|Operation|Panel)|o(?:cessInfo|tocolChecker|perty(?:Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(?:numerator|vent|PSImageRep|rror|x(?:ception|istsCommand|pression))|V(?:iew(?:Animation)?|al(?:idated(?:ToobarItem|UserInterfaceItem)|ue(?:Transformer)?))|Keyed(?:Unarchiver|Archiver)|Qui(?:ckDrawView|tCommand)|F(?:ile(?:Manager|Handle|Wrapper)|o(?:nt(?:Manager|Descriptor|Panel)?|rm(?:Cell|atter)))|W(?:hoseSpecifier|indow(?:Controller)?|orkspace)|L(?:o(?:c(?:k(?:ing)?|ale)|gicalTest)|evelIndicator(?:Cell)?|ayoutManager)|A(?:ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(?:ication|e(?:Script|Event(?:Manager|Descriptor)))|ffineTransform|lert|r(?:chiver|ray(?:Controller)?))))(?:\\b)" }, { - "token": ["support.class.quartz"], - "regex": "(?:\\b)(C(?:I(?:Sampler|Co(?:ntext|lor)|Image(?:Accumulator)?|PlugIn(?:Registration)?|Vector|Kernel|Filter(?:Generator|Shape)?)|A(?:Renderer|MediaTiming(?:Function)?|BasicAnimation|ScrollLayer|Constraint(?:LayoutManager)?|T(?:iledLayer|extLayer|rans(?:ition|action))|OpenGLLayer|PropertyAnimation|KeyframeAnimation|Layer|A(?:nimation(?:Group)?|ction))))(?:\\b)" + token: ["support.class.quartz"], + regex: "(?:\\b)(C(?:I(?:Sampler|Co(?:ntext|lor)|Image(?:Accumulator)?|PlugIn(?:Registration)?|Vector|Kernel|Filter(?:Generator|Shape)?)|A(?:Renderer|MediaTiming(?:Function)?|BasicAnimation|ScrollLayer|Constraint(?:LayoutManager)?|T(?:iledLayer|extLayer|rans(?:ition|action))|OpenGLLayer|PropertyAnimation|KeyframeAnimation|Layer|A(?:nimation(?:Group)?|ction))))(?:\\b)" }, { - "token": ["support.type.quartz"], - "regex": "(?:\\b)(C(?:G(?:Float|Point|Size|Rect)|IFormat|AConstraintAttribute))(?:\\b)" + token: ["support.type.quartz"], + regex: "(?:\\b)(C(?:G(?:Float|Point|Size|Rect)|IFormat|AConstraintAttribute))(?:\\b)" }, { - "token": ["support.type.cocoa"], - "regex": "(?:\\b)(NS(?:R(?:ect(?:Edge)?|ange)|G(?:lyph(?:Relation|LayoutMode)?|radientType)|M(?:odalSession|a(?:trixMode|p(?:Table|Enumerator)))|B(?:itmapImageFileType|orderType|uttonType|ezelStyle|ackingStoreType|rowserColumnResizingType)|S(?:cr(?:oll(?:er(?:Part|Arrow)|ArrowPosition)|eenAuxiliaryOpaque)|tringEncoding|ize|ocketNativeHandle|election(?:Granularity|Direction|Affinity)|wapped(?:Double|Float)|aveOperationType)|Ha(?:sh(?:Table|Enumerator)|ndler(?:2)?)|C(?:o(?:ntrol(?:Size|Tint)|mp(?:ositingOperation|arisonResult))|ell(?:State|Type|ImagePosition|Attribute))|T(?:hreadPrivate|ypesetterGlyphInfo|i(?:ckMarkPosition|tlePosition|meInterval)|o(?:ol(?:TipTag|bar(?:SizeMode|DisplayMode))|kenStyle)|IFFCompression|ext(?:TabType|Alignment)|ab(?:State|leViewDropOperation|ViewType)|rackingRectTag)|ImageInterpolation|Zone|OpenGL(?:ContextAuxiliary|PixelFormatAuxiliary)|D(?:ocumentChangeType|atePickerElementFlags|ra(?:werState|gOperation))|UsableScrollerParts|P(?:oint|r(?:intingPageOrder|ogressIndicator(?:Style|Th(?:ickness|readInfo))))|EventType|KeyValueObservingOptions|Fo(?:nt(?:SymbolicTraits|TraitMask|Action)|cusRingType)|W(?:indow(?:OrderingMode|Depth)|orkspace(?:IconCreationOptions|LaunchOptions)|ritingDirection)|L(?:ineBreakMode|ayout(?:Status|Direction))|A(?:nimation(?:Progress|Effect)|ppl(?:ication(?:TerminateReply|DelegateReply|PrintReply)|eEventManagerSuspensionID)|ffineTransformStruct|lertStyle)))(?:\\b)" + token: ["support.type.cocoa"], + regex: "(?:\\b)(NS(?:R(?:ect(?:Edge)?|ange)|G(?:lyph(?:Relation|LayoutMode)?|radientType)|M(?:odalSession|a(?:trixMode|p(?:Table|Enumerator)))|B(?:itmapImageFileType|orderType|uttonType|ezelStyle|ackingStoreType|rowserColumnResizingType)|S(?:cr(?:oll(?:er(?:Part|Arrow)|ArrowPosition)|eenAuxiliaryOpaque)|tringEncoding|ize|ocketNativeHandle|election(?:Granularity|Direction|Affinity)|wapped(?:Double|Float)|aveOperationType)|Ha(?:sh(?:Table|Enumerator)|ndler(?:2)?)|C(?:o(?:ntrol(?:Size|Tint)|mp(?:ositingOperation|arisonResult))|ell(?:State|Type|ImagePosition|Attribute))|T(?:hreadPrivate|ypesetterGlyphInfo|i(?:ckMarkPosition|tlePosition|meInterval)|o(?:ol(?:TipTag|bar(?:SizeMode|DisplayMode))|kenStyle)|IFFCompression|ext(?:TabType|Alignment)|ab(?:State|leViewDropOperation|ViewType)|rackingRectTag)|ImageInterpolation|Zone|OpenGL(?:ContextAuxiliary|PixelFormatAuxiliary)|D(?:ocumentChangeType|atePickerElementFlags|ra(?:werState|gOperation))|UsableScrollerParts|P(?:oint|r(?:intingPageOrder|ogressIndicator(?:Style|Th(?:ickness|readInfo))))|EventType|KeyValueObservingOptions|Fo(?:nt(?:SymbolicTraits|TraitMask|Action)|cusRingType)|W(?:indow(?:OrderingMode|Depth)|orkspace(?:IconCreationOptions|LaunchOptions)|ritingDirection)|L(?:ineBreakMode|ayout(?:Status|Direction))|A(?:nimation(?:Progress|Effect)|ppl(?:ication(?:TerminateReply|DelegateReply|PrintReply)|eEventManagerSuspensionID)|ffineTransformStruct|lertStyle)))(?:\\b)" }, { - "token": ["support.constant.cocoa"], - "regex": "(?:\\b)(NS(?:NotFound|Ordered(?:Ascending|Descending|Same)))(?:\\b)" + token: ["support.constant.cocoa"], + regex: "(?:\\b)(NS(?:NotFound|Ordered(?:Ascending|Descending|Same)))(?:\\b)" }, { - "token": ["support.constant.notification.cocoa.leopard"], - "regex": "(?:\\b)(NS(?:MenuDidBeginTracking|ViewDidUpdateTrackingAreas)?Notification)(?:\\b)" + token: ["support.constant.notification.cocoa.leopard"], + regex: "(?:\\b)(NS(?:MenuDidBeginTracking|ViewDidUpdateTrackingAreas)?Notification)(?:\\b)" }, { - "token": ["support.constant.notification.cocoa"], - "regex": "(?:\\b)(NS(?:Menu(?:Did(?:RemoveItem|SendAction|ChangeItem|EndTracking|AddItem)|WillSendAction)|S(?:ystemColorsDidChange|plitView(?:DidResizeSubviews|WillResizeSubviews))|C(?:o(?:nt(?:extHelpModeDid(?:Deactivate|Activate)|rolT(?:intDidChange|extDid(?:BeginEditing|Change|EndEditing)))|lor(?:PanelColorDidChange|ListDidChange)|mboBox(?:Selection(?:IsChanging|DidChange)|Will(?:Dismiss|PopUp)))|lassDescriptionNeededForClass)|T(?:oolbar(?:DidRemoveItem|WillAddItem)|ext(?:Storage(?:DidProcessEditing|WillProcessEditing)|Did(?:BeginEditing|Change|EndEditing)|View(?:DidChange(?:Selection|TypingAttributes)|WillChangeNotifyingTextView))|ableView(?:Selection(?:IsChanging|DidChange)|ColumnDid(?:Resize|Move)))|ImageRepRegistryDidChange|OutlineView(?:Selection(?:IsChanging|DidChange)|ColumnDid(?:Resize|Move)|Item(?:Did(?:Collapse|Expand)|Will(?:Collapse|Expand)))|Drawer(?:Did(?:Close|Open)|Will(?:Close|Open))|PopUpButton(?:CellWillPopUp|WillPopUp)|View(?:GlobalFrameDidChange|BoundsDidChange|F(?:ocusDidChange|rameDidChange))|FontSetChanged|W(?:indow(?:Did(?:Resi(?:ze|gn(?:Main|Key))|M(?:iniaturize|ove)|Become(?:Main|Key)|ChangeScreen(?:|Profile)|Deminiaturize|Update|E(?:ndSheet|xpose))|Will(?:M(?:iniaturize|ove)|BeginSheet|Close))|orkspace(?:SessionDid(?:ResignActive|BecomeActive)|Did(?:Mount|TerminateApplication|Unmount|PerformFileOperation|Wake|LaunchApplication)|Will(?:Sleep|Unmount|PowerOff|LaunchApplication)))|A(?:ntialiasThresholdChanged|ppl(?:ication(?:Did(?:ResignActive|BecomeActive|Hide|ChangeScreenParameters|U(?:nhide|pdate)|FinishLaunching)|Will(?:ResignActive|BecomeActive|Hide|Terminate|U(?:nhide|pdate)|FinishLaunching))|eEventManagerWillProcessFirstEvent)))Notification)(?:\\b)" + token: ["support.constant.notification.cocoa"], + regex: "(?:\\b)(NS(?:Menu(?:Did(?:RemoveItem|SendAction|ChangeItem|EndTracking|AddItem)|WillSendAction)|S(?:ystemColorsDidChange|plitView(?:DidResizeSubviews|WillResizeSubviews))|C(?:o(?:nt(?:extHelpModeDid(?:Deactivate|Activate)|rolT(?:intDidChange|extDid(?:BeginEditing|Change|EndEditing)))|lor(?:PanelColorDidChange|ListDidChange)|mboBox(?:Selection(?:IsChanging|DidChange)|Will(?:Dismiss|PopUp)))|lassDescriptionNeededForClass)|T(?:oolbar(?:DidRemoveItem|WillAddItem)|ext(?:Storage(?:DidProcessEditing|WillProcessEditing)|Did(?:BeginEditing|Change|EndEditing)|View(?:DidChange(?:Selection|TypingAttributes)|WillChangeNotifyingTextView))|ableView(?:Selection(?:IsChanging|DidChange)|ColumnDid(?:Resize|Move)))|ImageRepRegistryDidChange|OutlineView(?:Selection(?:IsChanging|DidChange)|ColumnDid(?:Resize|Move)|Item(?:Did(?:Collapse|Expand)|Will(?:Collapse|Expand)))|Drawer(?:Did(?:Close|Open)|Will(?:Close|Open))|PopUpButton(?:CellWillPopUp|WillPopUp)|View(?:GlobalFrameDidChange|BoundsDidChange|F(?:ocusDidChange|rameDidChange))|FontSetChanged|W(?:indow(?:Did(?:Resi(?:ze|gn(?:Main|Key))|M(?:iniaturize|ove)|Become(?:Main|Key)|ChangeScreen(?:|Profile)|Deminiaturize|Update|E(?:ndSheet|xpose))|Will(?:M(?:iniaturize|ove)|BeginSheet|Close))|orkspace(?:SessionDid(?:ResignActive|BecomeActive)|Did(?:Mount|TerminateApplication|Unmount|PerformFileOperation|Wake|LaunchApplication)|Will(?:Sleep|Unmount|PowerOff|LaunchApplication)))|A(?:ntialiasThresholdChanged|ppl(?:ication(?:Did(?:ResignActive|BecomeActive|Hide|ChangeScreenParameters|U(?:nhide|pdate)|FinishLaunching)|Will(?:ResignActive|BecomeActive|Hide|Terminate|U(?:nhide|pdate)|FinishLaunching))|eEventManagerWillProcessFirstEvent)))Notification)(?:\\b)" }, { - "token": ["support.constant.cocoa.leopard"], - "regex": "(?:\\b)(NS(?:RuleEditor(?:RowType(?:Simple|Compound)|NestingMode(?:Si(?:ngle|mple)|Compound|List))|GradientDraws(?:BeforeStartingLocation|AfterEndingLocation)|M(?:inusSetExpressionType|a(?:chPortDeallocate(?:ReceiveRight|SendRight|None)|pTable(?:StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality)))|B(?:oxCustom|undleExecutableArchitecture(?:X86|I386|PPC(?:64)?)|etweenPredicateOperatorType|ackgroundStyle(?:Raised|Dark|L(?:ight|owered)))|S(?:tring(?:DrawingTruncatesLastVisibleLine|EncodingConversion(?:ExternalRepresentation|AllowLossy))|ubqueryExpressionType|p(?:e(?:ech(?:SentenceBoundary|ImmediateBoundary|WordBoundary)|llingState(?:GrammarFlag|SpellingFlag))|litViewDividerStyleThi(?:n|ck))|e(?:rvice(?:RequestTimedOutError|M(?:iscellaneousError|alformedServiceDictionaryError)|InvalidPasteboardDataError|ErrorM(?:inimum|aximum)|Application(?:NotFoundError|LaunchFailedError))|gmentStyle(?:Round(?:Rect|ed)|SmallSquare|Capsule|Textured(?:Rounded|Square)|Automatic)))|H(?:UDWindowMask|ashTable(?:StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality))|N(?:oModeColorPanel|etServiceNoAutoRename)|C(?:hangeRedone|o(?:ntainsPredicateOperatorType|l(?:orRenderingIntent(?:RelativeColorimetric|Saturation|Default|Perceptual|AbsoluteColorimetric)|lectorDisabledOption))|ellHit(?:None|ContentArea|TrackableArea|EditableTextArea))|T(?:imeZoneNameStyle(?:S(?:hort(?:Standard|DaylightSaving)|tandard)|DaylightSaving)|extFieldDatePickerStyle|ableViewSelectionHighlightStyle(?:Regular|SourceList)|racking(?:Mouse(?:Moved|EnteredAndExited)|CursorUpdate|InVisibleRect|EnabledDuringMouseDrag|A(?:ssumeInside|ctive(?:In(?:KeyWindow|ActiveApp)|WhenFirstResponder|Always))))|I(?:n(?:tersectSetExpressionType|dexedColorSpaceModel)|mageScale(?:None|Proportionally(?:Down|UpOrDown)|AxesIndependently))|Ope(?:nGLPFAAllowOfflineRenderers|rationQueue(?:DefaultMaxConcurrentOperationCount|Priority(?:High|Normal|Very(?:High|Low)|Low)))|D(?:iacriticInsensitiveSearch|ownloadsDirectory)|U(?:nionSetExpressionType|TF(?:16(?:BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)|32(?:BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)))|P(?:ointerFunctions(?:Ma(?:chVirtualMemory|llocMemory)|Str(?:ongMemory|uctPersonality)|C(?:StringPersonality|opyIn)|IntegerPersonality|ZeroingWeakMemory|O(?:paque(?:Memory|Personality)|bjectP(?:ointerPersonality|ersonality)))|at(?:hStyle(?:Standard|NavigationBar|PopUp)|ternColorSpaceModel)|rintPanelShows(?:Scaling|Copies|Orientation|P(?:a(?:perSize|ge(?:Range|SetupAccessory))|review)))|Executable(?:RuntimeMismatchError|NotLoadableError|ErrorM(?:inimum|aximum)|L(?:inkError|oadError)|ArchitectureMismatchError)|KeyValueObservingOption(?:Initial|Prior)|F(?:i(?:ndPanelSubstringMatchType(?:StartsWith|Contains|EndsWith|FullWord)|leRead(?:TooLargeError|UnknownStringEncodingError))|orcedOrderingSearch)|Wi(?:ndow(?:BackingLocation(?:MainMemory|Default|VideoMemory)|Sharing(?:Read(?:Only|Write)|None)|CollectionBehavior(?:MoveToActiveSpace|CanJoinAllSpaces|Default))|dthInsensitiveSearch)|AggregateExpressionType))(?:\\b)" + token: ["support.constant.cocoa.leopard"], + regex: "(?:\\b)(NS(?:RuleEditor(?:RowType(?:Simple|Compound)|NestingMode(?:Si(?:ngle|mple)|Compound|List))|GradientDraws(?:BeforeStartingLocation|AfterEndingLocation)|M(?:inusSetExpressionType|a(?:chPortDeallocate(?:ReceiveRight|SendRight|None)|pTable(?:StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality)))|B(?:oxCustom|undleExecutableArchitecture(?:X86|I386|PPC(?:64)?)|etweenPredicateOperatorType|ackgroundStyle(?:Raised|Dark|L(?:ight|owered)))|S(?:tring(?:DrawingTruncatesLastVisibleLine|EncodingConversion(?:ExternalRepresentation|AllowLossy))|ubqueryExpressionType|p(?:e(?:ech(?:SentenceBoundary|ImmediateBoundary|WordBoundary)|llingState(?:GrammarFlag|SpellingFlag))|litViewDividerStyleThi(?:n|ck))|e(?:rvice(?:RequestTimedOutError|M(?:iscellaneousError|alformedServiceDictionaryError)|InvalidPasteboardDataError|ErrorM(?:inimum|aximum)|Application(?:NotFoundError|LaunchFailedError))|gmentStyle(?:Round(?:Rect|ed)|SmallSquare|Capsule|Textured(?:Rounded|Square)|Automatic)))|H(?:UDWindowMask|ashTable(?:StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality))|N(?:oModeColorPanel|etServiceNoAutoRename)|C(?:hangeRedone|o(?:ntainsPredicateOperatorType|l(?:orRenderingIntent(?:RelativeColorimetric|Saturation|Default|Perceptual|AbsoluteColorimetric)|lectorDisabledOption))|ellHit(?:None|ContentArea|TrackableArea|EditableTextArea))|T(?:imeZoneNameStyle(?:S(?:hort(?:Standard|DaylightSaving)|tandard)|DaylightSaving)|extFieldDatePickerStyle|ableViewSelectionHighlightStyle(?:Regular|SourceList)|racking(?:Mouse(?:Moved|EnteredAndExited)|CursorUpdate|InVisibleRect|EnabledDuringMouseDrag|A(?:ssumeInside|ctive(?:In(?:KeyWindow|ActiveApp)|WhenFirstResponder|Always))))|I(?:n(?:tersectSetExpressionType|dexedColorSpaceModel)|mageScale(?:None|Proportionally(?:Down|UpOrDown)|AxesIndependently))|Ope(?:nGLPFAAllowOfflineRenderers|rationQueue(?:DefaultMaxConcurrentOperationCount|Priority(?:High|Normal|Very(?:High|Low)|Low)))|D(?:iacriticInsensitiveSearch|ownloadsDirectory)|U(?:nionSetExpressionType|TF(?:16(?:BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)|32(?:BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)))|P(?:ointerFunctions(?:Ma(?:chVirtualMemory|llocMemory)|Str(?:ongMemory|uctPersonality)|C(?:StringPersonality|opyIn)|IntegerPersonality|ZeroingWeakMemory|O(?:paque(?:Memory|Personality)|bjectP(?:ointerPersonality|ersonality)))|at(?:hStyle(?:Standard|NavigationBar|PopUp)|ternColorSpaceModel)|rintPanelShows(?:Scaling|Copies|Orientation|P(?:a(?:perSize|ge(?:Range|SetupAccessory))|review)))|Executable(?:RuntimeMismatchError|NotLoadableError|ErrorM(?:inimum|aximum)|L(?:inkError|oadError)|ArchitectureMismatchError)|KeyValueObservingOption(?:Initial|Prior)|F(?:i(?:ndPanelSubstringMatchType(?:StartsWith|Contains|EndsWith|FullWord)|leRead(?:TooLargeError|UnknownStringEncodingError))|orcedOrderingSearch)|Wi(?:ndow(?:BackingLocation(?:MainMemory|Default|VideoMemory)|Sharing(?:Read(?:Only|Write)|None)|CollectionBehavior(?:MoveToActiveSpace|CanJoinAllSpaces|Default))|dthInsensitiveSearch)|AggregateExpressionType))(?:\\b)" }, { - "token": ["support.constant.cocoa"], - "regex": "(?:\\b)(NS(?:R(?:GB(?:ModeColorPanel|ColorSpaceModel)|ight(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|T(?:ext(?:Movement|Alignment)|ab(?:sBezelBorder|StopType))|ArrowFunctionKey)|ound(?:RectBezelStyle|Bankers|ed(?:BezelStyle|TokenStyle|DisclosureBezelStyle)|Down|Up|Plain|Line(?:CapStyle|JoinStyle))|un(?:StoppedResponse|ContinuesResponse|AbortedResponse)|e(?:s(?:izableWindowMask|et(?:CursorRectsRunLoopOrdering|FunctionKey))|ce(?:ssedBezelStyle|iver(?:sCantHandleCommandScriptError|EvaluationScriptError))|turnTextMovement|doFunctionKey|quiredArgumentsMissingScriptError|l(?:evancyLevelIndicatorStyle|ative(?:Before|After))|gular(?:SquareBezelStyle|ControlSize)|moveTraitFontAction)|a(?:n(?:domSubelement|geDateMode)|tingLevelIndicatorStyle|dio(?:ModeMatrix|Button)))|G(?:IFFileType|lyph(?:Below|Inscribe(?:B(?:elow|ase)|Over(?:strike|Below)|Above)|Layout(?:WithPrevious|A(?:tAPoint|gainstAPoint))|A(?:ttribute(?:BidiLevel|Soft|Inscribe|Elastic)|bove))|r(?:ooveBorder|eaterThan(?:Comparison|OrEqualTo(?:Comparison|PredicateOperatorType)|PredicateOperatorType)|a(?:y(?:ModeColorPanel|ColorSpaceModel)|dient(?:None|Con(?:cave(?:Strong|Weak)|vex(?:Strong|Weak)))|phiteControlTint)))|XML(?:N(?:o(?:tationDeclarationKind|de(?:CompactEmptyElement|IsCDATA|OptionsNone|Use(?:SingleQuotes|DoubleQuotes)|Pre(?:serve(?:NamespaceOrder|C(?:haracterReferences|DATA)|DTD|Prefixes|E(?:ntities|mptyElements)|Quotes|Whitespace|A(?:ttributeOrder|ll))|ttyPrint)|ExpandEmptyElement))|amespaceKind)|CommentKind|TextKind|InvalidKind|D(?:ocument(?:X(?:MLKind|HTMLKind|Include)|HTMLKind|T(?:idy(?:XML|HTML)|extKind)|IncludeContentTypeDeclaration|Validate|Kind)|TDKind)|P(?:arser(?:GTRequiredError|XMLDeclNot(?:StartedError|FinishedError)|Mi(?:splaced(?:XMLDeclarationError|CDATAEndStringError)|xedContentDeclNot(?:StartedError|FinishedError))|S(?:t(?:andaloneValueError|ringNot(?:StartedError|ClosedError))|paceRequiredError|eparatorRequiredError)|N(?:MTOKENRequiredError|o(?:t(?:ationNot(?:StartedError|FinishedError)|WellBalancedError)|DTDError)|amespaceDeclarationError|AMERequiredError)|C(?:haracterRef(?:In(?:DTDError|PrologError|EpilogError)|AtEOFError)|o(?:nditionalSectionNot(?:StartedError|FinishedError)|mment(?:NotFinishedError|ContainsDoubleHyphenError))|DATANotFinishedError)|TagNameMismatchError|In(?:ternalError|valid(?:HexCharacterRefError|C(?:haracter(?:RefError|InEntityError|Error)|onditionalSectionError)|DecimalCharacterRefError|URIError|Encoding(?:NameError|Error)))|OutOfMemoryError|D(?:ocumentStartError|elegateAbortedParseError|OCTYPEDeclNotFinishedError)|U(?:RI(?:RequiredError|FragmentError)|n(?:declaredEntityError|parsedEntityError|knownEncodingError|finishedTagError))|P(?:CDATARequiredError|ublicIdentifierRequiredError|arsedEntityRef(?:MissingSemiError|NoNameError|In(?:Internal(?:SubsetError|Error)|PrologError|EpilogError)|AtEOFError)|r(?:ocessingInstructionNot(?:StartedError|FinishedError)|ematureDocumentEndError))|E(?:n(?:codingNotSupportedError|tity(?:Ref(?:In(?:DTDError|PrologError|EpilogError)|erence(?:MissingSemiError|WithoutNameError)|LoopError|AtEOFError)|BoundaryError|Not(?:StartedError|FinishedError)|Is(?:ParameterError|ExternalError)|ValueRequiredError))|qualExpectedError|lementContentDeclNot(?:StartedError|FinishedError)|xt(?:ernalS(?:tandaloneEntityError|ubsetNotFinishedError)|raContentError)|mptyDocumentError)|L(?:iteralNot(?:StartedError|FinishedError)|T(?:RequiredError|SlashRequiredError)|essThanSymbolInAttributeError)|Attribute(?:RedefinedError|HasNoValueError|Not(?:StartedError|FinishedError)|ListNot(?:StartedError|FinishedError)))|rocessingInstructionKind)|E(?:ntity(?:GeneralKind|DeclarationKind|UnparsedKind|P(?:ar(?:sedKind|ameterKind)|redefined))|lement(?:Declaration(?:MixedKind|UndefinedKind|E(?:lementKind|mptyKind)|Kind|AnyKind)|Kind))|Attribute(?:N(?:MToken(?:sKind|Kind)|otationKind)|CDATAKind|ID(?:Ref(?:sKind|Kind)|Kind)|DeclarationKind|En(?:tit(?:yKind|iesKind)|umerationKind)|Kind))|M(?:i(?:n(?:XEdge|iaturizableWindowMask|YEdge|uteCalendarUnit)|terLineJoinStyle|ddleSubelement|xedState)|o(?:nthCalendarUnit|deSwitchFunctionKey|use(?:Moved(?:Mask)?|E(?:ntered(?:Mask)?|ventSubtype|xited(?:Mask)?))|veToBezierPathElement|mentary(?:ChangeButton|Push(?:Button|InButton)|Light(?:Button)?))|enuFunctionKey|a(?:c(?:intoshInterfaceStyle|OSRomanStringEncoding)|tchesPredicateOperatorType|ppedRead|x(?:XEdge|YEdge))|ACHOperatingSystem)|B(?:MPFileType|o(?:ttomTabsBezelBorder|ldFontMask|rderlessWindowMask|x(?:Se(?:condary|parator)|OldStyle|Primary))|uttLineCapStyle|e(?:zelBorder|velLineJoinStyle|low(?:Bottom|Top)|gin(?:sWith(?:Comparison|PredicateOperatorType)|FunctionKey))|lueControlTint|ack(?:spaceCharacter|tabTextMovement|ingStore(?:Retained|Buffered|Nonretained)|TabCharacter|wardsSearch|groundTab)|r(?:owser(?:NoColumnResizing|UserColumnResizing|AutoColumnResizing)|eakFunctionKey))|S(?:h(?:ift(?:JISStringEncoding|KeyMask)|ow(?:ControlGlyphs|InvisibleGlyphs)|adowlessSquareBezelStyle)|y(?:s(?:ReqFunctionKey|tem(?:D(?:omainMask|efined(?:Mask)?)|FunctionKey))|mbolStringEncoding)|c(?:a(?:nnedOption|le(?:None|ToFit|Proportionally))|r(?:oll(?:er(?:NoPart|Increment(?:Page|Line|Arrow)|Decrement(?:Page|Line|Arrow)|Knob(?:Slot)?|Arrows(?:M(?:inEnd|axEnd)|None|DefaultSetting))|Wheel(?:Mask)?|LockFunctionKey)|eenChangedEventType))|t(?:opFunctionKey|r(?:ingDrawing(?:OneShot|DisableScreenFontSubstitution|Uses(?:DeviceMetrics|FontLeading|LineFragmentOrigin))|eam(?:Status(?:Reading|NotOpen|Closed|Open(?:ing)?|Error|Writing|AtEnd)|Event(?:Has(?:BytesAvailable|SpaceAvailable)|None|OpenCompleted|E(?:ndEncountered|rrorOccurred)))))|i(?:ngle(?:DateMode|UnderlineStyle)|ze(?:DownFontAction|UpFontAction))|olarisOperatingSystem|unOSOperatingSystem|pecialPageOrder|e(?:condCalendarUnit|lect(?:By(?:Character|Paragraph|Word)|i(?:ng(?:Next|Previous)|onAffinity(?:Downstream|Upstream))|edTab|FunctionKey)|gmentSwitchTracking(?:Momentary|Select(?:One|Any)))|quareLineCapStyle|witchButton|ave(?:ToOperation|Op(?:tions(?:Yes|No|Ask)|eration)|AsOperation)|mall(?:SquareBezelStyle|C(?:ontrolSize|apsFontMask)|IconButtonBezelStyle))|H(?:ighlightModeMatrix|SBModeColorPanel|o(?:ur(?:Minute(?:SecondDatePickerElementFlag|DatePickerElementFlag)|CalendarUnit)|rizontalRuler|meFunctionKey)|TTPCookieAcceptPolicy(?:Never|OnlyFromMainDocumentDomain|Always)|e(?:lp(?:ButtonBezelStyle|KeyMask|FunctionKey)|avierFontAction)|PUXOperatingSystem)|Year(?:MonthDa(?:yDatePickerElementFlag|tePickerElementFlag)|CalendarUnit)|N(?:o(?:n(?:StandardCharacterSetFontMask|ZeroWindingRule|activatingPanelMask|LossyASCIIStringEncoding)|Border|t(?:ification(?:SuspensionBehavior(?:Hold|Coalesce|D(?:eliverImmediately|rop))|NoCoalescing|CoalescingOn(?:Sender|Name)|DeliverImmediately|PostToAllSessions)|PredicateType|EqualToPredicateOperatorType)|S(?:cr(?:iptError|ollerParts)|ubelement|pecifierError)|CellMask|T(?:itle|opLevelContainersSpecifierError|abs(?:BezelBorder|NoBorder|LineBorder))|I(?:nterfaceStyle|mage)|UnderlineStyle|FontChangeAction)|u(?:ll(?:Glyph|CellType)|m(?:eric(?:Search|PadKeyMask)|berFormatter(?:Round(?:Half(?:Down|Up|Even)|Ceiling|Down|Up|Floor)|Behavior(?:10|Default)|S(?:cientificStyle|pellOutStyle)|NoStyle|CurrencyStyle|DecimalStyle|P(?:ercentStyle|ad(?:Before(?:Suffix|Prefix)|After(?:Suffix|Prefix))))))|e(?:t(?:Services(?:BadArgumentError|NotFoundError|C(?:ollisionError|ancelledError)|TimeoutError|InvalidError|UnknownError|ActivityInProgress)|workDomainMask)|wlineCharacter|xt(?:StepInterfaceStyle|FunctionKey))|EXTSTEPStringEncoding|a(?:t(?:iveShortGlyphPacking|uralTextAlignment)|rrowFontMask))|C(?:hange(?:ReadOtherContents|GrayCell(?:Mask)?|BackgroundCell(?:Mask)?|Cleared|Done|Undone|Autosaved)|MYK(?:ModeColorPanel|ColorSpaceModel)|ircular(?:BezelStyle|Slider)|o(?:n(?:stantValueExpressionType|t(?:inuousCapacityLevelIndicatorStyle|entsCellMask|ain(?:sComparison|erSpecifierError)|rol(?:Glyph|KeyMask))|densedFontMask)|lor(?:Panel(?:RGBModeMask|GrayModeMask|HSBModeMask|C(?:MYKModeMask|olorListModeMask|ustomPaletteModeMask|rayonModeMask)|WheelModeMask|AllModesMask)|ListModeColorPanel)|reServiceDirectory|m(?:p(?:osite(?:XOR|Source(?:In|O(?:ut|ver)|Atop)|Highlight|C(?:opy|lear)|Destination(?:In|O(?:ut|ver)|Atop)|Plus(?:Darker|Lighter))|ressedFontMask)|mandKeyMask))|u(?:stom(?:SelectorPredicateOperatorType|PaletteModeColorPanel)|r(?:sor(?:Update(?:Mask)?|PointingDevice)|veToBezierPathElement))|e(?:nterT(?:extAlignment|abStopType)|ll(?:State|H(?:ighlighted|as(?:Image(?:Horizontal|OnLeftOrBottom)|OverlappingImage))|ChangesContents|Is(?:Bordered|InsetButton)|Disabled|Editable|LightsBy(?:Gray|Background|Contents)|AllowsMixedState))|l(?:ipPagination|o(?:s(?:ePathBezierPathElement|ableWindowMask)|ckAndCalendarDatePickerStyle)|ear(?:ControlTint|DisplayFunctionKey|LineFunctionKey))|a(?:seInsensitive(?:Search|PredicateOption)|n(?:notCreateScriptCommandError|cel(?:Button|TextMovement))|chesDirectory|lculation(?:NoError|Overflow|DivideByZero|Underflow|LossOfPrecision)|rriageReturnCharacter)|r(?:itical(?:Request|AlertStyle)|ayonModeColorPanel))|T(?:hick(?:SquareBezelStyle|erSquareBezelStyle)|ypesetter(?:Behavior|HorizontalTabAction|ContainerBreakAction|ZeroAdvancementAction|OriginalBehavior|ParagraphBreakAction|WhitespaceAction|L(?:ineBreakAction|atestBehavior))|i(?:ckMark(?:Right|Below|Left|Above)|tledWindowMask|meZoneDatePickerElementFlag)|o(?:olbarItemVisibilityPriority(?:Standard|High|User|Low)|pTabsBezelBorder|ggleButton)|IFF(?:Compression(?:N(?:one|EXT)|CCITTFAX(?:3|4)|OldJPEG|JPEG|PackBits|LZW)|FileType)|e(?:rminate(?:Now|Cancel|Later)|xt(?:Read(?:InapplicableDocumentTypeError|WriteErrorM(?:inimum|aximum))|Block(?:M(?:i(?:nimum(?:Height|Width)|ddleAlignment)|a(?:rgin|ximum(?:Height|Width)))|B(?:o(?:ttomAlignment|rder)|aselineAlignment)|Height|TopAlignment|P(?:ercentageValueType|adding)|Width|AbsoluteValueType)|StorageEdited(?:Characters|Attributes)|CellType|ured(?:RoundedBezelStyle|BackgroundWindowMask|SquareBezelStyle)|Table(?:FixedLayoutAlgorithm|AutomaticLayoutAlgorithm)|Field(?:RoundedBezel|SquareBezel|AndStepperDatePickerStyle)|WriteInapplicableDocumentTypeError|ListPrependEnclosingMarker))|woByteGlyphPacking|ab(?:Character|TextMovement|le(?:tP(?:oint(?:Mask|EventSubtype)?|roximity(?:Mask|EventSubtype)?)|Column(?:NoResizing|UserResizingMask|AutoresizingMask)|View(?:ReverseSequentialColumnAutoresizingStyle|GridNone|S(?:olid(?:HorizontalGridLineMask|VerticalGridLineMask)|equentialColumnAutoresizingStyle)|NoColumnAutoresizing|UniformColumnAutoresizingStyle|FirstColumnOnlyAutoresizingStyle|LastColumnOnlyAutoresizingStyle)))|rackModeMatrix)|I(?:n(?:sert(?:CharFunctionKey|FunctionKey|LineFunctionKey)|t(?:Type|ernalS(?:criptError|pecifierError))|dexSubelement|validIndexSpecifierError|formational(?:Request|AlertStyle)|PredicateOperatorType)|talicFontMask|SO(?:2022JPStringEncoding|Latin(?:1StringEncoding|2StringEncoding))|dentityMappingCharacterCollection|llegalTextMovement|mage(?:R(?:ight|ep(?:MatchesDevice|LoadStatus(?:ReadingHeader|Completed|InvalidData|Un(?:expectedEOF|knownType)|WillNeedAllData)))|Below|C(?:ellType|ache(?:BySize|Never|Default|Always))|Interpolation(?:High|None|Default|Low)|O(?:nly|verlaps)|Frame(?:Gr(?:oove|ayBezel)|Button|None|Photo)|L(?:oadStatus(?:ReadError|C(?:ompleted|ancelled)|InvalidData|UnexpectedEOF)|eft)|A(?:lign(?:Right|Bottom(?:Right|Left)?|Center|Top(?:Right|Left)?|Left)|bove)))|O(?:n(?:State|eByteGlyphPacking|OffButton|lyScrollerArrows)|ther(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|TextMovement)|SF1OperatingSystem|pe(?:n(?:GL(?:GO(?:Re(?:setLibrary|tainRenderers)|ClearFormatCache|FormatCacheSize)|PFA(?:R(?:obust|endererID)|M(?:inimumPolicy|ulti(?:sample|Screen)|PSafe|aximumPolicy)|BackingStore|S(?:creenMask|te(?:ncilSize|reo)|ingleRenderer|upersample|ample(?:s|Buffers|Alpha))|NoRecovery|C(?:o(?:lor(?:Size|Float)|mpliant)|losestPolicy)|OffScreen|D(?:oubleBuffer|epthSize)|PixelBuffer|VirtualScreenCount|FullScreen|Window|A(?:cc(?:umSize|elerated)|ux(?:Buffers|DepthStencil)|l(?:phaSize|lRenderers))))|StepUnicodeReservedBase)|rationNotSupportedForKeyS(?:criptError|pecifierError))|ffState|KButton|rPredicateType|bjC(?:B(?:itfield|oolType)|S(?:hortType|tr(?:ingType|uctType)|electorType)|NoType|CharType|ObjectType|DoubleType|UnionType|PointerType|VoidType|FloatType|Long(?:Type|longType)|ArrayType))|D(?:i(?:s(?:c(?:losureBezelStyle|reteCapacityLevelIndicatorStyle)|playWindowRunLoopOrdering)|acriticInsensitivePredicateOption|rect(?:Selection|PredicateModifier))|o(?:c(?:ModalWindowMask|ument(?:Directory|ationDirectory))|ubleType|wn(?:TextMovement|ArrowFunctionKey))|e(?:s(?:cendingPageOrder|ktopDirectory)|cimalTabStopType|v(?:ice(?:NColorSpaceModel|IndependentModifierFlagsMask)|eloper(?:Directory|ApplicationDirectory))|fault(?:ControlTint|TokenStyle)|lete(?:Char(?:acter|FunctionKey)|FunctionKey|LineFunctionKey)|moApplicationDirectory)|a(?:yCalendarUnit|teFormatter(?:MediumStyle|Behavior(?:10|Default)|ShortStyle|NoStyle|FullStyle|LongStyle))|ra(?:wer(?:Clos(?:ingState|edState)|Open(?:ingState|State))|gOperation(?:Generic|Move|None|Copy|Delete|Private|Every|Link|All)))|U(?:ser(?:CancelledError|D(?:irectory|omainMask)|FunctionKey)|RL(?:Handle(?:NotLoaded|Load(?:Succeeded|InProgress|Failed))|CredentialPersistence(?:None|Permanent|ForSession))|n(?:scaledWindowMask|cachedRead|i(?:codeStringEncoding|talicFontMask|fiedTitleAndToolbarWindowMask)|d(?:o(?:CloseGroupingRunLoopOrdering|FunctionKey)|e(?:finedDateComponent|rline(?:Style(?:Single|None|Thick|Double)|Pattern(?:Solid|D(?:ot|ash(?:Dot(?:Dot)?)?)))))|known(?:ColorSpaceModel|P(?:ointingDevice|ageOrder)|KeyS(?:criptError|pecifierError))|boldFontMask)|tilityWindowMask|TF8StringEncoding|p(?:dateWindowsRunLoopOrdering|TextMovement|ArrowFunctionKey))|J(?:ustifiedTextAlignment|PEG(?:2000FileType|FileType)|apaneseEUC(?:GlyphPacking|StringEncoding))|P(?:o(?:s(?:t(?:Now|erFontMask|WhenIdle|ASAP)|iti(?:on(?:Replace|Be(?:fore|ginning)|End|After)|ve(?:IntType|DoubleType|FloatType)))|pUp(?:NoArrow|ArrowAt(?:Bottom|Center))|werOffEventType|rtraitOrientation)|NGFileType|ush(?:InCell(?:Mask)?|OnPushOffButton)|e(?:n(?:TipMask|UpperSideMask|PointingDevice|LowerSideMask)|riodic(?:Mask)?)|P(?:S(?:caleField|tatus(?:Title|Field)|aveButton)|N(?:ote(?:Title|Field)|ame(?:Title|Field))|CopiesField|TitleField|ImageButton|OptionsButton|P(?:a(?:perFeedButton|ge(?:Range(?:To|From)|ChoiceMatrix))|reviewButton)|LayoutButton)|lainTextTokenStyle|a(?:useFunctionKey|ragraphSeparatorCharacter|ge(?:DownFunctionKey|UpFunctionKey))|r(?:int(?:ing(?:ReplyLater|Success|Cancelled|Failure)|ScreenFunctionKey|erTable(?:NotFound|OK|Error)|FunctionKey)|o(?:p(?:ertyList(?:XMLFormat|MutableContainers(?:AndLeaves)?|BinaryFormat|Immutable|OpenStepFormat)|rietaryStringEncoding)|gressIndicator(?:BarStyle|SpinningStyle|Preferred(?:SmallThickness|Thickness|LargeThickness|AquaThickness)))|e(?:ssedTab|vFunctionKey))|L(?:HeightForm|CancelButton|TitleField|ImageButton|O(?:KButton|rientationMatrix)|UnitsButton|PaperNameButton|WidthForm))|E(?:n(?:terCharacter|d(?:sWith(?:Comparison|PredicateOperatorType)|FunctionKey))|v(?:e(?:nOddWindingRule|rySubelement)|aluatedObjectExpressionType)|qualTo(?:Comparison|PredicateOperatorType)|ra(?:serPointingDevice|CalendarUnit|DatePickerElementFlag)|x(?:clude(?:10|QuickDrawElementsIconCreationOption)|pandedFontMask|ecuteFunctionKey))|V(?:i(?:ew(?:M(?:in(?:XMargin|YMargin)|ax(?:XMargin|YMargin))|HeightSizable|NotSizable|WidthSizable)|aPanelFontAction)|erticalRuler|a(?:lidationErrorM(?:inimum|aximum)|riableExpressionType))|Key(?:SpecifierEvaluationScriptError|Down(?:Mask)?|Up(?:Mask)?|PathExpressionType|Value(?:MinusSetMutation|SetSetMutation|Change(?:Re(?:placement|moval)|Setting|Insertion)|IntersectSetMutation|ObservingOption(?:New|Old)|UnionSetMutation|ValidationError))|QTMovie(?:NormalPlayback|Looping(?:BackAndForthPlayback|Playback))|F(?:1(?:1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|7FunctionKey|i(?:nd(?:PanelAction(?:Replace(?:A(?:ndFind|ll(?:InSelection)?))?|S(?:howFindPanel|e(?:tFindString|lectAll(?:InSelection)?))|Next|Previous)|FunctionKey)|tPagination|le(?:Read(?:No(?:SuchFileError|PermissionError)|CorruptFileError|In(?:validFileNameError|applicableStringEncodingError)|Un(?:supportedSchemeError|knownError))|HandlingPanel(?:CancelButton|OKButton)|NoSuchFileError|ErrorM(?:inimum|aximum)|Write(?:NoPermissionError|In(?:validFileNameError|applicableStringEncodingError)|OutOfSpaceError|Un(?:supportedSchemeError|knownError))|LockingError)|xedPitchFontMask)|2(?:1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|o(?:nt(?:Mo(?:noSpaceTrait|dernSerifsClass)|BoldTrait|S(?:ymbolicClass|criptsClass|labSerifsClass|ansSerifClass)|C(?:o(?:ndensedTrait|llectionApplicationOnlyMask)|larendonSerifsClass)|TransitionalSerifsClass|I(?:ntegerAdvancementsRenderingMode|talicTrait)|O(?:ldStyleSerifsClass|rnamentalsClass)|DefaultRenderingMode|U(?:nknownClass|IOptimizedTrait)|Panel(?:S(?:hadowEffectModeMask|t(?:andardModesMask|rikethroughEffectModeMask)|izeModeMask)|CollectionModeMask|TextColorEffectModeMask|DocumentColorEffectModeMask|UnderlineEffectModeMask|FaceModeMask|All(?:ModesMask|EffectsModeMask))|ExpandedTrait|VerticalTrait|F(?:amilyClassMask|reeformSerifsClass)|Antialiased(?:RenderingMode|IntegerAdvancementsRenderingMode))|cusRing(?:Below|Type(?:None|Default|Exterior)|Only|Above)|urByteGlyphPacking|rm(?:attingError(?:M(?:inimum|aximum))?|FeedCharacter))|8FunctionKey|unction(?:ExpressionType|KeyMask)|3(?:1FunctionKey|2FunctionKey|3FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey)|9FunctionKey|4FunctionKey|P(?:RevertButton|S(?:ize(?:Title|Field)|etButton)|CurrentField|Preview(?:Button|Field))|l(?:oat(?:ingPointSamplesBitmapFormat|Type)|agsChanged(?:Mask)?)|axButton|5FunctionKey|6FunctionKey)|W(?:heelModeColorPanel|indow(?:s(?:NTOperatingSystem|CP125(?:1StringEncoding|2StringEncoding|3StringEncoding|4StringEncoding|0StringEncoding)|95(?:InterfaceStyle|OperatingSystem))|M(?:iniaturizeButton|ovedEventType)|Below|CloseButton|ToolbarButton|ZoomButton|Out|DocumentIconButton|ExposedEventType|Above)|orkspaceLaunch(?:NewInstance|InhibitingBackgroundOnly|Default|PreferringClassic|WithoutA(?:ctivation|ddingToRecents)|A(?:sync|nd(?:Hide(?:Others)?|Print)|llowingClassicStartup))|eek(?:day(?:CalendarUnit|OrdinalCalendarUnit)|CalendarUnit)|a(?:ntsBidiLevels|rningAlertStyle)|r(?:itingDirection(?:RightToLeft|Natural|LeftToRight)|apCalendarComponents))|L(?:i(?:stModeMatrix|ne(?:Moves(?:Right|Down|Up|Left)|B(?:order|reakBy(?:C(?:harWrapping|lipping)|Truncating(?:Middle|Head|Tail)|WordWrapping))|S(?:eparatorCharacter|weep(?:Right|Down|Up|Left))|ToBezierPathElement|DoesntMove|arSlider)|teralSearch|kePredicateOperatorType|ghterFontAction|braryDirectory)|ocalDomainMask|e(?:ssThan(?:Comparison|OrEqualTo(?:Comparison|PredicateOperatorType)|PredicateOperatorType)|ft(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|T(?:ext(?:Movement|Alignment)|ab(?:sBezelBorder|StopType))|ArrowFunctionKey))|a(?:yout(?:RightToLeft|NotDone|CantFit|OutOfGlyphs|Done|LeftToRight)|ndscapeOrientation)|ABColorSpaceModel)|A(?:sc(?:iiWithDoubleByteEUCGlyphPacking|endingPageOrder)|n(?:y(?:Type|PredicateModifier|EventMask)|choredSearch|imation(?:Blocking|Nonblocking(?:Threaded)?|E(?:ffect(?:DisappearingItemDefault|Poof)|ase(?:In(?:Out)?|Out))|Linear)|dPredicateType)|t(?:Bottom|tachmentCharacter|omicWrite|Top)|SCIIStringEncoding|d(?:obe(?:GB1CharacterCollection|CNS1CharacterCollection|Japan(?:1CharacterCollection|2CharacterCollection)|Korea1CharacterCollection)|dTraitFontAction|minApplicationDirectory)|uto(?:saveOperation|Pagination)|pp(?:lication(?:SupportDirectory|D(?:irectory|e(?:fined(?:Mask)?|legateReply(?:Success|Cancel|Failure)|activatedEventType))|ActivatedEventType)|KitDefined(?:Mask)?)|l(?:ternateKeyMask|pha(?:ShiftKeyMask|NonpremultipliedBitmapFormat|FirstBitmapFormat)|ert(?:SecondButtonReturn|ThirdButtonReturn|OtherReturn|DefaultReturn|ErrorReturn|FirstButtonReturn|AlternateReturn)|l(?:ScrollerParts|DomainsMask|PredicateModifier|LibrariesDirectory|ApplicationsDirectory))|rgument(?:sWrongScriptError|EvaluationScriptError)|bove(?:Bottom|Top)|WTEventType)))(?:\\b)" + token: ["support.constant.cocoa"], + regex: "(?:\\b)(NS(?:R(?:GB(?:ModeColorPanel|ColorSpaceModel)|ight(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|T(?:ext(?:Movement|Alignment)|ab(?:sBezelBorder|StopType))|ArrowFunctionKey)|ound(?:RectBezelStyle|Bankers|ed(?:BezelStyle|TokenStyle|DisclosureBezelStyle)|Down|Up|Plain|Line(?:CapStyle|JoinStyle))|un(?:StoppedResponse|ContinuesResponse|AbortedResponse)|e(?:s(?:izableWindowMask|et(?:CursorRectsRunLoopOrdering|FunctionKey))|ce(?:ssedBezelStyle|iver(?:sCantHandleCommandScriptError|EvaluationScriptError))|turnTextMovement|doFunctionKey|quiredArgumentsMissingScriptError|l(?:evancyLevelIndicatorStyle|ative(?:Before|After))|gular(?:SquareBezelStyle|ControlSize)|moveTraitFontAction)|a(?:n(?:domSubelement|geDateMode)|tingLevelIndicatorStyle|dio(?:ModeMatrix|Button)))|G(?:IFFileType|lyph(?:Below|Inscribe(?:B(?:elow|ase)|Over(?:strike|Below)|Above)|Layout(?:WithPrevious|A(?:tAPoint|gainstAPoint))|A(?:ttribute(?:BidiLevel|Soft|Inscribe|Elastic)|bove))|r(?:ooveBorder|eaterThan(?:Comparison|OrEqualTo(?:Comparison|PredicateOperatorType)|PredicateOperatorType)|a(?:y(?:ModeColorPanel|ColorSpaceModel)|dient(?:None|Con(?:cave(?:Strong|Weak)|vex(?:Strong|Weak)))|phiteControlTint)))|XML(?:N(?:o(?:tationDeclarationKind|de(?:CompactEmptyElement|IsCDATA|OptionsNone|Use(?:SingleQuotes|DoubleQuotes)|Pre(?:serve(?:NamespaceOrder|C(?:haracterReferences|DATA)|DTD|Prefixes|E(?:ntities|mptyElements)|Quotes|Whitespace|A(?:ttributeOrder|ll))|ttyPrint)|ExpandEmptyElement))|amespaceKind)|CommentKind|TextKind|InvalidKind|D(?:ocument(?:X(?:MLKind|HTMLKind|Include)|HTMLKind|T(?:idy(?:XML|HTML)|extKind)|IncludeContentTypeDeclaration|Validate|Kind)|TDKind)|P(?:arser(?:GTRequiredError|XMLDeclNot(?:StartedError|FinishedError)|Mi(?:splaced(?:XMLDeclarationError|CDATAEndStringError)|xedContentDeclNot(?:StartedError|FinishedError))|S(?:t(?:andaloneValueError|ringNot(?:StartedError|ClosedError))|paceRequiredError|eparatorRequiredError)|N(?:MTOKENRequiredError|o(?:t(?:ationNot(?:StartedError|FinishedError)|WellBalancedError)|DTDError)|amespaceDeclarationError|AMERequiredError)|C(?:haracterRef(?:In(?:DTDError|PrologError|EpilogError)|AtEOFError)|o(?:nditionalSectionNot(?:StartedError|FinishedError)|mment(?:NotFinishedError|ContainsDoubleHyphenError))|DATANotFinishedError)|TagNameMismatchError|In(?:ternalError|valid(?:HexCharacterRefError|C(?:haracter(?:RefError|InEntityError|Error)|onditionalSectionError)|DecimalCharacterRefError|URIError|Encoding(?:NameError|Error)))|OutOfMemoryError|D(?:ocumentStartError|elegateAbortedParseError|OCTYPEDeclNotFinishedError)|U(?:RI(?:RequiredError|FragmentError)|n(?:declaredEntityError|parsedEntityError|knownEncodingError|finishedTagError))|P(?:CDATARequiredError|ublicIdentifierRequiredError|arsedEntityRef(?:MissingSemiError|NoNameError|In(?:Internal(?:SubsetError|Error)|PrologError|EpilogError)|AtEOFError)|r(?:ocessingInstructionNot(?:StartedError|FinishedError)|ematureDocumentEndError))|E(?:n(?:codingNotSupportedError|tity(?:Ref(?:In(?:DTDError|PrologError|EpilogError)|erence(?:MissingSemiError|WithoutNameError)|LoopError|AtEOFError)|BoundaryError|Not(?:StartedError|FinishedError)|Is(?:ParameterError|ExternalError)|ValueRequiredError))|qualExpectedError|lementContentDeclNot(?:StartedError|FinishedError)|xt(?:ernalS(?:tandaloneEntityError|ubsetNotFinishedError)|raContentError)|mptyDocumentError)|L(?:iteralNot(?:StartedError|FinishedError)|T(?:RequiredError|SlashRequiredError)|essThanSymbolInAttributeError)|Attribute(?:RedefinedError|HasNoValueError|Not(?:StartedError|FinishedError)|ListNot(?:StartedError|FinishedError)))|rocessingInstructionKind)|E(?:ntity(?:GeneralKind|DeclarationKind|UnparsedKind|P(?:ar(?:sedKind|ameterKind)|redefined))|lement(?:Declaration(?:MixedKind|UndefinedKind|E(?:lementKind|mptyKind)|Kind|AnyKind)|Kind))|Attribute(?:N(?:MToken(?:sKind|Kind)|otationKind)|CDATAKind|ID(?:Ref(?:sKind|Kind)|Kind)|DeclarationKind|En(?:tit(?:yKind|iesKind)|umerationKind)|Kind))|M(?:i(?:n(?:XEdge|iaturizableWindowMask|YEdge|uteCalendarUnit)|terLineJoinStyle|ddleSubelement|xedState)|o(?:nthCalendarUnit|deSwitchFunctionKey|use(?:Moved(?:Mask)?|E(?:ntered(?:Mask)?|ventSubtype|xited(?:Mask)?))|veToBezierPathElement|mentary(?:ChangeButton|Push(?:Button|InButton)|Light(?:Button)?))|enuFunctionKey|a(?:c(?:intoshInterfaceStyle|OSRomanStringEncoding)|tchesPredicateOperatorType|ppedRead|x(?:XEdge|YEdge))|ACHOperatingSystem)|B(?:MPFileType|o(?:ttomTabsBezelBorder|ldFontMask|rderlessWindowMask|x(?:Se(?:condary|parator)|OldStyle|Primary))|uttLineCapStyle|e(?:zelBorder|velLineJoinStyle|low(?:Bottom|Top)|gin(?:sWith(?:Comparison|PredicateOperatorType)|FunctionKey))|lueControlTint|ack(?:spaceCharacter|tabTextMovement|ingStore(?:Retained|Buffered|Nonretained)|TabCharacter|wardsSearch|groundTab)|r(?:owser(?:NoColumnResizing|UserColumnResizing|AutoColumnResizing)|eakFunctionKey))|S(?:h(?:ift(?:JISStringEncoding|KeyMask)|ow(?:ControlGlyphs|InvisibleGlyphs)|adowlessSquareBezelStyle)|y(?:s(?:ReqFunctionKey|tem(?:D(?:omainMask|efined(?:Mask)?)|FunctionKey))|mbolStringEncoding)|c(?:a(?:nnedOption|le(?:None|ToFit|Proportionally))|r(?:oll(?:er(?:NoPart|Increment(?:Page|Line|Arrow)|Decrement(?:Page|Line|Arrow)|Knob(?:Slot)?|Arrows(?:M(?:inEnd|axEnd)|None|DefaultSetting))|Wheel(?:Mask)?|LockFunctionKey)|eenChangedEventType))|t(?:opFunctionKey|r(?:ingDrawing(?:OneShot|DisableScreenFontSubstitution|Uses(?:DeviceMetrics|FontLeading|LineFragmentOrigin))|eam(?:Status(?:Reading|NotOpen|Closed|Open(?:ing)?|Error|Writing|AtEnd)|Event(?:Has(?:BytesAvailable|SpaceAvailable)|None|OpenCompleted|E(?:ndEncountered|rrorOccurred)))))|i(?:ngle(?:DateMode|UnderlineStyle)|ze(?:DownFontAction|UpFontAction))|olarisOperatingSystem|unOSOperatingSystem|pecialPageOrder|e(?:condCalendarUnit|lect(?:By(?:Character|Paragraph|Word)|i(?:ng(?:Next|Previous)|onAffinity(?:Downstream|Upstream))|edTab|FunctionKey)|gmentSwitchTracking(?:Momentary|Select(?:One|Any)))|quareLineCapStyle|witchButton|ave(?:ToOperation|Op(?:tions(?:Yes|No|Ask)|eration)|AsOperation)|mall(?:SquareBezelStyle|C(?:ontrolSize|apsFontMask)|IconButtonBezelStyle))|H(?:ighlightModeMatrix|SBModeColorPanel|o(?:ur(?:Minute(?:SecondDatePickerElementFlag|DatePickerElementFlag)|CalendarUnit)|rizontalRuler|meFunctionKey)|TTPCookieAcceptPolicy(?:Never|OnlyFromMainDocumentDomain|Always)|e(?:lp(?:ButtonBezelStyle|KeyMask|FunctionKey)|avierFontAction)|PUXOperatingSystem)|Year(?:MonthDa(?:yDatePickerElementFlag|tePickerElementFlag)|CalendarUnit)|N(?:o(?:n(?:StandardCharacterSetFontMask|ZeroWindingRule|activatingPanelMask|LossyASCIIStringEncoding)|Border|t(?:ification(?:SuspensionBehavior(?:Hold|Coalesce|D(?:eliverImmediately|rop))|NoCoalescing|CoalescingOn(?:Sender|Name)|DeliverImmediately|PostToAllSessions)|PredicateType|EqualToPredicateOperatorType)|S(?:cr(?:iptError|ollerParts)|ubelement|pecifierError)|CellMask|T(?:itle|opLevelContainersSpecifierError|abs(?:BezelBorder|NoBorder|LineBorder))|I(?:nterfaceStyle|mage)|UnderlineStyle|FontChangeAction)|u(?:ll(?:Glyph|CellType)|m(?:eric(?:Search|PadKeyMask)|berFormatter(?:Round(?:Half(?:Down|Up|Even)|Ceiling|Down|Up|Floor)|Behavior(?:10|Default)|S(?:cientificStyle|pellOutStyle)|NoStyle|CurrencyStyle|DecimalStyle|P(?:ercentStyle|ad(?:Before(?:Suffix|Prefix)|After(?:Suffix|Prefix))))))|e(?:t(?:Services(?:BadArgumentError|NotFoundError|C(?:ollisionError|ancelledError)|TimeoutError|InvalidError|UnknownError|ActivityInProgress)|workDomainMask)|wlineCharacter|xt(?:StepInterfaceStyle|FunctionKey))|EXTSTEPStringEncoding|a(?:t(?:iveShortGlyphPacking|uralTextAlignment)|rrowFontMask))|C(?:hange(?:ReadOtherContents|GrayCell(?:Mask)?|BackgroundCell(?:Mask)?|Cleared|Done|Undone|Autosaved)|MYK(?:ModeColorPanel|ColorSpaceModel)|ircular(?:BezelStyle|Slider)|o(?:n(?:stantValueExpressionType|t(?:inuousCapacityLevelIndicatorStyle|entsCellMask|ain(?:sComparison|erSpecifierError)|rol(?:Glyph|KeyMask))|densedFontMask)|lor(?:Panel(?:RGBModeMask|GrayModeMask|HSBModeMask|C(?:MYKModeMask|olorListModeMask|ustomPaletteModeMask|rayonModeMask)|WheelModeMask|AllModesMask)|ListModeColorPanel)|reServiceDirectory|m(?:p(?:osite(?:XOR|Source(?:In|O(?:ut|ver)|Atop)|Highlight|C(?:opy|lear)|Destination(?:In|O(?:ut|ver)|Atop)|Plus(?:Darker|Lighter))|ressedFontMask)|mandKeyMask))|u(?:stom(?:SelectorPredicateOperatorType|PaletteModeColorPanel)|r(?:sor(?:Update(?:Mask)?|PointingDevice)|veToBezierPathElement))|e(?:nterT(?:extAlignment|abStopType)|ll(?:State|H(?:ighlighted|as(?:Image(?:Horizontal|OnLeftOrBottom)|OverlappingImage))|ChangesContents|Is(?:Bordered|InsetButton)|Disabled|Editable|LightsBy(?:Gray|Background|Contents)|AllowsMixedState))|l(?:ipPagination|o(?:s(?:ePathBezierPathElement|ableWindowMask)|ckAndCalendarDatePickerStyle)|ear(?:ControlTint|DisplayFunctionKey|LineFunctionKey))|a(?:seInsensitive(?:Search|PredicateOption)|n(?:notCreateScriptCommandError|cel(?:Button|TextMovement))|chesDirectory|lculation(?:NoError|Overflow|DivideByZero|Underflow|LossOfPrecision)|rriageReturnCharacter)|r(?:itical(?:Request|AlertStyle)|ayonModeColorPanel))|T(?:hick(?:SquareBezelStyle|erSquareBezelStyle)|ypesetter(?:Behavior|HorizontalTabAction|ContainerBreakAction|ZeroAdvancementAction|OriginalBehavior|ParagraphBreakAction|WhitespaceAction|L(?:ineBreakAction|atestBehavior))|i(?:ckMark(?:Right|Below|Left|Above)|tledWindowMask|meZoneDatePickerElementFlag)|o(?:olbarItemVisibilityPriority(?:Standard|High|User|Low)|pTabsBezelBorder|ggleButton)|IFF(?:Compression(?:N(?:one|EXT)|CCITTFAX(?:3|4)|OldJPEG|JPEG|PackBits|LZW)|FileType)|e(?:rminate(?:Now|Cancel|Later)|xt(?:Read(?:InapplicableDocumentTypeError|WriteErrorM(?:inimum|aximum))|Block(?:M(?:i(?:nimum(?:Height|Width)|ddleAlignment)|a(?:rgin|ximum(?:Height|Width)))|B(?:o(?:ttomAlignment|rder)|aselineAlignment)|Height|TopAlignment|P(?:ercentageValueType|adding)|Width|AbsoluteValueType)|StorageEdited(?:Characters|Attributes)|CellType|ured(?:RoundedBezelStyle|BackgroundWindowMask|SquareBezelStyle)|Table(?:FixedLayoutAlgorithm|AutomaticLayoutAlgorithm)|Field(?:RoundedBezel|SquareBezel|AndStepperDatePickerStyle)|WriteInapplicableDocumentTypeError|ListPrependEnclosingMarker))|woByteGlyphPacking|ab(?:Character|TextMovement|le(?:tP(?:oint(?:Mask|EventSubtype)?|roximity(?:Mask|EventSubtype)?)|Column(?:NoResizing|UserResizingMask|AutoresizingMask)|View(?:ReverseSequentialColumnAutoresizingStyle|GridNone|S(?:olid(?:HorizontalGridLineMask|VerticalGridLineMask)|equentialColumnAutoresizingStyle)|NoColumnAutoresizing|UniformColumnAutoresizingStyle|FirstColumnOnlyAutoresizingStyle|LastColumnOnlyAutoresizingStyle)))|rackModeMatrix)|I(?:n(?:sert(?:CharFunctionKey|FunctionKey|LineFunctionKey)|t(?:Type|ernalS(?:criptError|pecifierError))|dexSubelement|validIndexSpecifierError|formational(?:Request|AlertStyle)|PredicateOperatorType)|talicFontMask|SO(?:2022JPStringEncoding|Latin(?:1StringEncoding|2StringEncoding))|dentityMappingCharacterCollection|llegalTextMovement|mage(?:R(?:ight|ep(?:MatchesDevice|LoadStatus(?:ReadingHeader|Completed|InvalidData|Un(?:expectedEOF|knownType)|WillNeedAllData)))|Below|C(?:ellType|ache(?:BySize|Never|Default|Always))|Interpolation(?:High|None|Default|Low)|O(?:nly|verlaps)|Frame(?:Gr(?:oove|ayBezel)|Button|None|Photo)|L(?:oadStatus(?:ReadError|C(?:ompleted|ancelled)|InvalidData|UnexpectedEOF)|eft)|A(?:lign(?:Right|Bottom(?:Right|Left)?|Center|Top(?:Right|Left)?|Left)|bove)))|O(?:n(?:State|eByteGlyphPacking|OffButton|lyScrollerArrows)|ther(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|TextMovement)|SF1OperatingSystem|pe(?:n(?:GL(?:GO(?:Re(?:setLibrary|tainRenderers)|ClearFormatCache|FormatCacheSize)|PFA(?:R(?:obust|endererID)|M(?:inimumPolicy|ulti(?:sample|Screen)|PSafe|aximumPolicy)|BackingStore|S(?:creenMask|te(?:ncilSize|reo)|ingleRenderer|upersample|ample(?:s|Buffers|Alpha))|NoRecovery|C(?:o(?:lor(?:Size|Float)|mpliant)|losestPolicy)|OffScreen|D(?:oubleBuffer|epthSize)|PixelBuffer|VirtualScreenCount|FullScreen|Window|A(?:cc(?:umSize|elerated)|ux(?:Buffers|DepthStencil)|l(?:phaSize|lRenderers))))|StepUnicodeReservedBase)|rationNotSupportedForKeyS(?:criptError|pecifierError))|ffState|KButton|rPredicateType|bjC(?:B(?:itfield|oolType)|S(?:hortType|tr(?:ingType|uctType)|electorType)|NoType|CharType|ObjectType|DoubleType|UnionType|PointerType|VoidType|FloatType|Long(?:Type|longType)|ArrayType))|D(?:i(?:s(?:c(?:losureBezelStyle|reteCapacityLevelIndicatorStyle)|playWindowRunLoopOrdering)|acriticInsensitivePredicateOption|rect(?:Selection|PredicateModifier))|o(?:c(?:ModalWindowMask|ument(?:Directory|ationDirectory))|ubleType|wn(?:TextMovement|ArrowFunctionKey))|e(?:s(?:cendingPageOrder|ktopDirectory)|cimalTabStopType|v(?:ice(?:NColorSpaceModel|IndependentModifierFlagsMask)|eloper(?:Directory|ApplicationDirectory))|fault(?:ControlTint|TokenStyle)|lete(?:Char(?:acter|FunctionKey)|FunctionKey|LineFunctionKey)|moApplicationDirectory)|a(?:yCalendarUnit|teFormatter(?:MediumStyle|Behavior(?:10|Default)|ShortStyle|NoStyle|FullStyle|LongStyle))|ra(?:wer(?:Clos(?:ingState|edState)|Open(?:ingState|State))|gOperation(?:Generic|Move|None|Copy|Delete|Private|Every|Link|All)))|U(?:ser(?:CancelledError|D(?:irectory|omainMask)|FunctionKey)|RL(?:Handle(?:NotLoaded|Load(?:Succeeded|InProgress|Failed))|CredentialPersistence(?:None|Permanent|ForSession))|n(?:scaledWindowMask|cachedRead|i(?:codeStringEncoding|talicFontMask|fiedTitleAndToolbarWindowMask)|d(?:o(?:CloseGroupingRunLoopOrdering|FunctionKey)|e(?:finedDateComponent|rline(?:Style(?:Single|None|Thick|Double)|Pattern(?:Solid|D(?:ot|ash(?:Dot(?:Dot)?)?)))))|known(?:ColorSpaceModel|P(?:ointingDevice|ageOrder)|KeyS(?:criptError|pecifierError))|boldFontMask)|tilityWindowMask|TF8StringEncoding|p(?:dateWindowsRunLoopOrdering|TextMovement|ArrowFunctionKey))|J(?:ustifiedTextAlignment|PEG(?:2000FileType|FileType)|apaneseEUC(?:GlyphPacking|StringEncoding))|P(?:o(?:s(?:t(?:Now|erFontMask|WhenIdle|ASAP)|iti(?:on(?:Replace|Be(?:fore|ginning)|End|After)|ve(?:IntType|DoubleType|FloatType)))|pUp(?:NoArrow|ArrowAt(?:Bottom|Center))|werOffEventType|rtraitOrientation)|NGFileType|ush(?:InCell(?:Mask)?|OnPushOffButton)|e(?:n(?:TipMask|UpperSideMask|PointingDevice|LowerSideMask)|riodic(?:Mask)?)|P(?:S(?:caleField|tatus(?:Title|Field)|aveButton)|N(?:ote(?:Title|Field)|ame(?:Title|Field))|CopiesField|TitleField|ImageButton|OptionsButton|P(?:a(?:perFeedButton|ge(?:Range(?:To|From)|ChoiceMatrix))|reviewButton)|LayoutButton)|lainTextTokenStyle|a(?:useFunctionKey|ragraphSeparatorCharacter|ge(?:DownFunctionKey|UpFunctionKey))|r(?:int(?:ing(?:ReplyLater|Success|Cancelled|Failure)|ScreenFunctionKey|erTable(?:NotFound|OK|Error)|FunctionKey)|o(?:p(?:ertyList(?:XMLFormat|MutableContainers(?:AndLeaves)?|BinaryFormat|Immutable|OpenStepFormat)|rietaryStringEncoding)|gressIndicator(?:BarStyle|SpinningStyle|Preferred(?:SmallThickness|Thickness|LargeThickness|AquaThickness)))|e(?:ssedTab|vFunctionKey))|L(?:HeightForm|CancelButton|TitleField|ImageButton|O(?:KButton|rientationMatrix)|UnitsButton|PaperNameButton|WidthForm))|E(?:n(?:terCharacter|d(?:sWith(?:Comparison|PredicateOperatorType)|FunctionKey))|v(?:e(?:nOddWindingRule|rySubelement)|aluatedObjectExpressionType)|qualTo(?:Comparison|PredicateOperatorType)|ra(?:serPointingDevice|CalendarUnit|DatePickerElementFlag)|x(?:clude(?:10|QuickDrawElementsIconCreationOption)|pandedFontMask|ecuteFunctionKey))|V(?:i(?:ew(?:M(?:in(?:XMargin|YMargin)|ax(?:XMargin|YMargin))|HeightSizable|NotSizable|WidthSizable)|aPanelFontAction)|erticalRuler|a(?:lidationErrorM(?:inimum|aximum)|riableExpressionType))|Key(?:SpecifierEvaluationScriptError|Down(?:Mask)?|Up(?:Mask)?|PathExpressionType|Value(?:MinusSetMutation|SetSetMutation|Change(?:Re(?:placement|moval)|Setting|Insertion)|IntersectSetMutation|ObservingOption(?:New|Old)|UnionSetMutation|ValidationError))|QTMovie(?:NormalPlayback|Looping(?:BackAndForthPlayback|Playback))|F(?:1(?:1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|7FunctionKey|i(?:nd(?:PanelAction(?:Replace(?:A(?:ndFind|ll(?:InSelection)?))?|S(?:howFindPanel|e(?:tFindString|lectAll(?:InSelection)?))|Next|Previous)|FunctionKey)|tPagination|le(?:Read(?:No(?:SuchFileError|PermissionError)|CorruptFileError|In(?:validFileNameError|applicableStringEncodingError)|Un(?:supportedSchemeError|knownError))|HandlingPanel(?:CancelButton|OKButton)|NoSuchFileError|ErrorM(?:inimum|aximum)|Write(?:NoPermissionError|In(?:validFileNameError|applicableStringEncodingError)|OutOfSpaceError|Un(?:supportedSchemeError|knownError))|LockingError)|xedPitchFontMask)|2(?:1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|o(?:nt(?:Mo(?:noSpaceTrait|dernSerifsClass)|BoldTrait|S(?:ymbolicClass|criptsClass|labSerifsClass|ansSerifClass)|C(?:o(?:ndensedTrait|llectionApplicationOnlyMask)|larendonSerifsClass)|TransitionalSerifsClass|I(?:ntegerAdvancementsRenderingMode|talicTrait)|O(?:ldStyleSerifsClass|rnamentalsClass)|DefaultRenderingMode|U(?:nknownClass|IOptimizedTrait)|Panel(?:S(?:hadowEffectModeMask|t(?:andardModesMask|rikethroughEffectModeMask)|izeModeMask)|CollectionModeMask|TextColorEffectModeMask|DocumentColorEffectModeMask|UnderlineEffectModeMask|FaceModeMask|All(?:ModesMask|EffectsModeMask))|ExpandedTrait|VerticalTrait|F(?:amilyClassMask|reeformSerifsClass)|Antialiased(?:RenderingMode|IntegerAdvancementsRenderingMode))|cusRing(?:Below|Type(?:None|Default|Exterior)|Only|Above)|urByteGlyphPacking|rm(?:attingError(?:M(?:inimum|aximum))?|FeedCharacter))|8FunctionKey|unction(?:ExpressionType|KeyMask)|3(?:1FunctionKey|2FunctionKey|3FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey)|9FunctionKey|4FunctionKey|P(?:RevertButton|S(?:ize(?:Title|Field)|etButton)|CurrentField|Preview(?:Button|Field))|l(?:oat(?:ingPointSamplesBitmapFormat|Type)|agsChanged(?:Mask)?)|axButton|5FunctionKey|6FunctionKey)|W(?:heelModeColorPanel|indow(?:s(?:NTOperatingSystem|CP125(?:1StringEncoding|2StringEncoding|3StringEncoding|4StringEncoding|0StringEncoding)|95(?:InterfaceStyle|OperatingSystem))|M(?:iniaturizeButton|ovedEventType)|Below|CloseButton|ToolbarButton|ZoomButton|Out|DocumentIconButton|ExposedEventType|Above)|orkspaceLaunch(?:NewInstance|InhibitingBackgroundOnly|Default|PreferringClassic|WithoutA(?:ctivation|ddingToRecents)|A(?:sync|nd(?:Hide(?:Others)?|Print)|llowingClassicStartup))|eek(?:day(?:CalendarUnit|OrdinalCalendarUnit)|CalendarUnit)|a(?:ntsBidiLevels|rningAlertStyle)|r(?:itingDirection(?:RightToLeft|Natural|LeftToRight)|apCalendarComponents))|L(?:i(?:stModeMatrix|ne(?:Moves(?:Right|Down|Up|Left)|B(?:order|reakBy(?:C(?:harWrapping|lipping)|Truncating(?:Middle|Head|Tail)|WordWrapping))|S(?:eparatorCharacter|weep(?:Right|Down|Up|Left))|ToBezierPathElement|DoesntMove|arSlider)|teralSearch|kePredicateOperatorType|ghterFontAction|braryDirectory)|ocalDomainMask|e(?:ssThan(?:Comparison|OrEqualTo(?:Comparison|PredicateOperatorType)|PredicateOperatorType)|ft(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|T(?:ext(?:Movement|Alignment)|ab(?:sBezelBorder|StopType))|ArrowFunctionKey))|a(?:yout(?:RightToLeft|NotDone|CantFit|OutOfGlyphs|Done|LeftToRight)|ndscapeOrientation)|ABColorSpaceModel)|A(?:sc(?:iiWithDoubleByteEUCGlyphPacking|endingPageOrder)|n(?:y(?:Type|PredicateModifier|EventMask)|choredSearch|imation(?:Blocking|Nonblocking(?:Threaded)?|E(?:ffect(?:DisappearingItemDefault|Poof)|ase(?:In(?:Out)?|Out))|Linear)|dPredicateType)|t(?:Bottom|tachmentCharacter|omicWrite|Top)|SCIIStringEncoding|d(?:obe(?:GB1CharacterCollection|CNS1CharacterCollection|Japan(?:1CharacterCollection|2CharacterCollection)|Korea1CharacterCollection)|dTraitFontAction|minApplicationDirectory)|uto(?:saveOperation|Pagination)|pp(?:lication(?:SupportDirectory|D(?:irectory|e(?:fined(?:Mask)?|legateReply(?:Success|Cancel|Failure)|activatedEventType))|ActivatedEventType)|KitDefined(?:Mask)?)|l(?:ternateKeyMask|pha(?:ShiftKeyMask|NonpremultipliedBitmapFormat|FirstBitmapFormat)|ert(?:SecondButtonReturn|ThirdButtonReturn|OtherReturn|DefaultReturn|ErrorReturn|FirstButtonReturn|AlternateReturn)|l(?:ScrollerParts|DomainsMask|PredicateModifier|LibrariesDirectory|ApplicationsDirectory))|rgument(?:sWrongScriptError|EvaluationScriptError)|bove(?:Bottom|Top)|WTEventType)))(?:\\b)" }, { - "token": "support.function.C99.c", - "regex": C_Highlight_File.cFunctions + token: "support.function.C99.c", + regex: C_Highlight_File.cFunctions }, { - "token" : cObj.getKeywords(), - "regex" : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + token : cObj.getKeywords(), + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { - "token": "punctuation.section.scope.begin.objc", - "regex": "\\[", - "next": "bracketed_content" + token: "punctuation.section.scope.begin.objc", + regex: "\\[", + next: "bracketed_content" }, { - "token": "meta.function.objc", - "regex": "^(?:-|\\+)\\s*" + token: "meta.function.objc", + regex: "^(?:-|\\+)\\s*" } ], "constant_NSString": [ { - "token": "constant.character.escape.objc", - "regex": escapedConstRe + token: "constant.character.escape.objc", + regex: escapedConstRe }, { - "token": "invalid.illegal.unknown-escape.objc", - "regex": "\\\\." + token: "invalid.illegal.unknown-escape.objc", + regex: "\\\\." }, { - "token": "string", - "regex": '[^"\\\\]+' + token: "string", + regex: '[^"\\\\]+' }, { - "token": "punctuation.definition.string.end", - "regex": "\"", - "next": "start" + token: "punctuation.definition.string.end", + regex: "\"", + next: "start" } ], "protocol_list": [ { - "token": "punctuation.section.scope.end.objc", - "regex": ">", - "next": "start" + token: "punctuation.section.scope.end.objc", + regex: ">", + next: "start" }, { - "token": "support.other.protocol.objc", - "regex": "\bNS(?:GlyphStorage|M(?:utableCopying|enuItem)|C(?:hangeSpelling|o(?:ding|pying|lorPicking(?:Custom|Default)))|T(?:oolbarItemValidations|ext(?:Input|AttachmentCell))|I(?:nputServ(?:iceProvider|erMouseTracker)|gnoreMisspelledWords)|Obj(?:CTypeSerializationCallBack|ect)|D(?:ecimalNumberBehaviors|raggingInfo)|U(?:serInterfaceValidations|RL(?:HandleClient|DownloadDelegate|ProtocolClient|AuthenticationChallengeSender))|Validated(?:ToobarItem|UserInterfaceItem)|Locking)\b" + token: "support.other.protocol.objc", + regex: "\bNS(?:GlyphStorage|M(?:utableCopying|enuItem)|C(?:hangeSpelling|o(?:ding|pying|lorPicking(?:Custom|Default)))|T(?:oolbarItemValidations|ext(?:Input|AttachmentCell))|I(?:nputServ(?:iceProvider|erMouseTracker)|gnoreMisspelledWords)|Obj(?:CTypeSerializationCallBack|ect)|D(?:ecimalNumberBehaviors|raggingInfo)|U(?:serInterfaceValidations|RL(?:HandleClient|DownloadDelegate|ProtocolClient|AuthenticationChallengeSender))|Validated(?:ToobarItem|UserInterfaceItem)|Locking)\b" } ], "selectors": [ { - "token": "support.function.any-method.name-of-parameter.objc", - "regex": "\\b(?:[a-zA-Z_:][\\w]*)+" + token: "support.function.any-method.name-of-parameter.objc", + regex: "\\b(?:[a-zA-Z_:][\\w]*)+" }, { - "token": "punctuation", - "regex": "\\)", - "next": "start" + token: "punctuation", + regex: "\\)", + next: "start" } ], "bracketed_content": [ { - "token": "punctuation.section.scope.end.objc", - "regex": "\]", - "next": "start" + token: "punctuation.section.scope.end.objc", + regex: "\]", + next: "start" }, { - "token": ["support.function.any-method.objc"], - "regex": "(?:predicateWithFormat:| NSPredicate predicateWithFormat:)", - "next": "start" + token: ["support.function.any-method.objc"], + regex: "(?:predicateWithFormat:| NSPredicate predicateWithFormat:)", + next: "start" }, { - "token": "support.function.any-method.objc", - "regex": "\\w+(?::|(?=\]))", - "next": "start" + token: "support.function.any-method.objc", + regex: "\\w+(?::|(?=\]))", + next: "start" } ], "bracketed_strings": [ { - "token": "punctuation.section.scope.end.objc", - "regex": "\]", - "next": "start" + token: "punctuation.section.scope.end.objc", + regex: "\]", + next: "start" }, { - "token": "keyword.operator.logical.predicate.cocoa", - "regex": "\\b(?:AND|OR|NOT|IN)\\b" + token: "keyword.operator.logical.predicate.cocoa", + regex: "\\b(?:AND|OR|NOT|IN)\\b" }, { - "token": ["invalid.illegal.unknown-method.objc", "punctuation.separator.arguments.objc"], - "regex": "\\b(\w+)(:)" + token: ["invalid.illegal.unknown-method.objc", "punctuation.separator.arguments.objc"], + regex: "\\b(\w+)(:)" }, { - "regex": "\\b(?:ALL|ANY|SOME|NONE)\\b", - "token": "constant.language.predicate.cocoa" + regex: "\\b(?:ALL|ANY|SOME|NONE)\\b", + token: "constant.language.predicate.cocoa" }, { - "regex": "\\b(?:NULL|NIL|SELF|TRUE|YES|FALSE|NO|FIRST|LAST|SIZE)\\b", - "token": "constant.language.predicate.cocoa" + regex: "\\b(?:NULL|NIL|SELF|TRUE|YES|FALSE|NO|FIRST|LAST|SIZE)\\b", + token: "constant.language.predicate.cocoa" }, { - "regex": "\\b(?:MATCHES|CONTAINS|BEGINSWITH|ENDSWITH|BETWEEN)\\b", - "token": "keyword.operator.comparison.predicate.cocoa" + regex: "\\b(?:MATCHES|CONTAINS|BEGINSWITH|ENDSWITH|BETWEEN)\\b", + token: "keyword.operator.comparison.predicate.cocoa" }, { - "regex": "\\bC(?:ASEINSENSITIVE|I)\\b", - "token": "keyword.other.modifier.predicate.cocoa" + regex: "\\bC(?:ASEINSENSITIVE|I)\\b", + token: "keyword.other.modifier.predicate.cocoa" }, { - "regex": "\\b(?:ANYKEY|SUBQUERY|CAST|TRUEPREDICATE|FALSEPREDICATE)\\b", - "token": "keyword.other.predicate.cocoa" + regex: "\\b(?:ANYKEY|SUBQUERY|CAST|TRUEPREDICATE|FALSEPREDICATE)\\b", + token: "keyword.other.predicate.cocoa" }, { - "regex": escapedConstRe, - "token": "constant.character.escape.objc" + regex: escapedConstRe, + token: "constant.character.escape.objc" }, { - "regex": "\\\\.", - "token": "invalid.illegal.unknown-escape.objc" + regex: "\\\\.", + token: "invalid.illegal.unknown-escape.objc" }, { - "token": "string", - "regex": '[^"\\\\]' + token: "string", + regex: '[^"\\\\]' }, { - "token": "punctuation.definition.string.end.objc", - "regex": "\"", - "next": "predicates" + token: "punctuation.definition.string.end.objc", + regex: "\"", + next: "predicates" } ], "comment" : [ diff --git a/lib/ace/mode/ruby_highlight_rules.js b/lib/ace/mode/ruby_highlight_rules.js index fa0c9546..27053507 100644 --- a/lib/ace/mode/ruby_highlight_rules.js +++ b/lib/ace/mode/ruby_highlight_rules.js @@ -190,7 +190,7 @@ var RubyHighlightRules = function() { return "string"; }, regex: ".*$", - "next": "start" + next: "start" }], indentedHeredoc: [{ token: "string", @@ -205,7 +205,7 @@ var RubyHighlightRules = function() { return "string"; }, regex: ".*$", - "next": "start" + next: "start" }] } }, { diff --git a/lib/ace/mode/stylus_highlight_rules.js b/lib/ace/mode/stylus_highlight_rules.js index d583a85b..c9fb6247 100644 --- a/lib/ace/mode/stylus_highlight_rules.js +++ b/lib/ace/mode/stylus_highlight_rules.js @@ -22,7 +22,7 @@ var StylusHighlightRules = function() { }, "text", true); this.$rules = { - "start": [ + start: [ { token : "comment", regex : /\/\/.*$/ @@ -33,24 +33,24 @@ var StylusHighlightRules = function() { next : "comment" }, { - "token": ["entity.name.function.stylus", "text"], - "regex": "^([-a-zA-Z_][-\\w]*)?(\\()" + token: ["entity.name.function.stylus", "text"], + regex: "^([-a-zA-Z_][-\\w]*)?(\\()" }, { - "token": ["entity.other.attribute-name.class.stylus"], - "regex": "\\.-?[_a-zA-Z]+[_a-zA-Z0-9-]*" + token: ["entity.other.attribute-name.class.stylus"], + regex: "\\.-?[_a-zA-Z]+[_a-zA-Z0-9-]*" }, { - "token": ["entity.language.stylus"], - "regex": "^ *&" + token: ["entity.language.stylus"], + regex: "^ *&" }, { - "token": ["variable.language.stylus"], - "regex": "(arguments)" + token: ["variable.language.stylus"], + regex: "(arguments)" }, { - "token": ["keyword.stylus"], - "regex": "@[-\\w]+" + token: ["keyword.stylus"], + regex: "@[-\\w]+" }, { token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], @@ -60,8 +60,8 @@ var StylusHighlightRules = function() { regex : CssHighlightRules.pseudoClasses }, { - "token": ["entity.name.tag.stylus"], - "regex": "(?:\\b)(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|(?:h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)(?:\\b)" + token: ["entity.name.tag.stylus"], + regex: "(?:\\b)(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|(?:h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)(?:\\b)" }, { token : "constant.numeric", // hex6 color @@ -72,24 +72,24 @@ var StylusHighlightRules = function() { regex : "#[a-f0-9]{3}" }, { - "token": ["punctuation.definition.entity.stylus", "entity.other.attribute-name.id.stylus"], - "regex": "(#)([a-zA-Z][a-zA-Z0-9_-]*)" + token: ["punctuation.definition.entity.stylus", "entity.other.attribute-name.id.stylus"], + regex: "(#)([a-zA-Z][a-zA-Z0-9_-]*)" }, { - "token": "meta.vendor-prefix.stylus", - "regex": "-webkit-|-moz\\-|-ms-|-o-" + token: "meta.vendor-prefix.stylus", + regex: "-webkit-|-moz\\-|-ms-|-o-" }, { - "token": "keyword.control.stylus", - "regex": "(?:!important|for|in|return|true|false|null|if|else|unless|return)\\b" + token: "keyword.control.stylus", + regex: "(?:!important|for|in|return|true|false|null|if|else|unless|return)\\b" }, { - "token": "keyword.operator.stylus", - "regex": "!|~|\\+|-|(?:\\*)?\\*|\\/|%|(?:\\.)\\.\\.|<|>|(?:=|:|\\?|\\+|-|\\*|\\/|%|<|>)?=|!=" + token: "keyword.operator.stylus", + regex: "!|~|\\+|-|(?:\\*)?\\*|\\/|%|(?:\\.)\\.\\.|<|>|(?:=|:|\\?|\\+|-|\\*|\\/|%|<|>)?=|!=" }, { - "token": "keyword.operator.stylus", - "regex": "(?:in|is(?:nt)?|not)\\b" + token: "keyword.operator.stylus", + regex: "(?:in|is(?:nt)?|not)\\b" }, { token : "string", diff --git a/lib/ace/mode/typescript_highlight_rules.js b/lib/ace/mode/typescript_highlight_rules.js index 692ff537..da6a533e 100644 --- a/lib/ace/mode/typescript_highlight_rules.js +++ b/lib/ace/mode/typescript_highlight_rules.js @@ -50,39 +50,39 @@ var TypeScriptHighlightRules = function() { var tsRules = [ // Match stuff like: module name {...} { - "token": ["keyword.operator.ts", "text", "variable.parameter.function.ts", "text"], - "regex": "\\b(module)(\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*\\{)" + token: ["keyword.operator.ts", "text", "variable.parameter.function.ts", "text"], + regex: "\\b(module)(\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*\\{)" }, // Match stuff like: super(argument, list) { - "token": ["storage.type.variable.ts", "text", "keyword.other.ts", "text"], - "regex": "(super)(\\s*\\()([a-zA-Z0-9,_?.$\\s]+\\s*)(\\))" + token: ["storage.type.variable.ts", "text", "keyword.other.ts", "text"], + regex: "(super)(\\s*\\()([a-zA-Z0-9,_?.$\\s]+\\s*)(\\))" }, // Match stuff like: function() {...} { - "token": ["entity.name.function.ts","paren.lparen", "paren.rparen"], - "regex": "([a-zA-Z_?.$][\\w?.$]*)(\\()(\\))" + token: ["entity.name.function.ts","paren.lparen", "paren.rparen"], + regex: "([a-zA-Z_?.$][\\w?.$]*)(\\()(\\))" }, // Match stuff like: (function: return type) { - "token": ["variable.parameter.function.ts", "text", "variable.parameter.function.ts"], - "regex": "([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*:\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)" + token: ["variable.parameter.function.ts", "text", "variable.parameter.function.ts"], + regex: "([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*:\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)" }, { - "token": ["keyword.operator.ts"], - "regex": "(?:\\b(constructor|declare|interface|as|AS|public|private|class|extends|export|super)\\b)" + token: ["keyword.operator.ts"], + regex: "(?:\\b(constructor|declare|interface|as|AS|public|private|class|extends|export|super)\\b)" }, { - "token": ["storage.type.variable.ts"], - "regex": "(?:\\b(this\\.|string\\b|bool\\b|number)\\b)" + token: ["storage.type.variable.ts"], + regex: "(?:\\b(this\\.|string\\b|bool\\b|number)\\b)" }, { - "token": ["keyword.operator.ts", "storage.type.variable.ts", "keyword.operator.ts", "storage.type.variable.ts"], - "regex": "(class)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)(extends)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)?" + token: ["keyword.operator.ts", "storage.type.variable.ts", "keyword.operator.ts", "storage.type.variable.ts"], + regex: "(class)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)(extends)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)?" }, { - "token": "keyword", - "regex": "(?:super|export|class|extends|import)\\b" + token: "keyword", + regex: "(?:super|export|class|extends|import)\\b" } ]; From 5dc1d5c306778e7ed922dfd8eaa990925417afad Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 28 Dec 2012 17:58:00 +0400 Subject: [PATCH 16/17] add livescript and django modes --- lib/ace/mode/django.js | 117 +++++++++++++++++ lib/ace/mode/livescript.js | 248 +++++++++++++++++++++++++++++++++++++ 2 files changed, 365 insertions(+) create mode 100644 lib/ace/mode/django.js create mode 100644 lib/ace/mode/livescript.js diff --git a/lib/ace/mode/django.js b/lib/ace/mode/django.js new file mode 100644 index 00000000..8d985665 --- /dev/null +++ b/lib/ace/mode/django.js @@ -0,0 +1,117 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: + * + * Copyright (c) 2012, 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 ***** */ + +define('ace/mode/django', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html', 'ace/mode/text_highlight_rules', 'ace/tokenizer', 'ace/mode/html_highlight_rules'], function(require, exports, module) { + +var oop = require("../lib/oop"); +var HtmlMode = require("./html").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; +var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; + +var DjangoHighlightRules = function(){ + this.$rules = { + 'start': [{ + token: "string", + regex: '".*?"' + }, { + token: "string", + regex: "'.*?'" + }, { + token: "constant", + regex: '[0-9]+' + }, { + token: "variable", + regex: "[-_a-zA-Z0-9:]+" + }], + 'comment': [{ + token : "comment.block", + merge: true, + regex : ".+?" + }], + 'tag': [{ + token: "entity.name.function", + regex: "[a-zA-Z][_a-zA-Z0-9]*", + next: "start" + }] + }; +}; + +oop.inherits(DjangoHighlightRules, TextHighlightRules) + +var DjangoHtmlHighlightRules = function() { + this.$rules = new HtmlHighlightRules().getRules(); + + for (var i in this.$rules) { + this.$rules[i].unshift({ + token: "comment.line", + regex: "\\{#.*?#\\}" + }, { + token: "comment.block", + regex: "\\{\\%\\s*comment\\s*\\%\\}", + merge: true, + next: "django-comment" + }, { + token: "constant.language", + regex: "\\{\\{", + next: "django-start" + }, { + token: "constant.language", + regex: "\\{\\%", + next: "django-tag" + }); + this.embedRules(DjangoHighlightRules, "django-", [{ + token: "comment.block", + regex: "\\{\\%\\s*endcomment\\s*\\%\\}", + merge: true, + next: "start" + }, { + token: "constant.language", + regex: "\\%\\}", + next: "start" + }, { + token: "constant.language", + regex: "\\}\\}", + next: "start" + }]); + } +}; + +oop.inherits(DjangoHtmlHighlightRules, HtmlHighlightRules); + +var Mode = function() { + var highlighter = new DjangoHtmlHighlightRules(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$embeds = highlighter.getEmbeds(); +}; +oop.inherits(Mode, HtmlMode); + +exports.Mode = Mode; +}); \ No newline at end of file diff --git a/lib/ace/mode/livescript.js b/lib/ace/mode/livescript.js new file mode 100644 index 00000000..fcbb7400 --- /dev/null +++ b/lib/ace/mode/livescript.js @@ -0,0 +1,248 @@ +define('ace/mode/ls', function(require, exports, module){ + var identifier, LiveScriptMode, keywordend, stringfill; + identifier = '(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*'; + exports.Mode = LiveScriptMode = (function(superclass){ + var indenter, prototype = extend$((import$(LiveScriptMode, superclass).displayName = 'LiveScriptMode', LiveScriptMode), superclass).prototype, constructor = LiveScriptMode; + function LiveScriptMode(){ + var that; + this.$tokenizer = new (require('ace/tokenizer')).Tokenizer(LiveScriptMode.Rules); + if (that = require('ace/mode/matching_brace_outdent')) { + this.$outdent = new that.MatchingBraceOutdent; + } + } + indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$'); + prototype.getNextLineIndent = function(state, line, tab){ + var indent, tokens; + indent = this.$getIndent(line); + tokens = this.$tokenizer.getLineTokens(line, state).tokens; + if (!(tokens.length && tokens[tokens.length - 1].type === 'comment')) { + if (state === 'start' && indenter.test(line)) { + indent += tab; + } + } + return indent; + }; + prototype.toggleCommentLines = function(state, doc, startRow, endRow){ + var comment, range, i$, i, out, line; + comment = /^(\s*)#/; + range = new (require('ace/range')).Range(0, 0, 0, 0); + for (i$ = startRow; i$ <= endRow; ++i$) { + i = i$; + if (out = comment.test(line = doc.getLine(i))) { + line = line.replace(comment, '$1'); + } else { + line = line.replace(/^\s*/, '$&#'); + } + range.end.row = range.start.row = i; + range.end.column = line.length + 1; + doc.replace(range, line); + } + return 1 - out * 2; + }; + prototype.checkOutdent = function(state, line, input){ + var ref$; + return (ref$ = this.$outdent) != null ? ref$.checkOutdent(line, input) : void 8; + }; + prototype.autoOutdent = function(state, doc, row){ + var ref$; + return (ref$ = this.$outdent) != null ? ref$.autoOutdent(doc, row) : void 8; + }; + return LiveScriptMode; + }(require('ace/mode/text').Mode)); + keywordend = '(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))'; + stringfill = { + token: 'string', + regex: '.+' + }; + LiveScriptMode.Rules = { + start: [ + { + token: 'keyword', + regex: '(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)' + keywordend + }, { + token: 'constant.language', + regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend + }, { + token: 'invalid.illegal', + regex: '(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)' + keywordend + }, { + token: 'language.support.class', + regex: '(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)' + keywordend + }, { + token: 'language.support.function', + regex: '(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)' + keywordend + }, { + token: 'variable.language', + regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend + }, { + token: 'identifier', + regex: identifier + '\\s*:(?![:=])' + }, { + token: 'variable', + regex: identifier + }, { + token: 'keyword.operator', + regex: '(?:\\.{3}|\\s+\\?)' + }, { + token: 'keyword.variable', + regex: '(?:@+|::|\\.\\.)', + next: 'key' + }, { + token: 'keyword.operator', + regex: '\\.\\s*', + next: 'key' + }, { + token: 'string', + regex: '\\\\\\S[^\\s,;)}\\]]*' + }, { + token: 'string.doc', + regex: '\'\'\'', + next: 'qdoc' + }, { + token: 'string.doc', + regex: '"""', + next: 'qqdoc' + }, { + token: 'string', + regex: '\'', + next: 'qstring' + }, { + token: 'string', + regex: '"', + next: 'qqstring' + }, { + token: 'string', + regex: '`', + next: 'js' + }, { + token: 'string', + regex: '<\\[', + next: 'words' + }, { + token: 'string.regex', + regex: '//', + next: 'heregex' + }, { + token: 'comment.doc', + regex: '/\\*', + next: 'comment' + }, { + token: 'comment', + regex: '#.*' + }, { + token: 'string.regex', + regex: '\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}', + next: 'key' + }, { + token: 'constant.numeric', + regex: '(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)' + }, { + token: 'lparen', + regex: '[({[]' + }, { + token: 'rparen', + regex: '[)}\\]]', + next: 'key' + }, { + token: 'keyword.operator', + regex: '\\S+' + }, { + token: 'text', + regex: '\\s+' + } + ], + heregex: [ + { + token: 'string.regex', + regex: '.*?//[gimy$?]{0,4}', + next: 'start' + }, { + token: 'string.regex', + regex: '\\s*#{' + }, { + token: 'comment.regex', + regex: '\\s+(?:#.*)?' + }, { + token: 'string.regex', + regex: '\\S+' + } + ], + key: [ + { + token: 'keyword.operator', + regex: '[.?@!]+' + }, { + token: 'identifier', + regex: identifier, + next: 'start' + }, { + token: 'text', + regex: '.', + next: 'start' + } + ], + comment: [ + { + token: 'comment.doc', + regex: '.*?\\*/', + next: 'start' + }, { + token: 'comment.doc', + regex: '.+' + } + ], + qdoc: [ + { + token: 'string', + regex: ".*?'''", + next: 'key' + }, stringfill + ], + qqdoc: [ + { + token: 'string', + regex: '.*?"""', + next: 'key' + }, stringfill + ], + qstring: [ + { + token: 'string', + regex: '[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'', + next: 'key' + }, stringfill + ], + qqstring: [ + { + token: 'string', + regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', + next: 'key' + }, stringfill + ], + js: [ + { + token: 'string', + regex: '[^\\\\`]*(?:\\\\.[^\\\\`]*)*`', + next: 'key' + }, stringfill + ], + words: [ + { + token: 'string', + regex: '.*?\\]>', + next: 'key' + }, stringfill + ] + }; +function extend$(sub, sup){ + function fun(){} fun.prototype = (sub.superclass = sup).prototype; + (sub.prototype = new fun).constructor = sub; + if (typeof sup.extended == 'function') sup.extended(sub); + return sub; +} +function import$(obj, src){ + var own = {}.hasOwnProperty; + for (var key in src) if (own.call(src, key)) obj[key] = src[key]; + return obj; +} +}); \ No newline at end of file From 18126799439c79d2510adb42527870660e4eda5d Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 2 Feb 2013 15:18:10 +0400 Subject: [PATCH 17/17] update tests --- lib/ace/mode/_test/highlight_rules_test.js | 2 +- lib/ace/mode/_test/text_markdown.txt | 6 + lib/ace/mode/_test/tokens_c9search.json | 45 +- lib/ace/mode/_test/tokens_coffee.json | 111 +-- lib/ace/mode/_test/tokens_curly.json | 137 ++-- lib/ace/mode/_test/tokens_diff.json | 24 +- lib/ace/mode/_test/tokens_html.json | 112 +-- lib/ace/mode/_test/tokens_jade.json | 4 +- lib/ace/mode/_test/tokens_javascript.json | 207 +++++- lib/ace/mode/_test/tokens_liquid.json | 84 ++- lib/ace/mode/_test/tokens_lua.json | 20 +- lib/ace/mode/_test/tokens_luapage.json | 6 +- lib/ace/mode/_test/tokens_lucene.json | 99 ++- lib/ace/mode/_test/tokens_markdown.json | 725 ++------------------ lib/ace/mode/_test/tokens_ruby.json | 251 ++++--- lib/ace/mode/_test/tokens_stylus.json | 3 +- lib/ace/mode/_test/tokens_tcl.json | 121 ++-- lib/ace/mode/_test/tokens_typescript.json | 3 +- lib/ace/mode/_test/tokens_xml.json | 550 +-------------- lib/ace/mode/_test/tokens_xquery.json | 6 +- lib/ace/mode/coldfusion_highlight_rules.js | 15 +- lib/ace/mode/css_highlight_rules_test.js | 92 --- lib/ace/mode/html_highlight_rules.js | 14 +- lib/ace/mode/html_highlight_rules_test.js | 186 ----- lib/ace/mode/liquid_highlight_rules.js | 15 +- lib/ace/mode/liquid_highlight_rules_test.js | 80 --- lib/ace/mode/xml_highlight_rules.js | 3 +- lib/ace/mode/yaml_highlight_rules.js | 6 - 28 files changed, 824 insertions(+), 2103 deletions(-) delete mode 100644 lib/ace/mode/css_highlight_rules_test.js delete mode 100644 lib/ace/mode/html_highlight_rules_test.js delete mode 100644 lib/ace/mode/liquid_highlight_rules_test.js 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" : [