-
-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathphp-extras.js
More file actions
27 lines (26 loc) · 702 Bytes
/
Copy pathphp-extras.js
File metadata and controls
27 lines (26 loc) · 702 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 refractorPhp from './php.js'
phpExtras.displayName = 'php-extras'
phpExtras.aliases = []
/** @param {Refractor} Prism */
export default function phpExtras(Prism) {
Prism.register(refractorPhp)
Prism.languages.insertBefore('php', 'variable', {
this: {
pattern: /\$this\b/,
alias: 'keyword'
},
global:
/\$(?:GLOBALS|HTTP_RAW_POST_DATA|_(?:COOKIE|ENV|FILES|GET|POST|REQUEST|SERVER|SESSION)|argc|argv|http_response_header|php_errormsg)\b/,
scope: {
pattern: /\b[\w\\]+::/,
inside: {
keyword: /\b(?:parent|self|static)\b/,
punctuation: /::|\\/
}
}
})
}