Permalink
Browse files

Merge pull request #71 from rwstauner/perl-empty-q-ops

Allow perl quote-like operators to be empty
  • Loading branch information...
2 parents 19626a0 + 0e99c88 commit 985329b83daa5e0ad7f50b14a972177acabf0510 @alexgorbatchev committed Mar 18, 2012
Showing with 6 additions and 5 deletions.
  1. +5 −5 scripts/shBrushPerl.js
  2. +1 −0 tests/brushes/perl.html
View
@@ -48,11 +48,11 @@
{ regex: /-?\w+(?=\s*=(>|>))/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: /\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' },
View
@@ -27,6 +27,7 @@
sub something (;$) { Print @_ } # upper-case P
*Other::Package::foo = sub { q!bad! };
+my $str = do { my $empty = q{}; $empty .= q'_'; };
print <<HERE;
doc;

0 comments on commit 985329b

Please sign in to comment.