Commit 86d3179317826edc110cf3469f91a3a9e92a46bc

Michael Schmidt 2018-12-01T18:58:10

Remove useless insertBefore in LESS (#1629) Remove an `insertBefore` call which was intended to swap the order of `punctuation` and `function`. But as `function` is already before `punctuation` (in [CSS](https://github.com/PrismJS/prism/blob/master/components/prism-css.js#L18)), it doesn't do anything.

diff --git a/components/prism-less.js b/components/prism-less.js
index 4f3a3d5..e7c42cc 100644
--- a/components/prism-less.js
+++ b/components/prism-less.js
@@ -34,11 +34,6 @@ Prism.languages.less = Prism.languages.extend('css', {
 	'operator': /[+\-*\/]/
 });
 
-// Invert function and punctuation positions
-Prism.languages.insertBefore('less', 'punctuation', {
-	'function': Prism.languages.less.function
-});
-
 Prism.languages.insertBefore('less', 'property', {
 	'variable': [
 		// Variable declaration (the colon must be consumed!)
diff --git a/components/prism-less.min.js b/components/prism-less.min.js
index f8955cb..88f19d8 100644
--- a/components/prism-less.min.js
+++ b/components/prism-less.min.js
@@ -1 +1 @@
-Prism.languages.less=Prism.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-]+?(?:\([^{}]+\)|[^(){};])*?(?=\s*\{)/i,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\([^{}]*\)|[^{};@])*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i,punctuation:/[{}();:,]/,operator:/[+\-*\/]/}),Prism.languages.insertBefore("less","punctuation",{"function":Prism.languages.less.function}),Prism.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-]+.*?(?=[(;])/,lookbehind:!0,alias:"function"}});
\ No newline at end of file
+Prism.languages.less=Prism.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-]+?(?:\([^{}]+\)|[^(){};])*?(?=\s*\{)/i,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\([^{}]*\)|[^{};@])*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i,punctuation:/[{}();:,]/,operator:/[+\-*\/]/}),Prism.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-]+.*?(?=[(;])/,lookbehind:!0,alias:"function"}});
\ No newline at end of file