hotfix ruby heredoc highlighting
This commit is contained in:
parent
8ec78bc208
commit
a6d85a6342
1 changed files with 9 additions and 3 deletions
|
|
@ -174,9 +174,15 @@ var RubyHighlightRules = function() {
|
||||||
}, {
|
}, {
|
||||||
stateName: "heredoc",
|
stateName: "heredoc",
|
||||||
token : function(value, currentState, stack) {
|
token : function(value, currentState, stack) {
|
||||||
var next = value[0].length == 2 ? "heredoc" : "indentedHeredoc"
|
var next = value[3] == '-' ? "heredoc" : "indentedHeredoc";
|
||||||
stack.push(next, value[2])
|
var tokens = value.split(this.splitRegex);
|
||||||
return ["constant", "string", "support.class", "string"]
|
stack.push(next, tokens[3]);
|
||||||
|
return [
|
||||||
|
{type:"constant", value: "<<"},
|
||||||
|
{type:"string", value: tokens[2]},
|
||||||
|
{type:"support.class", value: tokens[3]},
|
||||||
|
{type:"string", value: tokens[4]}
|
||||||
|
];
|
||||||
},
|
},
|
||||||
regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)",
|
regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)",
|
||||||
rules: {
|
rules: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue