Commit 5ee8c55726020f47ec1494d1342f88cf0971b2e4

Michael Schmidt 2021-12-10T14:35:12

Processing: Use standard tokens correctly (#3246)

diff --git a/components/prism-processing.js b/components/prism-processing.js
index f2558d2..a7ac93a 100644
--- a/components/prism-processing.js
+++ b/components/prism-processing.js
@@ -1,18 +1,15 @@
 Prism.languages.processing = Prism.languages.extend('clike', {
 	'keyword': /\b(?:break|case|catch|class|continue|default|else|extends|final|for|if|implements|import|new|null|private|public|return|static|super|switch|this|try|void|while)\b/,
+	// Spaces are allowed between function name and parenthesis
+	'function': /\b\w+(?=\s*\()/,
 	'operator': /<[<=]?|>[>=]?|&&?|\|\|?|[%?]|[!=+\-*\/]=?/
 });
+
 Prism.languages.insertBefore('processing', 'number', {
 	// Special case: XML is a type
 	'constant': /\b(?!XML\b)[A-Z][A-Z\d_]+\b/,
 	'type': {
 		pattern: /\b(?:boolean|byte|char|color|double|float|int|[A-Z]\w*)\b/,
-		alias: 'variable'
+		alias: 'class-name'
 	}
 });
-
-// Spaces are allowed between function name and parenthesis
-Prism.languages.processing['function'] = /\b\w+(?=\s*\()/;
-
-// Class-names is not styled by default
-Prism.languages.processing['class-name'].alias = 'variable';
diff --git a/components/prism-processing.min.js b/components/prism-processing.min.js
index d941bf4..91d36ca 100644
--- a/components/prism-processing.min.js
+++ b/components/prism-processing.min.js
@@ -1 +1 @@
-Prism.languages.processing=Prism.languages.extend("clike",{keyword:/\b(?:break|case|catch|class|continue|default|else|extends|final|for|if|implements|import|new|null|private|public|return|static|super|switch|this|try|void|while)\b/,operator:/<[<=]?|>[>=]?|&&?|\|\|?|[%?]|[!=+\-*\/]=?/}),Prism.languages.insertBefore("processing","number",{constant:/\b(?!XML\b)[A-Z][A-Z\d_]+\b/,type:{pattern:/\b(?:boolean|byte|char|color|double|float|int|[A-Z]\w*)\b/,alias:"variable"}}),Prism.languages.processing.function=/\b\w+(?=\s*\()/,Prism.languages.processing["class-name"].alias="variable";
\ No newline at end of file
+Prism.languages.processing=Prism.languages.extend("clike",{keyword:/\b(?:break|case|catch|class|continue|default|else|extends|final|for|if|implements|import|new|null|private|public|return|static|super|switch|this|try|void|while)\b/,function:/\b\w+(?=\s*\()/,operator:/<[<=]?|>[>=]?|&&?|\|\|?|[%?]|[!=+\-*\/]=?/}),Prism.languages.insertBefore("processing","number",{constant:/\b(?!XML\b)[A-Z][A-Z\d_]+\b/,type:{pattern:/\b(?:boolean|byte|char|color|double|float|int|[A-Z]\w*)\b/,alias:"class-name"}});
\ No newline at end of file