vendor/assets/javascripts/ace/mode-dart.js in ace-rails-ap-4.0.1 vs vendor/assets/javascripts/ace/mode-dart.js in ace-rails-ap-4.0.2
- old
+ new
@@ -92,10 +92,11 @@
"variable.language": "this",
"constant.language": builtinConstants
}, "identifier");
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b";
+ var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source;
this.$rules = {
"start" : [
{
token : "comment",
@@ -110,24 +111,32 @@
{
token : "comment", // multi line comment
regex : "\\/\\*",
next : "comment"
}, {
- token : "string", // single line
- regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ token : "string", // character
+ regex : "'(?:" + escapeRe + "|.)'"
}, {
- token : "string", // multi line string start
- regex : '["].*\\\\$',
- next : "qqstring"
+ token : "string.start",
+ regex : '"',
+ stateName: "qqstring",
+ next: [
+ { token: "string", regex: /\\\s*$/, next: "qqstring" },
+ { token: "constant.language.escape", regex: escapeRe },
+ { token: "constant.language.escape", regex: /%[^'"\\]/ },
+ { token: "string.end", regex: '"|$', next: "start" },
+ { defaultToken: "string"}
+ ]
}, {
- token : "string", // single line
- regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ token : "string.start",
+ regex : 'R"\\(',
+ stateName: "rawString",
+ next: [
+ { token: "string.end", regex: '\\)"', next: "start" },
+ { defaultToken: "string"}
+ ]
}, {
- token : "string", // multi line string start
- regex : "['].*\\\\$",
- next : "qstring"
- }, {
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"
@@ -182,28 +191,10 @@
next : "start"
}, {
defaultToken: "comment"
}
],
- "qqstring" : [
- {
- token : "string",
- regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
- next : "start"
- }, {
- defaultToken : "string"
- }
- ],
- "qstring" : [
- {
- token : "string",
- regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
- next : "start"
- }, {
- defaultToken : "string"
- }
- ],
"directive" : [
{
token : "constant.other.multiline",
regex : /\\/
},
@@ -234,9 +225,10 @@
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
+ this.normalizeRules();
};
oop.inherits(c_cppHighlightRules, TextHighlightRules);
exports.c_cppHighlightRules = c_cppHighlightRules;