Commit 7547f839e55228cd804c7f985cbe8fb1e919f166

Golmote 2017-10-22T14:33:58

Erlang: Regexp optimisation

diff --git a/components/prism-erlang.js b/components/prism-erlang.js
index e50d9ba..ee6815c 100644
--- a/components/prism-erlang.js
+++ b/components/prism-erlang.js
@@ -1,15 +1,15 @@
 Prism.languages.erlang = {
 	'comment': /%.+/,
 	'string': {
-		pattern: /"(?:\\?.)*?"/,
+		pattern: /"(?:\\.|[^\\"\r\n])*"/,
 		greedy: true
 	},
 	'quoted-function': {
-		pattern: /'(?:\\.|[^'\\])+'(?=\()/,
+		pattern: /'(?:\\.|[^\\'\r\n])+'(?=\()/,
 		alias: 'function'
 	},
 	'quoted-atom': {
-		pattern: /'(?:\\.|[^'\\])+'/,
+		pattern: /'(?:\\.|[^\\'\r\n])+'/,
 		alias: 'atom'
 	},
 	'boolean': /\b(?:true|false)\b/,
diff --git a/components/prism-erlang.min.js b/components/prism-erlang.min.js
index 95f2986..02724bf 100644
--- a/components/prism-erlang.min.js
+++ b/components/prism-erlang.min.js
@@ -1 +1 @@
-Prism.languages.erlang={comment:/%.+/,string:{pattern:/"(?:\\?.)*?"/,greedy:!0},"quoted-function":{pattern:/'(?:\\.|[^'\\])+'(?=\()/,alias:"function"},"quoted-atom":{pattern:/'(?:\\.|[^'\\])+'/,alias:"atom"},"boolean":/\b(?:true|false)\b/,keyword:/\b(?:fun|when|case|of|end|if|receive|after|try|catch)\b/,number:[/\$\\?./,/\d+#[a-z0-9]+/i,/(?:\b|-)\d*\.?\d+([Ee][+-]?\d+)?\b/],"function":/\b[a-z][\w@]*(?=\()/,variable:{pattern:/(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,lookbehind:!0},operator:[/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:bnot|div|rem|band|bor|bxor|bsl|bsr|not|and|or|xor|orelse|andalso)\b/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],atom:/\b[a-z][\w@]*/,punctuation:/[()[\]{}:;,.#|]|<<|>>/};
\ No newline at end of file
+Prism.languages.erlang={comment:/%.+/,string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},"quoted-function":{pattern:/'(?:\\.|[^\\'\r\n])+'(?=\()/,alias:"function"},"quoted-atom":{pattern:/'(?:\\.|[^\\'\r\n])+'/,alias:"atom"},"boolean":/\b(?:true|false)\b/,keyword:/\b(?:fun|when|case|of|end|if|receive|after|try|catch)\b/,number:[/\$\\?./,/\d+#[a-z0-9]+/i,/(?:\b|-)\d*\.?\d+([Ee][+-]?\d+)?\b/],"function":/\b[a-z][\w@]*(?=\()/,variable:{pattern:/(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,lookbehind:!0},operator:[/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:bnot|div|rem|band|bor|bxor|bsl|bsr|not|and|or|xor|orelse|andalso)\b/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],atom:/\b[a-z][\w@]*/,punctuation:/[()[\]{}:;,.#|]|<<|>>/};
\ No newline at end of file