vendor/assets/javascripts/ace/mode-java.js in ace-rails-ap-4.1.2 vs vendor/assets/javascripts/ace/mode-java.js in ace-rails-ap-4.1.3
- old
+ new
@@ -104,15 +104,15 @@
}, {
token : "string",
regex : '"(?=.)',
next : "qqstring"
}, {
- token : "constant.numeric", // hex
- regex : /0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/
+ token : "constant.numeric", // hexadecimal, octal and binary
+ regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
}, {
- token : "constant.numeric", // float
- regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
+ token : "constant.numeric", // decimal integers and floats
+ regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
}, {
token : [
"storage.type", "punctuation.operator", "support.function",
"punctuation.operator", "entity.name.function", "text","keyword.operator"
],
@@ -159,10 +159,13 @@
],
regex : "(:)(\\s*)(function)(\\s*)(\\()",
next: "function_arguments"
}, {
token : "keyword",
+ regex : "from(?=\\s*('|\"))"
+ }, {
+ token : "keyword",
regex : "(?:" + kwBeforeRe + ")\\b",
next : "start"
}, {
token : ["support.constant"],
regex : /that\b/
@@ -175,10 +178,13 @@
}, {
token : "punctuation.operator",
regex : /[.](?![.])/,
next : "property"
}, {
+ token : "storage.type",
+ regex : /=>/
+ }, {
token : "keyword.operator",
regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
next : "start"
}, {
token : "punctuation.operator",
@@ -314,11 +320,11 @@
token : "constant.language.escape",
regex : escapedRe
}, {
token : "string",
regex : "\\\\$",
- next : "qqstring"
+ consumeLineEnd : true
}, {
token : "string",
regex : '"|$',
next : "no_regex"
}, {
@@ -330,22 +336,22 @@
token : "constant.language.escape",
regex : escapedRe
}, {
token : "string",
regex : "\\\\$",
- next : "qstring"
+ consumeLineEnd : true
}, {
token : "string",
regex : "'|$",
next : "no_regex"
}, {
defaultToken: "string"
}
]
};
-
-
+
+
if (!options || !options.noES6) {
this.$rules.no_regex.unshift({
regex: "[{}]", onMatch: function(val, state, stack) {
this.next = val == "{" ? this.nextState : "";
if (val == "{" && stack.length) {
@@ -376,18 +382,18 @@
next : "pop"
}, {
defaultToken: "string.quasi"
}]
});
-
+
if (!options || options.jsx != false)
JSX.call(this);
}
-
+
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("no_regex") ]);
-
+
this.normalizeRules();
};
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@@ -434,12 +440,12 @@
jsxTag,
{include : "reference"},
{defaultToken: "string"}
];
this.$rules.jsxAttributes = [{
- token : "meta.tag.punctuation.tag-close.xml",
- regex : "/?>",
+ token : "meta.tag.punctuation.tag-close.xml",
+ regex : "/?>",
onMatch : function(value, currentState, stack) {
if (currentState == stack[0])
stack.shift();
if (value.length == 2) {
if (stack[0] == this.nextState)
@@ -450,11 +456,11 @@
}
this.next = stack[0] || "start";
return [{type: this.token, value: value}];
},
nextState: "jsx"
- },
+ },
jsxJsRule,
comments("jsxAttributes"),
{
token : "entity.other.attribute-name.xml",
regex : tagRegex
@@ -717,10 +723,11 @@
(function() {
this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"};
+ this.$quotes = {'"': '"', "'": "'", "`": "`"};
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
@@ -883,14 +890,13 @@
}
],
"comment" : [
{
token : "comment", // closing comment
- regex : ".*?\\*\\/",
+ regex : "\\*\\/",
next : "start"
}, {
- token : "comment", // comment spanning whole line
- regex : ".+"
+ defaultToken : "comment"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",