Browse files

Highlight fat commas, quote-like ops, and \&funcs

getting a little carried away, i think
  • Loading branch information...
1 parent a3817af commit 7c91db091c0fb6ee170b1c7192bb75e20141b652 @rwstauner rwstauner committed Oct 27, 2011
Showing with 10 additions and 1 deletion.
  1. +10 −1 root/static/js/shBrushPerl.js
View
11 root/static/js/shBrushPerl.js
@@ -61,10 +61,19 @@
{ regex: /(<<|&lt;&lt;)((\w+)|(['"])(.+?)\4)[\s\S]+?\n\3\5\n/g, css: 'string' }, // here doc (maybe html encoded)
{ regex: /#.*$/gm, css: 'comments' },
{ regex: /^#!.*\n/g, css: 'preprocessor' }, // shebang
+ { regex: /-?\w+(?=\s*=(>|&gt;))/g, css: 'string' }, // fat comma
+
+ // is this too much?
+ { regex: /\bq[qwxr]?\([\s\S]+?\)/g, css: 'string' }, // quote-like operators ()
+ { regex: /\bq[qwxr]?\{[\s\S]+?\}/g, css: 'string' }, // quote-like operators {}
+ { regex: /\bq[qwxr]?\[[\s\S]+?\]/g, css: 'string' }, // quote-like operators []
+ { regex: /\bq[qwxr]?(<|&lt;)[\s\S]+?(>|&gt;)/g, css: 'string' }, // quote-like operators <>
+ { regex: /\bq[qwxr]?([^\w({<[])[\s\S]+?\1/g, css: 'string' }, // quote-like operators non-paired
+
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
// currently ignoring single quote package separator and utf8 names
- { regex: /(?:[$@%*]|\$#)[a-zA-Z_](\w+|::)*/g, css: 'variable' },
+ { regex: /(?:&amp;|[$@%*]|\$#)[a-zA-Z_](\w+|::)*/g, css: 'variable' },
{ regex: /\b__(?:END|DATA)__\b[\s\S]*$/g, css: 'comments' },
{ regex: /^=\w[\s\S]*?\n=cut\s*$/gm, css: 'comments' }, // pod
{ regex: new RegExp(this.getKeywords(funcs), 'gm'), css: 'functions' },

0 comments on commit 7c91db0

Please sign in to comment.