-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There are now 297 (from 290) syntaxes supported. * Add `bbj`, `bqn`, `cilkc`, `cilkcpp`, `gradle`, `metafont`, `wgsl`, See: <https://github.com/PrismJS/prism/blob/master/CHANGELOG.md#1290-2022-08-23>
- Loading branch information
Showing
21 changed files
with
466 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// @ts-nocheck | ||
bbj.displayName = 'bbj' | ||
bbj.aliases = [] | ||
|
||
/** @type {import('../core.js').Syntax} */ | ||
export default function bbj(Prism) { | ||
;(function (Prism) { | ||
Prism.languages.bbj = { | ||
comment: { | ||
pattern: /(^|[^\\:])rem\s+.*/i, | ||
lookbehind: true, | ||
greedy: true | ||
}, | ||
string: { | ||
pattern: /(['"])(?:(?!\1|\\).|\\.)*\1/, | ||
greedy: true | ||
}, | ||
number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, | ||
keyword: | ||
/\b(?:abstract|all|argc|begin|bye|callback|case|chn|class|classend|ctl|day|declare|delete|dim|dom|dread|dsz|else|end|endif|err|exitto|extends|fi|field|for|from|gosub|goto|if|implements|interface|interfaceend|iol|iolist|let|list|load|method|methodend|methodret|on|opts|pfx|print|private|process_events|protected|psz|public|read|read_resource|release|remove_callback|repeat|restore|return|rev|seterr|setesc|sqlchn|sqlunt|ssn|start|static|swend|switch|sys|then|tim|unt|until|use|void|wend|where|while)\b/i, | ||
function: /\b\w+(?=\()/, | ||
boolean: /\b(?:BBjAPI\.TRUE|BBjAPI\.FALSE)\b/i, | ||
operator: /<[=>]?|>=?|[+\-*\/^=&]|\b(?:and|not|or|xor)\b/i, | ||
punctuation: /[.,;:()]/ | ||
} | ||
})(Prism) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// @ts-nocheck | ||
bqn.displayName = 'bqn' | ||
bqn.aliases = [] | ||
|
||
/** @type {import('../core.js').Syntax} */ | ||
export default function bqn(Prism) { | ||
Prism.languages.bqn = { | ||
shebang: { | ||
pattern: /^#![ \t]*\/.*/, | ||
alias: 'important', | ||
greedy: true | ||
}, | ||
comment: { | ||
pattern: /#.*/, | ||
greedy: true | ||
}, | ||
'string-literal': { | ||
pattern: /"(?:[^"]|"")*"/, | ||
greedy: true, | ||
alias: 'string' | ||
}, | ||
'character-literal': { | ||
pattern: /'(?:[\s\S]|[\uD800-\uDBFF][\uDC00-\uDFFF])'/, | ||
greedy: true, | ||
alias: 'char' | ||
}, | ||
function: /•[\w¯.∞π]+[\w¯.∞π]*/, | ||
'dot-notation-on-brackets': { | ||
pattern: /\{(?=.*\}\.)|\}\./, | ||
alias: 'namespace' | ||
}, | ||
'special-name': { | ||
pattern: /(?:𝕨|𝕩|𝕗|𝕘|𝕤|𝕣|𝕎|𝕏|𝔽|𝔾|𝕊|_𝕣_|_𝕣)/, | ||
alias: 'keyword' | ||
}, | ||
'dot-notation-on-name': { | ||
pattern: /[A-Za-z_][\w¯∞π]*\./, | ||
alias: 'namespace' | ||
}, | ||
'word-number-scientific': { | ||
pattern: /\d+(?:\.\d+)?[eE]¯?\d+/, | ||
alias: 'number' | ||
}, | ||
'word-name': { | ||
pattern: /[A-Za-z_][\w¯∞π]*/, | ||
alias: 'symbol' | ||
}, | ||
'word-number': { | ||
pattern: | ||
/[¯∞π]?(?:\d*\.?\b\d+(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π))?/, | ||
alias: 'number' | ||
}, | ||
'null-literal': { | ||
pattern: /@/, | ||
alias: 'char' | ||
}, | ||
'primitive-functions': { | ||
pattern: /[-+×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍⋈↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!]/, | ||
alias: 'operator' | ||
}, | ||
'primitive-1-operators': { | ||
pattern: /[`˜˘¨⁼⌜´˝˙]/, | ||
alias: 'operator' | ||
}, | ||
'primitive-2-operators': { | ||
pattern: /[∘⊸⟜○⌾⎉⚇⍟⊘◶⎊]/, | ||
alias: 'operator' | ||
}, | ||
punctuation: /[←⇐↩(){}⟨⟩[\]‿·⋄,.;:?]/ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// @ts-nocheck | ||
import refractorC from './c.js' | ||
cilkc.displayName = 'cilkc' | ||
cilkc.aliases = ['cilk-c'] | ||
|
||
/** @type {import('../core.js').Syntax} */ | ||
export default function cilkc(Prism) { | ||
Prism.register(refractorC) | ||
Prism.languages.cilkc = Prism.languages.insertBefore('c', 'function', { | ||
'parallel-keyword': { | ||
pattern: /\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/, | ||
alias: 'keyword' | ||
} | ||
}) | ||
Prism.languages['cilk-c'] = Prism.languages['cilkc'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// @ts-nocheck | ||
import refractorCpp from './cpp.js' | ||
cilkcpp.displayName = 'cilkcpp' | ||
cilkcpp.aliases = ['cilk', 'cilk-cpp'] | ||
|
||
/** @type {import('../core.js').Syntax} */ | ||
export default function cilkcpp(Prism) { | ||
Prism.register(refractorCpp) | ||
Prism.languages.cilkcpp = Prism.languages.insertBefore('cpp', 'function', { | ||
'parallel-keyword': { | ||
pattern: /\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/, | ||
alias: 'keyword' | ||
} | ||
}) | ||
Prism.languages['cilk-cpp'] = Prism.languages['cilkcpp'] | ||
Prism.languages['cilk'] = Prism.languages['cilkcpp'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// @ts-nocheck | ||
import refractorClike from './clike.js' | ||
gradle.displayName = 'gradle' | ||
gradle.aliases = [] | ||
|
||
/** @type {import('../core.js').Syntax} */ | ||
export default function gradle(Prism) { | ||
Prism.register(refractorClike) | ||
;(function (Prism) { | ||
var interpolation = { | ||
pattern: /((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/, | ||
lookbehind: true, | ||
inside: { | ||
'interpolation-punctuation': { | ||
pattern: /^\$\{?|\}$/, | ||
alias: 'punctuation' | ||
}, | ||
expression: { | ||
pattern: /[\s\S]+/, | ||
inside: null | ||
} | ||
} | ||
} | ||
Prism.languages.gradle = Prism.languages.extend('clike', { | ||
string: { | ||
pattern: /'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/, | ||
greedy: true | ||
}, | ||
keyword: | ||
/\b(?:apply|def|dependencies|else|if|implementation|import|plugin|plugins|project|repositories|repository|sourceSets|tasks|val)\b/, | ||
number: | ||
/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i, | ||
operator: { | ||
pattern: | ||
/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/, | ||
lookbehind: true | ||
}, | ||
punctuation: /\.+|[{}[\];(),:$]/ | ||
}) | ||
Prism.languages.insertBefore('gradle', 'string', { | ||
shebang: { | ||
pattern: /#!.+/, | ||
alias: 'comment', | ||
greedy: true | ||
}, | ||
'interpolation-string': { | ||
pattern: | ||
/"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/, | ||
greedy: true, | ||
inside: { | ||
interpolation: interpolation, | ||
string: /[\s\S]+/ | ||
} | ||
} | ||
}) | ||
Prism.languages.insertBefore('gradle', 'punctuation', { | ||
'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/ | ||
}) | ||
Prism.languages.insertBefore('gradle', 'function', { | ||
annotation: { | ||
pattern: /(^|[^.])@\w+/, | ||
lookbehind: true, | ||
alias: 'punctuation' | ||
} | ||
}) | ||
interpolation.inside.expression.inside = Prism.languages.gradle | ||
})(Prism) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.