Add highlighting for raw string literals in rust mode.
This commit is contained in:
parent
9cc394d3b9
commit
23c64c6ebb
1 changed files with 29 additions and 4 deletions
|
|
@ -29,10 +29,6 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/* This file was autogenerated from https://raw.github.com/dbp/sublime-rust/master/Rust.tmLanguage (uuid: ) */
|
||||
/****************************************************************************************
|
||||
* IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. *
|
||||
* fileTypes *
|
||||
****************************************************************************************/
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
|
@ -55,6 +51,35 @@ var RustHighlightRules = function() {
|
|||
next: 'pop' },
|
||||
{ include: '#rust_escaped_character' },
|
||||
{ defaultToken: 'string.quoted.single.source.rust' } ] },
|
||||
{
|
||||
stateName: "bracketedComment",
|
||||
onMatch : function(value, currentState, stack){
|
||||
stack.unshift(this.next, value.length - 1, currentState);
|
||||
return "string.quoted.raw.source.rust";
|
||||
},
|
||||
regex : /r#*"/,
|
||||
next : [
|
||||
{
|
||||
onMatch : function(value, currentState, stack) {
|
||||
var token = "string.quoted.raw.source.rust";
|
||||
if (value.length >= stack[1]) {
|
||||
if (value.length > stack[1])
|
||||
token = "invalid";
|
||||
stack.shift();
|
||||
stack.shift();
|
||||
this.next = stack.shift();
|
||||
} else {
|
||||
this.next = "";
|
||||
}
|
||||
return token;
|
||||
},
|
||||
regex : /"#*/,
|
||||
next : "start"
|
||||
}, {
|
||||
defaultToken : "string.quoted.raw.source.rust"
|
||||
}
|
||||
]
|
||||
},
|
||||
{ token: 'string.quoted.double.source.rust',
|
||||
regex: '"',
|
||||
push:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue