Skip to content

Commit

Permalink
Reason: Regexp optimisation + don't use capture if not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Oct 22, 2017
1 parent 06a9da4 commit 19d79b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/prism-reason.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Prism.languages.reason = Prism.languages.extend('clike', {
lookbehind: true
},
'string': {
pattern: /"(\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
greedy: true
},
// 'class-name' must be matched *after* 'constructor' defined below
Expand All @@ -14,7 +14,7 @@ Prism.languages.reason = Prism.languages.extend('clike', {
});
Prism.languages.insertBefore('reason', 'class-name', {
'character': {
pattern: /'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'])'/,
pattern: /'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,
alias: 'string'
},
'constructor': {
Expand Down
2 changes: 1 addition & 1 deletion components/prism-reason.min.js

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

0 comments on commit 19d79b4

Please sign in to comment.