-
-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathprocessing.js
More file actions
27 lines (26 loc) · 953 Bytes
/
Copy pathprocessing.js
File metadata and controls
27 lines (26 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// @ts-nocheck
/**
* @import {Refractor} from '../lib/core.js'
*/
import refractorClike from './clike.js'
processing.displayName = 'processing'
processing.aliases = []
/** @param {Refractor} Prism */
export default function processing(Prism) {
Prism.register(refractorClike)
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: 'class-name'
}
})
}