vendor/assets/javascripts/ace/mode-json.js in ace-rails-ap-4.1.2 vs vendor/assets/javascripts/ace/mode-json.js in ace-rails-ap-4.1.3
- old
+ new
@@ -22,16 +22,20 @@
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, {
token : "constant.language.boolean",
regex : "(?:true|false)\\b"
}, {
- token : "invalid.illegal", // single quoted strings are not allowed
+ token : "text", // single quoted strings are not allowed
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
- token : "invalid.illegal", // comments are not allowed
+ token : "comment", // comments are not allowed, but who cares?
regex : "\\/\\/.*$"
}, {
+ token : "comment.start", // comments are not allowed, but who cares?
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
token : "paren.lparen",
regex : "[[({]"
}, {
token : "paren.rparen",
regex : "[\\])}]"
@@ -44,18 +48,22 @@
{
token : "constant.language.escape",
regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/
}, {
token : "string",
- regex : '[^"\\\\]+'
- }, {
- token : "string",
- regex : '"',
+ regex : '"|$',
next : "start"
}, {
- token : "string",
- regex : "",
+ defaultToken : "string"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment.end", // comments are not allowed, but who cares?
+ regex : "\\*\\/",
next : "start"
+ }, {
+ defaultToken: "comment"
}
]
};
};