aboutsummaryrefslogtreecommitdiff
path: root/node_modules/highlight.js/lib/languages/crystal.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-08-14 05:01:11 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-08-14 05:02:09 +0200
commit363723fc84f7b8477592e0105aeb331ec9a017af (patch)
tree29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/highlight.js/lib/languages/crystal.js
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/highlight.js/lib/languages/crystal.js')
-rw-r--r--node_modules/highlight.js/lib/languages/crystal.js25
1 files changed, 21 insertions, 4 deletions
diff --git a/node_modules/highlight.js/lib/languages/crystal.js b/node_modules/highlight.js/lib/languages/crystal.js
index 28a2797ed..95209b946 100644
--- a/node_modules/highlight.js/lib/languages/crystal.js
+++ b/node_modules/highlight.js/lib/languages/crystal.js
@@ -6,10 +6,10 @@ module.exports = function(hljs) {
var CRYSTAL_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\][=?]?';
var CRYSTAL_KEYWORDS = {
keyword:
- 'abstract alias as asm begin break case class def do else elsif end ensure enum extend for fun if ifdef ' +
- 'include instance_sizeof is_a? lib macro module next of out pointerof private protected rescue responds_to? ' +
- 'return require self sizeof struct super then type typeof union unless until when while with yield ' +
- '__DIR__ __FILE__ __LINE__',
+ 'abstract alias as as? asm begin break case class def do else elsif end ensure enum extend for fun if ' +
+ 'include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? ' +
+ 'return require select self sizeof struct super then type typeof union uninitialized unless until when while with yield ' +
+ '__DIR__ __END_LINE__ __FILE__ __LINE__',
literal: 'false nil true'
};
var SUBST = {
@@ -47,6 +47,22 @@ module.exports = function(hljs) {
{begin: '%w?%', end: '%'},
{begin: '%w?-', end: '-'},
{begin: '%w?\\|', end: '\\|'},
+ {begin: /<<-\w+$/, end: /^\s*\w+$/},
+ ],
+ relevance: 0,
+ };
+ var Q_STRING = {
+ className: 'string',
+ variants: [
+ {begin: '%q\\(', end: '\\)', contains: recursiveParen('\\(', '\\)')},
+ {begin: '%q\\[', end: '\\]', contains: recursiveParen('\\[', '\\]')},
+ {begin: '%q{', end: '}', contains: recursiveParen('{', '}')},
+ {begin: '%q<', end: '>', contains: recursiveParen('<', '>')},
+ {begin: '%q/', end: '/'},
+ {begin: '%q%', end: '%'},
+ {begin: '%q-', end: '-'},
+ {begin: '%q\\|', end: '\\|'},
+ {begin: /<<-'\w+'$/, end: /^\s*\w+$/},
],
relevance: 0,
};
@@ -97,6 +113,7 @@ module.exports = function(hljs) {
var CRYSTAL_DEFAULT_CONTAINS = [
EXPANSION,
STRING,
+ Q_STRING,
REGEXP,
REGEXP2,
ATTRIBUTE,