Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Jan 13, 2021
1 parent 57d83f4 commit 8c011bd
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/languages/perl.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,23 +392,20 @@ export default function(hljs) {
relevance: 0,
contains: [
hljs.HASH_COMMENT_MODE,
{
className: 'regexp',
begin: regex.concat(
/(?:s|tr|y)/,
regex.either(...REGEX_DELIMS),
/(?:\\.|[^\\\/])*?/,
/\1/,
/(?:\\.|[^\\\/])*?/,
/\1/,
REGEX_MODIFIERS
),
relevance: 2
},
// special cases of paired delemeters
{
className: 'regexp',
variants: [
{
begin: regex.concat(
/(?:s|tr|y)/,
regex.either(...REGEX_DELIMS),
/(?:\\.|[^\\\/])*?/,
/\1/,
/(?:\\.|[^\\\/])*?/,
/\1/,
REGEX_MODIFIERS
)
},
{ begin: PAIRED_DOUBLE_RE("s|tr|y", "\\(", "\\)") },
{ begin: PAIRED_DOUBLE_RE("s|tr|y", "\\[", "\\]") },
{ begin: PAIRED_DOUBLE_RE("s|tr|y", "\\{", "\\}") }
Expand All @@ -424,8 +421,11 @@ export default function(hljs) {
begin: /(m|qr)\/\//,
relevance: 0
},
// prefix is optional with /regex/
{ begin: PAIRED_RE("(?:m|qr)?", /\//, /\//)},
// allow matching common delimiters
{ begin: PAIRED_RE("m|qr", regex.either(...REGEX_DELIMS), /\1/)},
// allow common paired delmins
{ begin: PAIRED_RE("m|qr", /\(/, /\)/)},
{ begin: PAIRED_RE("m|qr", /\[/, /\]/)},
{ begin: PAIRED_RE("m|qr", /\{/, /\}/)}
Expand Down

0 comments on commit 8c011bd

Please sign in to comment.