Skip to content

Commit 5ee8c55

Browse files
authoredDec 10, 2021
Processing: Use standard tokens correctly (#3246)
1 parent d30a2da commit 5ee8c55

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed
 

‎components/prism-processing.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
Prism.languages.processing = Prism.languages.extend('clike', {
22
'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/,
3+
// Spaces are allowed between function name and parenthesis
4+
'function': /\b\w+(?=\s*\()/,
35
'operator': /<[<=]?|>[>=]?|&&?|\|\|?|[%?]|[!=+\-*\/]=?/
46
});
7+
58
Prism.languages.insertBefore('processing', 'number', {
69
// Special case: XML is a type
710
'constant': /\b(?!XML\b)[A-Z][A-Z\d_]+\b/,
811
'type': {
912
pattern: /\b(?:boolean|byte|char|color|double|float|int|[A-Z]\w*)\b/,
10-
alias: 'variable'
13+
alias: 'class-name'
1114
}
1215
});
13-
14-
// Spaces are allowed between function name and parenthesis
15-
Prism.languages.processing['function'] = /\b\w+(?=\s*\()/;
16-
17-
// Class-names is not styled by default
18-
Prism.languages.processing['class-name'].alias = 'variable';

‎components/prism-processing.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.