diff --git a/lib/ace/lib/dom.js b/lib/ace/lib/dom.js index 4df72736..b3724009 100644 --- a/lib/ace/lib/dom.js +++ b/lib/ace/lib/dom.js @@ -31,6 +31,9 @@ define(function(require, exports, module) { "use strict"; +if (typeof document == "undefined") + return; + var XHTML_NS = "http://www.w3.org/1999/xhtml"; exports.getDocumentHead = function(doc) { diff --git a/lib/ace/mode/_test/tokens_toml.json b/lib/ace/mode/_test/tokens_toml.json index accc0c49..ec471f74 100644 --- a/lib/ace/mode/_test/tokens_toml.json +++ b/lib/ace/mode/_test/tokens_toml.json @@ -27,7 +27,9 @@ "start", ["identifier","bio"], ["text"," = "], - ["string","\"GitHub Cofounder & CEO\\nLikes tater tots and beer.\""] + ["string","\"GitHub Cofounder & CEO"], + ["constant.language.escape","\\n"], + ["string","Likes tater tots and beer.\""] ],[ "start", ["identifier","dob"], diff --git a/lib/ace/mode/toml.js b/lib/ace/mode/toml.js index 066f2304..bd47182f 100644 --- a/lib/ace/mode/toml.js +++ b/lib/ace/mode/toml.js @@ -3,7 +3,7 @@ * * Copyright (c) 2013, 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 @@ -28,7 +28,7 @@ * * * Contributor(s): - * + * * Garen J. Torikian * * ***** END LICENSE BLOCK ***** */ @@ -51,7 +51,8 @@ var Mode = function() { oop.inherits(Mode, TextMode); (function() { - // Extra logic goes here. + this.lineCommentStart = "#"; + // Extra logic goes here. }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/toml_highlight_rules.js b/lib/ace/mode/toml_highlight_rules.js index 6700c11a..a448923d 100644 --- a/lib/ace/mode/toml_highlight_rules.js +++ b/lib/ace/mode/toml_highlight_rules.js @@ -28,7 +28,7 @@ * * * Contributor(s): - * + * * Garen J. Torikian * * ***** END LICENSE BLOCK ***** */ @@ -46,10 +46,9 @@ var TomlHighlightRules = function() { var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; - this.$rules = - { + this.$rules = { "start": [ - { + { token: "comment.toml", regex: /#.*$/ }, @@ -65,7 +64,7 @@ var TomlHighlightRules = function() { { token : keywordMapper, regex : identifierRe - }, + }, { token : "support.date.toml", regex: "\\d{4}-\\d{2}-\\d{2}(T)\\d{2}:\\d{2}:\\d{2}(Z)" @@ -80,12 +79,16 @@ var TomlHighlightRules = function() { token : "string", regex : "\\\\$", next : "qqstring", - }, + }, + { + token : "constant.language.escape", + regex : '\\\\[0tnr"\\\\]' + }, { token : "string", regex : '"|$', next : "start", - }, + }, { defaultToken: "string" } diff --git a/tool/mode.tmpl.js b/tool/mode.tmpl.js index a3da521e..054cb7e6 100644 --- a/tool/mode.tmpl.js +++ b/tool/mode.tmpl.js @@ -3,7 +3,7 @@ * * 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 @@ -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 @@ -28,7 +28,7 @@ * * * Contributor(s): - * + * * * * ***** END LICENSE BLOCK ***** */ @@ -55,7 +55,9 @@ var Mode = function() { oop.inherits(Mode, TextMode); (function() { - // Extra logic goes here. + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + // Extra logic goes here. }).call(Mode.prototype); exports.Mode = Mode;