Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for SuperCollider #3371

Merged
merged 2 commits into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,11 @@
"title": "Stylus",
"owner": "vkbansal"
},
"supercollider": {
"title": "SuperCollider",
"alias": "sclang",
"owner": "RunDevelopment"
},
"swift": {
"title": "Swift",
"owner": "chrischares"
Expand Down
36 changes: 36 additions & 0 deletions components/prism-supercollider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Prism.languages.supercollider = {
'comment': {
pattern: /\/\/.*|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\//,
greedy: true
},
'string': {
pattern: /(^|[^\\])"(?:[^"\\]|\\[\s\S])*"/,
lookbehind: true,
greedy: true
},
'char': {
pattern: /\$(?:[^\\\r\n]|\\.)/,
greedy: true
},
'symbol': {
pattern: /(^|[^\\])'(?:[^'\\]|\\[\s\S])*'|\\\w+/,
lookbehind: true,
greedy: true
},

'keyword': /\b(?:_|arg|classvar|const|nil|var|while)\b/,
'boolean': /\b(?:false|true)\b/,

'label': {
pattern: /\b[a-z_]\w*(?=\s*:)/,
alias: 'property'
},

'number': /\b(?:inf|pi|0x[0-9a-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(?:pi)?|\d+r[0-9a-zA-Z]+(?:\.[0-9a-zA-Z]+)?|\d+[sb]{1,4}\d*)\b/,
'class-name': /\b[A-Z]\w*\b/,

'operator': /\.{2,3}|#(?![[{])|&&|[!=]==?|\+>>|\+{1,3}|-[->]|=>|>>|\?\?|@\|?@|\|(?:@|[!=]=)?\||!\?|<[!=>]|\*{1,2}|<{2,3}\*?|[-!%&/<>?@|=`]/,
'punctuation': /[{}()[\].:,;]|#[[{]/
};

Prism.languages.sclang = Prism.languages.supercollider;
1 change: 1 addition & 0 deletions components/prism-supercollider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions examples/prism-supercollider.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<h2>Full Example</h2>
<pre><code>// Source: https://supercollider.github.io/
// modulate a sine frequency and a noise amplitude with another sine
// whose frequency depends on the horizontal mouse pointer position
{
var x = SinOsc.ar(MouseX.kr(1, 100));
SinOsc.ar(300 * x + 800, 0, 0.1)
+
PinkNoise.ar(0.1 * x + 0.1)
}.play;
</code></pre>
1 change: 1 addition & 0 deletions plugins/autoloader/prism-autoloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
"sol": "solidity",
"sln": "solution-file",
"rq": "sparql",
"sclang": "supercollider",
"t4": "t4-cs",
"trickle": "tremor",
"troy": "tremor",
Expand Down
2 changes: 1 addition & 1 deletion plugins/autoloader/prism-autoloader.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions plugins/show-language/prism-show-language.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@
"sqf": "SQF: Status Quo Function (Arma 3)",
"sql": "SQL",
"iecst": "Structured Text (IEC 61131-3)",
"supercollider": "SuperCollider",
"sclang": "SuperCollider",
"systemd": "Systemd configuration file",
"t4-templating": "T4 templating",
"t4-cs": "T4 Text Templates (C#)",
Expand Down
Loading