Skip to content

Commit

Permalink
Smarty: Regexp optimisation and simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Oct 22, 2017
1 parent 41a2c76 commit e169be9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/prism-smarty.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
pattern: /^\{|\}$/i,
alias: 'punctuation'
},
'string': /(["'])(?:\\?.)*?\1/,
'string': /(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,
'number': /\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee][-+]?\d+)?)\b/,
'variable': [
/\$(?!\d)\w+/,
Expand Down Expand Up @@ -52,7 +52,7 @@
}
},
'punctuation': [
/[\[\]().,:`]|\->/
/[\[\]().,:`]|->/
],
'operator': [
/[+\-*\/%]|==?=?|[!<>]=?|&&|\|\|?/,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-smarty.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e169be9

Please sign in to comment.