ruby multi-line comments
This commit is contained in:
parent
25288442f4
commit
67836cc281
2 changed files with 9 additions and 1 deletions
|
|
@ -79,7 +79,7 @@ oop.inherits(Mode, TextMode);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return doc.indentRows(startRow, endRow, "//");
|
return doc.indentRows(startRow, endRow, "#");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,10 @@ RubyHighlightRules = function() {
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : "#.*$"
|
regex : "#.*$"
|
||||||
}, {
|
}, {
|
||||||
|
token : "comment", // multi line comment
|
||||||
|
regex : "^\=begin$",
|
||||||
|
next : "comment"
|
||||||
|
}, {
|
||||||
token : "string.regexp",
|
token : "string.regexp",
|
||||||
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
||||||
}, {
|
}, {
|
||||||
|
|
@ -135,6 +139,10 @@ RubyHighlightRules = function() {
|
||||||
],
|
],
|
||||||
"comment" : [
|
"comment" : [
|
||||||
{
|
{
|
||||||
|
token : "comment", // closing comment
|
||||||
|
regex : "^\=end$",
|
||||||
|
next : "start"
|
||||||
|
}, {
|
||||||
token : "comment", // comment spanning whole line
|
token : "comment", // comment spanning whole line
|
||||||
regex : ".+"
|
regex : ".+"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue