highlight escaped characters in strings

This commit is contained in:
nightwing 2013-02-25 01:52:49 +04:00
commit 9bfdcd4104
5 changed files with 27 additions and 16 deletions

View file

@ -31,6 +31,9 @@
define(function(require, exports, module) { define(function(require, exports, module) {
"use strict"; "use strict";
if (typeof document == "undefined")
return;
var XHTML_NS = "http://www.w3.org/1999/xhtml"; var XHTML_NS = "http://www.w3.org/1999/xhtml";
exports.getDocumentHead = function(doc) { exports.getDocumentHead = function(doc) {

View file

@ -27,7 +27,9 @@
"start", "start",
["identifier","bio"], ["identifier","bio"],
["text"," = "], ["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", "start",
["identifier","dob"], ["identifier","dob"],

View file

@ -51,6 +51,7 @@ var Mode = function() {
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function() { (function() {
this.lineCommentStart = "#";
// Extra logic goes here. // Extra logic goes here.
}).call(Mode.prototype); }).call(Mode.prototype);

View file

@ -46,10 +46,9 @@ var TomlHighlightRules = function() {
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
this.$rules = this.$rules = {
{
"start": [ "start": [
{ {
token: "comment.toml", token: "comment.toml",
regex: /#.*$/ regex: /#.*$/
}, },
@ -81,6 +80,10 @@ var TomlHighlightRules = function() {
regex : "\\\\$", regex : "\\\\$",
next : "qqstring", next : "qqstring",
}, },
{
token : "constant.language.escape",
regex : '\\\\[0tnr"\\\\]'
},
{ {
token : "string", token : "string",
regex : '"|$', regex : '"|$',

View file

@ -55,6 +55,8 @@ var Mode = function() {
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function() { (function() {
this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"};
// Extra logic goes here. // Extra logic goes here.
}).call(Mode.prototype); }).call(Mode.prototype);