highlight escaped characters in strings
This commit is contained in:
parent
7f90df40b2
commit
9bfdcd4104
5 changed files with 27 additions and 16 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
|
|
@ -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"],
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 : '"|$',
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue