Unified · Split
| @@ -1,5 +1,5 @@ | ||
| 1 | −/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+c+cpp+coffeescript+php+python+ruby+rust */ | |
| 2 | −self = (typeof window !== 'undefined') | |
| 1 | +/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+c+cpp+coffeescript+ruby+elixir+php+python+rust */ | |
| 2 | +var _self = (typeof window !== 'undefined') | |
| 3 | 3 | ? window // if in browser |
| 4 | 4 | : ( |
| 5 | 5 | (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) |
| @@ -18,7 +18,7 @@ var Prism = (function(){ · 12 unmodified lines | ||
| 18 | 18 | // Private helper vars |
| 19 | 19 | var lang = /\blang(?:uage)?-(?!\*)(\w+)\b/i; |
| 20 | 20 | |
| 21 | −var _ = self.Prism = { | |
| 21 | +var _ = _self.Prism = { | |
| 22 | 22 | util: { |
| 23 | 23 | encode: function (tokens) { |
| 24 | 24 | if (tokens instanceof Token) { |
| @@ -51,7 +51,8 @@ var _ = self.Prism = { · 26 unmodified lines | ||
| 51 | 51 | return clone; |
| 52 | 52 | |
| 53 | 53 | case 'Array': |
| 54 | − return o.map(function(v) { return _.util.clone(v); }); | |
| 54 | + // Check for existence for IE8 | |
| 55 | + return o.map && o.map(function(v) { return _.util.clone(v); }); | |
| 55 | 56 | } |
| 56 | 57 | |
| 57 | 58 | return o; |
| @@ -140,6 +141,7 @@ var _ = self.Prism = { · 82 unmodified lines | ||
| 140 | 141 | } |
| 141 | 142 | } |
| 142 | 143 | }, |
| 144 | + plugins: {}, | |
| 143 | 145 | |
| 144 | 146 | highlightAll: function(async, callback) { |
| 145 | 147 | var elements = document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'); |
| @@ -162,10 +164,6 @@ var _ = self.Prism = { · 16 unmodified lines | ||
| 162 | 164 | grammar = _.languages[language]; |
| 163 | 165 | } |
| 164 | 166 | |
| 165 | − if (!grammar) { | |
| 166 | − return; | |
| 167 | − } | |
| 168 | − | |
| 169 | 167 | // Set language on the element, if not present |
| 170 | 168 | element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; |
| 171 | 169 | |
| @@ -178,12 +176,6 @@ var _ = self.Prism = { · 6 unmodified lines | ||
| 178 | 176 | |
| 179 | 177 | var code = element.textContent; |
| 180 | 178 | |
| 181 | − if(!code) { | |
| 182 | − return; | |
| 183 | − } | |
| 184 | − | |
| 185 | − code = code.replace(/^(?:\r?\n|\r)/,''); | |
| 186 | − | |
| 187 | 179 | var env = { |
| 188 | 180 | element: element, |
| 189 | 181 | language: language, |
| @@ -191,13 +183,18 @@ var _ = self.Prism = { · 1 unmodified line | ||
| 191 | 183 | code: code |
| 192 | 184 | }; |
| 193 | 185 | |
| 186 | + if (!code || !grammar) { | |
| 187 | + _.hooks.run('complete', env); | |
| 188 | + return; | |
| 189 | + } | |
| 190 | + | |
| 194 | 191 | _.hooks.run('before-highlight', env); |
| 195 | 192 | |
| 196 | − // if (async && self.Worker) { | |
| 193 | + // if (async && _self.Worker) { | |
| 197 | 194 | // var worker = new Worker(_.filename); |
| 198 | 195 | |
| 199 | 196 | // worker.onmessage = function(evt) { |
| 200 | − // env.highlightedCode = Token.stringify(JSON.parse(evt.data), language); | |
| 197 | + // env.highlightedCode = evt.data; | |
| 201 | 198 | |
| 202 | 199 | // _.hooks.run('before-insert', env); |
| 203 | 200 | |
| @@ -205,11 +202,13 @@ var _ = self.Prism = { · 1 unmodified line | ||
| 205 | 202 | |
| 206 | 203 | // callback && callback.call(env.element); |
| 207 | 204 | // _.hooks.run('after-highlight', env); |
| 205 | + // _.hooks.run('complete', env); | |
| 208 | 206 | // }; |
| 209 | 207 | |
| 210 | 208 | // worker.postMessage(JSON.stringify({ |
| 211 | 209 | // language: env.language, |
| 212 | − // code: env.code | |
| 210 | + // code: env.code, | |
| 211 | + // immediateClose: true | |
| 213 | 212 | // })); |
| 214 | 213 | // } |
| 215 | 214 | // else { |
| @@ -222,6 +221,7 @@ var _ = self.Prism = { · 6 unmodified lines | ||
| 222 | 221 | callback && callback.call(element); |
| 223 | 222 | |
| 224 | 223 | _.hooks.run('after-highlight', env); |
| 224 | + _.hooks.run('complete', env); | |
| 225 | 225 | // } |
| 226 | 226 | }, |
| 227 | 227 | |
| @@ -380,29 +380,32 @@ Token.stringify = function(o, language, parent) { · 152 unmodified lines | ||
| 380 | 380 | var attributes = ''; |
| 381 | 381 | |
| 382 | 382 | for (var name in env.attributes) { |
| 383 | − attributes += name + '="' + (env.attributes[name] || '') + '"'; | |
| 383 | + attributes += (attributes ? ' ' : '') + name + '="' + (env.attributes[name] || '') + '"'; | |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | return '<' + env.tag + ' class="' + env.classes.join(' ') + '" ' + attributes + '>' + env.content + '</' + env.tag + '>'; |
| 387 | 387 | |
| 388 | 388 | }; |
| 389 | 389 | |
| 390 | −// if (!self.document) { | |
| 391 | −// if (!self.addEventListener) { | |
| 390 | +// if (!_self.document) { | |
| 391 | +// if (!_self.addEventListener) { | |
| 392 | 392 | // // in Node.js |
| 393 | −// return self.Prism; | |
| 393 | +// return _self.Prism; | |
| 394 | 394 | // } |
| 395 | 395 | // // In worker |
| 396 | −// self.addEventListener('message', function(evt) { | |
| 396 | +// _self.addEventListener('message', function(evt) { | |
| 397 | 397 | // var message = JSON.parse(evt.data), |
| 398 | 398 | // lang = message.language, |
| 399 | −// code = message.code; | |
| 399 | +// code = message.code, | |
| 400 | +// immediateClose = message.immediateClose; | |
| 400 | 401 | |
| 401 | −// self.postMessage(JSON.stringify(_.util.encode(_.tokenize(code, _.languages[lang])))); | |
| 402 | −// self.close(); | |
| 402 | +// _self.postMessage(_.highlight(code, _.languages[lang], lang)); | |
| 403 | +// if (immediateClose) { | |
| 404 | +// _self.close(); | |
| 405 | +// } | |
| 403 | 406 | // }, false); |
| 404 | 407 | |
| 405 | −// return self.Prism; | |
| 408 | +// return _self.Prism; | |
| 406 | 409 | // } |
| 407 | 410 | |
| 408 | 411 | // // Get current script and highlight |
| @@ -418,40 +421,45 @@ Token.stringify = function(o, language, parent) { · 9 unmodified lines | ||
| 418 | 421 | // } |
| 419 | 422 | // } |
| 420 | 423 | |
| 421 | −return self.Prism; | |
| 424 | +return _self.Prism; | |
| 422 | 425 | |
| 423 | 426 | })(); |
| 424 | 427 | |
| 425 | 428 | if (typeof module !== 'undefined' && module.exports) { |
| 426 | 429 | module.exports = Prism; |
| 427 | 430 | } |
| 431 | + | |
| 432 | +// hack for components to work correctly in node.js | |
| 433 | +if (typeof global !== 'undefined') { | |
| 434 | + global.Prism = Prism; | |
| 435 | +} | |
| 428 | 436 | ; |
| 429 | 437 | Prism.languages.markup = { |
| 430 | 438 | 'comment': /<!--[\w\W]*?-->/, |
| 431 | − 'prolog': /<\?.+?\?>/, | |
| 432 | − 'doctype': /<!DOCTYPE.+?>/, | |
| 439 | + 'prolog': /<\?[\w\W]+?\?>/, | |
| 440 | + 'doctype': /<!DOCTYPE[\w\W]+?>/, | |
| 433 | 441 | 'cdata': /<!\[CDATA\[[\w\W]*?]]>/i, |
| 434 | 442 | 'tag': { |
| 435 | − pattern: /<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/i, | |
| 443 | + pattern: /<\/?(?!\d)[^\s>\/=.$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i, | |
| 436 | 444 | inside: { |
| 437 | 445 | 'tag': { |
| 438 | − pattern: /^<\/?[\w:-]+/i, | |
| 446 | + pattern: /^<\/?[^\s>\/]+/i, | |
| 439 | 447 | inside: { |
| 440 | 448 | 'punctuation': /^<\/?/, |
| 441 | − 'namespace': /^[\w-]+?:/ | |
| 449 | + 'namespace': /^[^\s>\/:]+:/ | |
| 442 | 450 | } |
| 443 | 451 | }, |
| 444 | 452 | 'attr-value': { |
| 445 | 453 | pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i, |
| 446 | 454 | inside: { |
| 447 | − 'punctuation': /=|>|"/ | |
| 455 | + 'punctuation': /[=>"']/ | |
| 448 | 456 | } |
| 449 | 457 | }, |
| 450 | 458 | 'punctuation': /\/?>/, |
| 451 | 459 | 'attr-name': { |
| 452 | − pattern: /[\w:-]+/, | |
| 460 | + pattern: /[^\s>\/]+/, | |
| 453 | 461 | inside: { |
| 454 | − 'namespace': /^[\w-]+?:/ | |
| 462 | + 'namespace': /^[^\s>\/:]+:/ | |
| 455 | 463 | } |
| 456 | 464 | } |
| 457 | 465 | |
| @@ -467,35 +475,38 @@ Prism.hooks.add('wrap', function(env) { · 9 unmodified lines | ||
| 467 | 475 | env.attributes['title'] = env.content.replace(/&/, '&'); |
| 468 | 476 | } |
| 469 | 477 | }); |
| 470 | −; | |
| 478 | + | |
| 479 | +Prism.languages.xml = Prism.languages.markup; | |
| 480 | +Prism.languages.html = Prism.languages.markup; | |
| 481 | +Prism.languages.mathml = Prism.languages.markup; | |
| 482 | +Prism.languages.svg = Prism.languages.markup; | |
| 483 | + | |
| 471 | 484 | Prism.languages.css = { |
| 472 | 485 | 'comment': /\/\*[\w\W]*?\*\//, |
| 473 | 486 | 'atrule': { |
| 474 | 487 | pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i, |
| 475 | 488 | inside: { |
| 476 | − 'punctuation': /[;:]/ | |
| 489 | + 'rule': /@[\w-]+/ | |
| 490 | + // See rest below | |
| 477 | 491 | } |
| 478 | 492 | }, |
| 479 | − 'url': /url\((?:(["'])(\\\n|\\?.)*?\1|.*?)\)/i, | |
| 480 | − 'selector': /[^\{\}\s][^\{\};]*(?=\s*\{)/, | |
| 481 | − 'string': /("|')(\\\n|\\?.)*?\1/, | |
| 493 | + 'url': /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i, | |
| 494 | + 'selector': /[^\{\}\s][^\{\};]*?(?=\s*\{)/, | |
| 495 | + 'string': /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/, | |
| 482 | 496 | 'property': /(\b|\B)[\w-]+(?=\s*:)/i, |
| 483 | 497 | 'important': /\B!important\b/i, |
| 484 | − 'punctuation': /[\{\};:]/, | |
| 485 | − 'function': /[-a-z0-9]+(?=\()/i | |
| 498 | + 'function': /[-a-z0-9]+(?=\()/i, | |
| 499 | + 'punctuation': /[(){};:]/ | |
| 486 | 500 | }; |
| 487 | 501 | |
| 502 | +Prism.languages.css['atrule'].inside.rest = Prism.util.clone(Prism.languages.css); | |
| 503 | + | |
| 488 | 504 | if (Prism.languages.markup) { |
| 489 | 505 | Prism.languages.insertBefore('markup', 'tag', { |
| 490 | 506 | 'style': { |
| 491 | − pattern: /<style[\w\W]*?>[\w\W]*?<\/style>/i, | |
| 492 | − inside: { | |
| 493 | − 'tag': { | |
| 494 | − pattern: /<style[\w\W]*?>|<\/style>/i, | |
| 495 | − inside: Prism.languages.markup.tag.inside | |
| 496 | − }, | |
| 497 | − rest: Prism.languages.css | |
| 498 | − }, | |
| 507 | + pattern: /(<style[\w\W]*?>)[\w\W]*?(?=<\/style>)/i, | |
| 508 | + lookbehind: true, | |
| 509 | + inside: Prism.languages.css, | |
| 499 | 510 | alias: 'language-css' |
| 500 | 511 | } |
| 501 | 512 | }); |
| @@ -529,9 +540,9 @@ Prism.languages.clike = { · 27 unmodified lines | ||
| 529 | 540 | lookbehind: true |
| 530 | 541 | } |
| 531 | 542 | ], |
| 532 | − 'string': /("|')(\\\n|\\?.)*?\1/, | |
| 543 | + 'string': /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, | |
| 533 | 544 | 'class-name': { |
| 534 | − pattern: /((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i, | |
| 545 | + pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i, | |
| 535 | 546 | lookbehind: true, |
| 536 | 547 | inside: { |
| 537 | 548 | punctuation: /(\.|\\)/ |
| @@ -539,75 +550,93 @@ Prism.languages.clike = { · 1 unmodified line | ||
| 539 | 550 | }, |
| 540 | 551 | 'keyword': /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, |
| 541 | 552 | 'boolean': /\b(true|false)\b/, |
| 542 | − 'function': { | |
| 543 | − pattern: /[a-z0-9_]+\(/i, | |
| 544 | − inside: { | |
| 545 | − punctuation: /\(/ | |
| 546 | − } | |
| 547 | − }, | |
| 548 | − 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/, | |
| 549 | − 'operator': /[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|~|\^|%/, | |
| 550 | − 'ignore': /&(lt|gt|amp);/i, | |
| 553 | + 'function': /[a-z0-9_]+(?=\()/i, | |
| 554 | + 'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i, | |
| 555 | + 'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/, | |
| 551 | 556 | 'punctuation': /[{}[\];(),.:]/ |
| 552 | 557 | }; |
| 553 | −; | |
| 558 | + | |
| 554 | 559 | Prism.languages.javascript = Prism.languages.extend('clike', { |
| 555 | − 'keyword': /\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/, | |
| 556 | − 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|-?Infinity)\b/, | |
| 557 | − 'function': /(?!\d)[a-z0-9_$]+(?=\()/i | |
| 560 | + 'keyword': /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/, | |
| 561 | + 'number': /\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/, | |
| 562 | + // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444) | |
| 563 | + 'function': /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i | |
| 558 | 564 | }); |
| 559 | 565 | |
| 560 | 566 | Prism.languages.insertBefore('javascript', 'keyword', { |
| 561 | 567 | 'regex': { |
| 562 | − pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/, | |
| 568 | + pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/, | |
| 563 | 569 | lookbehind: true |
| 564 | 570 | } |
| 565 | 571 | }); |
| 566 | 572 | |
| 573 | +Prism.languages.insertBefore('javascript', 'class-name', { | |
| 574 | + 'template-string': { | |
| 575 | + pattern: /`(?:\\`|\\?[^`])*`/, | |
| 576 | + inside: { | |
| 577 | + 'interpolation': { | |
| 578 | + pattern: /\$\{[^}]+\}/, | |
| 579 | + inside: { | |
| 580 | + 'interpolation-punctuation': { | |
| 581 | + pattern: /^\$\{|\}$/, | |
| 582 | + alias: 'punctuation' | |
| 583 | + }, | |
| 584 | + rest: Prism.languages.javascript | |
| 585 | + } | |
| 586 | + }, | |
| 587 | + 'string': /[\s\S]+/ | |
| 588 | + } | |
| 589 | + } | |
| 590 | +}); | |
| 591 | + | |
| 567 | 592 | if (Prism.languages.markup) { |
| 568 | 593 | Prism.languages.insertBefore('markup', 'tag', { |
| 569 | 594 | 'script': { |
| 570 | − pattern: /<script[\w\W]*?>[\w\W]*?<\/script>/i, | |
| 571 | − inside: { | |
| 572 | − 'tag': { | |
| 573 | − pattern: /<script[\w\W]*?>|<\/script>/i, | |
| 574 | − inside: Prism.languages.markup.tag.inside | |
| 575 | − }, | |
| 576 | − rest: Prism.languages.javascript | |
| 577 | − }, | |
| 595 | + pattern: /(<script[\w\W]*?>)[\w\W]*?(?=<\/script>)/i, | |
| 596 | + lookbehind: true, | |
| 597 | + inside: Prism.languages.javascript, | |
| 578 | 598 | alias: 'language-javascript' |
| 579 | 599 | } |
| 580 | 600 | }); |
| 581 | 601 | } |
| 582 | −; | |
| 602 | + | |
| 603 | +Prism.languages.js = Prism.languages.javascript; | |
| 583 | 604 | Prism.languages.c = Prism.languages.extend('clike', { |
| 584 | − // allow for c multiline strings | |
| 585 | − 'string': /("|')([^\n\\\1]|\\.|\\\r*\n)*?\1/, | |
| 586 | 605 | 'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/, |
| 587 | − 'operator': /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\// | |
| 606 | + 'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/, | |
| 607 | + 'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i | |
| 588 | 608 | }); |
| 589 | 609 | |
| 590 | 610 | Prism.languages.insertBefore('c', 'string', { |
| 591 | − // property class reused for macro statements | |
| 592 | − 'property': { | |
| 611 | + 'macro': { | |
| 593 | 612 | // allow for multiline macro definitions |
| 594 | 613 | // spaces after the # character compile fine with gcc |
| 595 | − pattern: /((^|\n)\s*)#\s*[a-z]+([^\n\\]|\\.|\\\r*\n)*/i, | |
| 614 | + pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im, | |
| 596 | 615 | lookbehind: true, |
| 616 | + alias: 'property', | |
| 597 | 617 | inside: { |
| 598 | 618 | // highlight the path of the include statement as a string |
| 599 | 619 | 'string': { |
| 600 | 620 | pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/, |
| 601 | 621 | lookbehind: true |
| 622 | + }, | |
| 623 | + // highlight macro directives as keywords | |
| 624 | + 'directive': { | |
| 625 | + pattern: /(#\s*)\b(define|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/, | |
| 626 | + lookbehind: true, | |
| 627 | + alias: 'keyword' | |
| 602 | 628 | } |
| 603 | 629 | } |
| 604 | − } | |
| 630 | + }, | |
| 631 | + // highlight predefined macros as constants | |
| 632 | + 'constant': /\b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|stdin|stdout|stderr)\b/ | |
| 605 | 633 | }); |
| 606 | 634 | |
| 607 | 635 | delete Prism.languages.c['class-name']; |
| 608 | −delete Prism.languages.c['boolean'];; | |
| 636 | +delete Prism.languages.c['boolean']; | |
| 637 | + | |
| 609 | 638 | Prism.languages.cpp = Prism.languages.extend('c', { |
| 610 | − 'keyword': /\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|delete\[\]|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|new\[\]|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, | |
| 639 | + 'keyword': /\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, | |
| 611 | 640 | 'boolean': /\b(true|false)\b/, |
| 612 | 641 | 'operator': /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/ |
| 613 | 642 | }); |
| @@ -617,7 +646,7 @@ Prism.languages.insertBefore('cpp', 'keyword', { · 3 unmodified lines | ||
| 617 | 646 | pattern: /(class\s+)[a-z0-9_]+/i, |
| 618 | 647 | lookbehind: true |
| 619 | 648 | } |
| 620 | −});; | |
| 649 | +}); | |
| 621 | 650 | (function(Prism) { |
| 622 | 651 | |
| 623 | 652 | // Ignore comments starting with { to privilege string interpolation highlighting |
| @@ -632,11 +661,11 @@ Prism.languages.coffeescript = Prism.languages.extend('javascript', { · 8 unmodified lines | ||
| 632 | 661 | 'string': [ |
| 633 | 662 | |
| 634 | 663 | // Strings are multiline |
| 635 | − /'(?:\\?[\s\S])*?'/, | |
| 664 | + /'(?:\\?[^\\])*?'/, | |
| 636 | 665 | |
| 637 | 666 | { |
| 638 | 667 | // Strings are multiline |
| 639 | − pattern: /"(?:\\?[\s\S])*?"/, | |
| 668 | + pattern: /"(?:\\?[^\\])*?"/, | |
| 640 | 669 | inside: { |
| 641 | 670 | 'interpolation': interpolation |
| 642 | 671 | } |
| @@ -700,7 +729,208 @@ Prism.languages.insertBefore('coffeescript', 'keyword', { · 57 unmodified lines | ||
| 700 | 729 | 'property': /(?!\d)\w+(?=\s*:(?!:))/ |
| 701 | 730 | }); |
| 702 | 731 | |
| 703 | −}(Prism));; | |
| 732 | +}(Prism)); | |
| 733 | +/** | |
| 734 | + * Original by Samuel Flores | |
| 735 | + * | |
| 736 | + * Adds the following new token classes: | |
| 737 | + * constant, builtin, variable, symbol, regex | |
| 738 | + */ | |
| 739 | +(function(Prism) { | |
| 740 | + Prism.languages.ruby = Prism.languages.extend('clike', { | |
| 741 | + 'comment': /#(?!\{[^\r\n]*?\}).*/, | |
| 742 | + 'keyword': /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/ | |
| 743 | + }); | |
| 744 | + | |
| 745 | + var interpolation = { | |
| 746 | + pattern: /#\{[^}]+\}/, | |
| 747 | + inside: { | |
| 748 | + 'delimiter': { | |
| 749 | + pattern: /^#\{|\}$/, | |
| 750 | + alias: 'tag' | |
| 751 | + }, | |
| 752 | + rest: Prism.util.clone(Prism.languages.ruby) | |
| 753 | + } | |
| 754 | + }; | |
| 755 | + | |
| 756 | + Prism.languages.insertBefore('ruby', 'keyword', { | |
| 757 | + 'regex': [ | |
| 758 | + { | |
| 759 | + pattern: /%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/, | |
| 760 | + inside: { | |
| 761 | + 'interpolation': interpolation | |
| 762 | + } | |
| 763 | + }, | |
| 764 | + { | |
| 765 | + pattern: /%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/, | |
| 766 | + inside: { | |
| 767 | + 'interpolation': interpolation | |
| 768 | + } | |
| 769 | + }, | |
| 770 | + { | |
| 771 | + // Here we need to specifically allow interpolation | |
| 772 | + pattern: /%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/, | |
| 773 | + inside: { | |
| 774 | + 'interpolation': interpolation | |
| 775 | + } | |
| 776 | + }, | |
| 777 | + { | |
| 778 | + pattern: /%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/, | |
| 779 | + inside: { | |
| 780 | + 'interpolation': interpolation | |
| 781 | + } | |
| 782 | + }, | |
| 783 | + { | |
| 784 | + pattern: /%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/, | |
| 785 | + inside: { | |
| 786 | + 'interpolation': interpolation | |
| 787 | + } | |
| 788 | + }, | |
| 789 | + { | |
| 790 | + pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/, | |
| 791 | + lookbehind: true | |
| 792 | + } | |
| 793 | + ], | |
| 794 | + 'variable': /[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/, | |
| 795 | + 'symbol': /:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/ | |
| 796 | + }); | |
| 797 | + | |
| 798 | + Prism.languages.insertBefore('ruby', 'number', { | |
| 799 | + 'builtin': /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/, | |
| 800 | + 'constant': /\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/ | |
| 801 | + }); | |
| 802 | + | |
| 803 | + Prism.languages.ruby.string = [ | |
| 804 | + { | |
| 805 | + pattern: /%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/, | |
| 806 | + inside: { | |
| 807 | + 'interpolation': interpolation | |
| 808 | + } | |
| 809 | + }, | |
| 810 | + { | |
| 811 | + pattern: /%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/, | |
| 812 | + inside: { | |
| 813 | + 'interpolation': interpolation | |
| 814 | + } | |
| 815 | + }, | |
| 816 | + { | |
| 817 | + // Here we need to specifically allow interpolation | |
| 818 | + pattern: /%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/, | |
| 819 | + inside: { | |
| 820 | + 'interpolation': interpolation | |
| 821 | + } | |
| 822 | + }, | |
| 823 | + { | |
| 824 | + pattern: /%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/, | |
| 825 | + inside: { | |
| 826 | + 'interpolation': interpolation | |
| 827 | + } | |
| 828 | + }, | |
| 829 | + { | |
| 830 | + pattern: /%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/, | |
| 831 | + inside: { | |
| 832 | + 'interpolation': interpolation | |
| 833 | + } | |
| 834 | + }, | |
| 835 | + { | |
| 836 | + pattern: /("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/, | |
| 837 | + inside: { | |
| 838 | + 'interpolation': interpolation | |
| 839 | + } | |
| 840 | + } | |
| 841 | + ]; | |
| 842 | +}(Prism)); | |
| 843 | +Prism.languages.elixir = { | |
| 844 | + // Negative look-ahead is needed for string interpolation | |
| 845 | + // Negative look-behind is needed to avoid highlighting markdown headers in | |
| 846 | + // multi-line doc strings | |
| 847 | + 'comment': { | |
| 848 | + pattern: /(^|[^#])#(?![{#]).*/m, | |
| 849 | + lookbehind: true | |
| 850 | + }, | |
| 851 | + // ~r"""foo""", ~r'''foo''', ~r/foo/, ~r|foo|, ~r"foo", ~r'foo', ~r(foo), ~r[foo], ~r{foo}, ~r<foo> | |
| 852 | + 'regex': /~[rR](?:("""|'''|[\/|"'])(?:\\.|(?!\1)[^\\])+\1|\((?:\\\)|[^)])+\)|\[(?:\\\]|[^\]])+\]|\{(?:\\\}|[^}])+\}|<(?:\\>|[^>])+>)[uismxfr]*/, | |
| 853 | + 'string': [ | |
| 854 | + { | |
| 855 | + // ~s"""foo""", ~s'''foo''', ~s/foo/, ~s|foo|, ~s"foo", ~s'foo', ~s(foo), ~s[foo], ~s{foo}, ~s<foo> | |
| 856 | + pattern: /~[cCsSwW](?:("""|'''|[\/|"'])(?:\\.|(?!\1)[^\\])+\1|\((?:\\\)|[^)])+\)|\[(?:\\\]|[^\]])+\]|\{(?:\\\}|#\{[^}]+\}|[^}])+\}|<(?:\\>|[^>])+>)[csa]?/, | |
| 857 | + inside: { | |
| 858 | + // See interpolation below | |
| 859 | + } | |
| 860 | + }, | |
| 861 | + { | |
| 862 | + pattern: /("""|''')[\s\S]*?\1/, | |
| 863 | + inside: { | |
| 864 | + // See interpolation below | |
| 865 | + } | |
| 866 | + }, | |
| 867 | + { | |
| 868 | + // Multi-line strings are allowed | |
| 869 | + pattern: /("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/, | |
| 870 | + inside: { | |
| 871 | + // See interpolation below | |
| 872 | + } | |
| 873 | + } | |
| 874 | + ], | |
| 875 | + 'atom': { | |
| 876 | + // Look-behind prevents bad highlighting of the :: operator | |
| 877 | + pattern: /(^|[^:]):\w+/, | |
| 878 | + lookbehind: true, | |
| 879 | + alias: 'symbol' | |
| 880 | + }, | |
| 881 | + // Look-ahead prevents bad highlighting of the :: operator | |
| 882 | + 'attr-name': /\w+:(?!:)/, | |
| 883 | + 'capture': { | |
| 884 | + // Look-behind prevents bad highlighting of the && operator | |
| 885 | + pattern: /(^|[^&])&(?:[^&\s\d()][^\s()]*|(?=\())/, | |
| 886 | + lookbehind: true, | |
| 887 | + alias: 'function' | |
| 888 | + }, | |
| 889 | + 'argument': { | |
| 890 | + // Look-behind prevents bad highlighting of the && operator | |
| 891 | + pattern: /(^|[^&])&\d+/, | |
| 892 | + lookbehind: true, | |
| 893 | + alias: 'variable' | |
| 894 | + }, | |
| 895 | + 'attribute': { | |
| 896 | + pattern: /@[\S]+/, | |
| 897 | + alias: 'variable' | |
| 898 | + }, | |
| 899 | + 'number': /\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i, | |
| 900 | + 'keyword': /\b(?:after|alias|and|case|catch|cond|def(?:callback|exception|impl|module|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|require|rescue|try|unless|use|when)\b/, | |
| 901 | + 'boolean': /\b(?:true|false|nil)\b/, | |
| 902 | + 'operator': [ | |
| 903 | + /\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/, | |
| 904 | + { | |
| 905 | + // We don't want to match << | |
| 906 | + pattern: /([^<])<(?!<)/, | |
| 907 | + lookbehind: true | |
| 908 | + }, | |
| 909 | + { | |
| 910 | + // We don't want to match >> | |
| 911 | + pattern: /([^>])>(?!>)/, | |
| 912 | + lookbehind: true | |
| 913 | + } | |
| 914 | + ], | |
| 915 | + 'punctuation': /<<|>>|[.,%\[\]{}()]/ | |
| 916 | +}; | |
| 917 | + | |
| 918 | +Prism.languages.elixir.string.forEach(function(o) { | |
| 919 | + o.inside = { | |
| 920 | + 'interpolation': { | |
| 921 | + pattern: /#\{[^}]+\}/, | |
| 922 | + inside: { | |
| 923 | + 'delimiter': { | |
| 924 | + pattern: /^#\{|\}$/, | |
| 925 | + alias: 'punctuation' | |
| 926 | + }, | |
| 927 | + rest: Prism.util.clone(Prism.languages.elixir) | |
| 928 | + } | |
| 929 | + } | |
| 930 | + }; | |
| 931 | +}); | |
| 932 | + | |
| 933 | + | |
| 704 | 934 | /** |
| 705 | 935 | * Original by Aaron Harun: http://aahacreative.com/2012/07/31/php-syntax-highlighting-prism/ |
| 706 | 936 | * Modified by Miles Johnson: http://milesj.me |
| @@ -718,7 +948,7 @@ Prism.languages.php = Prism.languages.extend('clike', { · 11 unmodified lines | ||
| 718 | 948 | 'keyword': /\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i, |
| 719 | 949 | 'constant': /\b[A-Z0-9_]{2,}\b/, |
| 720 | 950 | 'comment': { |
| 721 | − pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])(\/\/).*?(\r?\n|$))/, | |
| 951 | + pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/, | |
| 722 | 952 | lookbehind: true |
| 723 | 953 | } |
| 724 | 954 | }); |
| @@ -727,15 +957,15 @@ Prism.languages.php = Prism.languages.extend('clike', { · 2 unmodified lines | ||
| 727 | 957 | // common than strings containing hashes... |
| 728 | 958 | Prism.languages.insertBefore('php', 'class-name', { |
| 729 | 959 | 'shell-comment': { |
| 730 | − pattern: /(^|[^\\])#.*?(\r?\n|$)/, | |
| 960 | + pattern: /(^|[^\\])#.*/, | |
| 731 | 961 | lookbehind: true, |
| 732 | 962 | alias: 'comment' |
| 733 | 963 | } |
| 734 | 964 | }); |
| 735 | 965 | |
| 736 | 966 | Prism.languages.insertBefore('php', 'keyword', { |
| 737 | − 'delimiter': /(\?>|<\?php|<\?)/i, | |
| 738 | − 'variable': /(\$\w+)\b/i, | |
| 967 | + 'delimiter': /\?>|<\?(?:php)?/i, | |
| 968 | + 'variable': /\$\w+\b/i, | |
| 739 | 969 | 'package': { |
| 740 | 970 | pattern: /(\\|namespace\s+|use\s+)[\w\\]+/, |
| 741 | 971 | lookbehind: true, |
| @@ -788,7 +1018,8 @@ if (Prism.languages.markup) { · 46 unmodified lines | ||
| 788 | 1018 | } |
| 789 | 1019 | |
| 790 | 1020 | for (var i = 0, t; t = env.tokenStack[i]; i++) { |
| 791 | − env.highlightedCode = env.highlightedCode.replace('{{{PHP' + (i + 1) + '}}}', Prism.highlight(t, env.grammar, 'php')); | |
| 1021 | + // The replace prevents $$, $&, $`, $', $n, $nn from being interpreted as special patterns | |
| 1022 | + env.highlightedCode = env.highlightedCode.replace('{{{PHP' + (i + 1) + '}}}', Prism.highlight(t, env.grammar, 'php').replace(/\$/g, '$$$$')); | |
| 792 | 1023 | } |
| 793 | 1024 | |
| 794 | 1025 | env.element.innerHTML = env.highlightedCode; |
| @@ -812,41 +1043,30 @@ if (Prism.languages.markup) { · 17 unmodified lines | ||
| 812 | 1043 | } |
| 813 | 1044 | ; |
| 814 | 1045 | Prism.languages.python= { |
| 1046 | + 'triple-quoted-string': { | |
| 1047 | + pattern: /"""[\s\S]+?"""|'''[\s\S]+?'''/, | |
| 1048 | + alias: 'string' | |
| 1049 | + }, | |
| 815 | 1050 | 'comment': { |
| 816 | − pattern: /(^|[^\\])#.*?(\r?\n|$)/, | |
| 1051 | + pattern: /(^|[^\\])#.*/, | |
| 1052 | + lookbehind: true | |
| 1053 | + }, | |
| 1054 | + 'string': /("|')(?:\\?.)*?\1/, | |
| 1055 | + 'function' : { | |
| 1056 | + pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g, | |
| 1057 | + lookbehind: true | |
| 1058 | + }, | |
| 1059 | + 'class-name': { | |
| 1060 | + pattern: /(\bclass\s+)[a-z0-9_]+/i, | |
| 817 | 1061 | lookbehind: true |
| 818 | 1062 | }, |
| 819 | − 'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(\\?.)*?\1/, | |
| 820 | − 'keyword' : /\b(as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/, | |
| 821 | − 'boolean' : /\b(True|False)\b/, | |
| 822 | − 'number' : /\b-?(0[box])?(?:[\da-f]+\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i, | |
| 823 | − 'operator' : /[-+]|<=?|>=?|!|={1,2}|&{1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|and|not)\b/, | |
| 1063 | + 'keyword' : /\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/, | |
| 1064 | + 'boolean' : /\b(?:True|False)\b/, | |
| 1065 | + 'number' : /\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i, | |
| 1066 | + 'operator' : /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/, | |
| 824 | 1067 | 'punctuation' : /[{}[\];(),.:]/ |
| 825 | 1068 | }; |
| 826 | 1069 | |
| 827 | −; | |
| 828 | −/** | |
| 829 | − * Original by Samuel Flores | |
| 830 | − * | |
| 831 | − * Adds the following new token classes: | |
| 832 | − * constant, builtin, variable, symbol, regex | |
| 833 | − */ | |
| 834 | −Prism.languages.ruby = Prism.languages.extend('clike', { | |
| 835 | − 'comment': /#[^\r\n]*(\r?\n|$)/, | |
| 836 | − 'keyword': /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/, | |
| 837 | − 'builtin': /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/, | |
| 838 | − 'constant': /\b[A-Z][a-zA-Z_0-9]*[?!]?\b/ | |
| 839 | −}); | |
| 840 | − | |
| 841 | −Prism.languages.insertBefore('ruby', 'keyword', { | |
| 842 | − 'regex': { | |
| 843 | − pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/, | |
| 844 | − lookbehind: true | |
| 845 | − }, | |
| 846 | − 'variable': /[@$]+\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/, | |
| 847 | − 'symbol': /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/ | |
| 848 | −}); | |
| 849 | −; | |
| 850 | 1070 | /* TODO |
| 851 | 1071 | Add support for Markdown notation inside doc comments |
| 852 | 1072 | Add support for nested block comments... |
| @@ -861,7 +1081,7 @@ Prism.languages.rust = { · 8 unmodified lines | ||
| 861 | 1081 | lookbehind: true |
| 862 | 1082 | }, |
| 863 | 1083 | { |
| 864 | − pattern: /(^|[^\\:])\/\/.*?(\r?\n|$)/, | |
| 1084 | + pattern: /(^|[^\\:])\/\/.*/, | |
| 865 | 1085 | lookbehind: true |
| 866 | 1086 | } |
| 867 | 1087 | ], |
| @@ -887,7 +1107,7 @@ Prism.languages.rust = { · 19 unmodified lines | ||
| 887 | 1107 | }, |
| 888 | 1108 | |
| 889 | 1109 | // Hex, oct, bin, dec numbers with visual separators and type suffix |
| 890 | − 'number': /\b-?(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32)?|f32|f64))?\b/, | |
| 1110 | + 'number': /\b-?(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32|64)?|f32|f64))?\b/, | |
| 891 | 1111 | |
| 892 | 1112 | // Closure params should not be confused with bitwise OR | |
| 893 | 1113 | 'closure-params': { |
| @@ -897,6 +1117,6 @@ Prism.languages.rust = { · 3 unmodified lines | ||
| 897 | 1117 | 'operator': /[&*]/ |
| 898 | 1118 | } |
| 899 | 1119 | }, |
| 900 | − 'punctuation': /[{}[\];(),.:]|->/, | |
| 901 | − 'operator': /[-+]{1,2}|!=?|<=?|>=?|={1,3}|&&?|\|\|?|\*|\/|\^|%|<<|>>@/ | |
| 902 | −};; | |
| 1120 | + 'punctuation': /[{}[\];(),:]|\.+|->/, | |
| 1121 | + 'operator': /[-+*\/%!^=]=?|@|&[&=]?|\|[|=]?|<<?=?|>>?=?/ | |
| 1122 | +}; | |