Skip to content

Commit

Permalink
Highlight fat commas, quote-like ops, and \&funcs
Browse files Browse the repository at this point in the history
getting a little carried away, i think
  • Loading branch information
rwstauner committed Oct 28, 2011
1 parent a3817af commit 7c91db0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion root/static/js/shBrushPerl.js
Expand Up @@ -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' },
Expand Down

0 comments on commit 7c91db0

Please sign in to comment.