diff --git a/lib/ace/edit_session/bracket_match.js b/lib/ace/edit_session/bracket_match.js index 064ee3dc..62a8499c 100644 --- a/lib/ace/edit_session/bracket_match.js +++ b/lib/ace/edit_session/bracket_match.js @@ -117,7 +117,7 @@ function BracketMatch() { typeRe = new RegExp( "(\\.?" + token.type.replace(".", "\\.").replace("rparen", ".paren") - .replace(/\b(?:end|start|begin)\b/, "") + .replace(/\b(?:end)\b/, "(?:start|begin|end)") + ")+" ); } @@ -174,7 +174,7 @@ function BracketMatch() { typeRe = new RegExp( "(\\.?" + token.type.replace(".", "\\.").replace("lparen", ".paren") - .replace(/\b(?:end|start|begin)\b/, "") + .replace(/\b(?:start|begin)\b/, "(?:start|begin|end)") + ")+" ); } diff --git a/lib/ace/mode/_test/tokens_rust.json b/lib/ace/mode/_test/tokens_rust.json index 6592575b..8c59a3aa 100644 --- a/lib/ace/mode/_test/tokens_rust.json +++ b/lib/ace/mode/_test/tokens_rust.json @@ -10,10 +10,9 @@ ],[ "start", ["keyword.source.rust","fn"], - ["meta.function.source.rust"," "], + ["text"," "], ["entity.name.function.source.rust","main"], - ["meta.function.source.rust","("], - ["text",") {"] + ["text","() {"] ],[ "start", ["text"," "], @@ -88,10 +87,14 @@ ],[ "start", ["keyword.source.rust","fn"], - ["meta.function.source.rust"," "], - ["entity.name.function.source.rust","map"], - ["meta.function.source.rust","("], - ["text","vector: &[T]"], + ["text"," "], + ["entity.name.function.source.rust","map"], + ["keyword.operator","<"], + ["text","T"], + ["keyword.operator",","], + ["text"," U"], + ["keyword.operator",">"], + ["text","(vector: &[T]"], ["keyword.operator",","], ["text"," function: &fn(v: &T) "], ["keyword.operator","->"], diff --git a/lib/ace/mode/html_highlight_rules.js b/lib/ace/mode/html_highlight_rules.js index 9c9cc36f..4effa2aa 100644 --- a/lib/ace/mode/html_highlight_rules.js +++ b/lib/ace/mode/html_highlight_rules.js @@ -65,7 +65,7 @@ var HtmlHighlightRules = function() { include : "tag_whitespace" }, { token : "entity.other.attribute-name.xml", - regex : "[-_a-zA-Z0-9:]+" + regex : "[-_a-zA-Z0-9:.]+" }, { token : "keyword.operator.attribute-equals.xml", regex : "=", @@ -89,7 +89,7 @@ var HtmlHighlightRules = function() { return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml", "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"]; }, - regex : "(]*)(\\s*\\()' }, + { token: [ 'keyword.source.rust', 'text', 'entity.name.function.source.rust' ], + regex: '\\b(fn)(\\s+)([a-zA-Z_][a-zA-Z0-9_]*)' }, { token: 'support.constant', regex: '\\b[a-zA-Z_][\\w\\d]*::' }, { token: 'keyword.source.rust', regex: '\\b(?:as|assert|break|claim|const|do|drop|else|extern|fail|for|if|impl|in|let|log|loop|match|mod|module|move|mut|Owned|priv|pub|pure|ref|return|unchecked|unsafe|use|while|mod|Send|static|trait|class|struct|enum|type)\\b' }, diff --git a/lib/ace/mode/xml_highlight_rules.js b/lib/ace/mode/xml_highlight_rules.js index 91da0e70..8e39cae5 100644 --- a/lib/ace/mode/xml_highlight_rules.js +++ b/lib/ace/mode/xml_highlight_rules.js @@ -35,8 +35,10 @@ var oop = require("../lib/oop"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var XmlHighlightRules = function(normalize) { - - var tagRegex = "[a-zA-Z][-_a-zA-Z0-9]*"; + // http://www.w3.org/TR/REC-xml/#NT-NameChar + // NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] + // NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] + var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*"; this.$rules = { start : [ diff --git a/tool/lib.js b/tool/lib.js index e72194d7..8809595c 100644 --- a/tool/lib.js +++ b/tool/lib.js @@ -1,6 +1,7 @@ var plist = require("plist"); var util = require("util"); var url = require("url"); +var cson = require("cson"); var https = require("https"); var http = require("http"); @@ -12,8 +13,12 @@ exports.parsePlist = function(xmlOrJSON, callback) { json = result[0]; }); } else { - xmlOrJSON = xmlOrJSON.replace(/^\s*\/\/.*/gm, ""); - json = JSON.parse(xmlOrJSON) + try { + xmlOrJSON = xmlOrJSON.replace(/^\s*\/\/.*/gm, ""); + json = JSON.parse(xmlOrJSON) + } catch(e) { + json = cson.parse(xmlOrJSON); + } } callback && callback(json); return json; diff --git a/tool/package.json b/tool/package.json index 2d33713a..974673c6 100644 --- a/tool/package.json +++ b/tool/package.json @@ -1,9 +1,10 @@ { - "name": "ace-tools", - "version": "0.1.0", - "dependencies": { - "plist": "", - "css-parse": "1.0.3", - "css-stringify": "1.0.3" - } + "name": "ace-tools", + "version": "0.1.0", + "dependencies": { + "cson": "^3.0.1", + "css-parse": "1.0.3", + "css-stringify": "1.0.3", + "plist": "" + } }