fixed some things, see https://groups.google.com/d/msg/ace-internals/Esa5o7DC0Go/8EXOdchDNPgJ
This commit is contained in:
parent
3df5555bd1
commit
d01e358790
1 changed files with 1 additions and 14 deletions
|
|
@ -40,13 +40,10 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
var oop = require("pilot/oop");
|
var oop = require("pilot/oop");
|
||||||
var lang = require("pilot/lang");
|
var lang = require("pilot/lang");
|
||||||
var DocCommentHighlightRules = require("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;
|
|
||||||
var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
|
var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||||
|
|
||||||
RubyHighlightRules = function() {
|
RubyHighlightRules = function() {
|
||||||
|
|
||||||
var docComment = new DocCommentHighlightRules();
|
|
||||||
|
|
||||||
var builtinFunctions = lang.arrayToMap(
|
var builtinFunctions = lang.arrayToMap(
|
||||||
("abort|Array|at_exit|autoload|binding|block_given?|callcc|caller|catch|chomp|chomp!|chop|chop!|eval|exec|exit|exit!" +
|
("abort|Array|at_exit|autoload|binding|block_given?|callcc|caller|catch|chomp|chomp!|chop|chop!|eval|exec|exit|exit!" +
|
||||||
"fail|Float|fork|format|gets|global_variables|gsub|gsub!|Integer|lambda|load|local_variables|loop|open|p|print|" +
|
"fail|Float|fork|format|gets|global_variables|gsub|gsub!|Integer|lambda|load|local_variables|loop|open|p|print|" +
|
||||||
|
|
@ -65,11 +62,9 @@ RubyHighlightRules = function() {
|
||||||
);
|
);
|
||||||
|
|
||||||
var builtinVariables = lang.arrayToMap(
|
var builtinVariables = lang.arrayToMap(
|
||||||
("$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE").split("|")
|
("\\$DEBUG|\\$defout|\\$FILENAME|\\$LOAD_PATH|\\$SAFE|\\$stdin|\\$stdout|\\$stderr|\\$VERBOSE").split("|")
|
||||||
);
|
);
|
||||||
|
|
||||||
var futureReserved = lang.arrayToMap([]);
|
|
||||||
|
|
||||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||||
// regexps are ordered -> the first match is used
|
// regexps are ordered -> the first match is used
|
||||||
|
|
||||||
|
|
@ -81,10 +76,6 @@ RubyHighlightRules = function() {
|
||||||
},
|
},
|
||||||
docComment.getStartRule("doc-start"),
|
docComment.getStartRule("doc-start"),
|
||||||
{
|
{
|
||||||
token : "comment", // multi line comment
|
|
||||||
regex : "^=begin",
|
|
||||||
next : "comment"
|
|
||||||
}, {
|
|
||||||
token : "string.regexp",
|
token : "string.regexp",
|
||||||
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
||||||
}, {
|
}, {
|
||||||
|
|
@ -148,10 +139,6 @@ 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