-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for SuperCollider (#3371)
- Loading branch information
1 parent
dfef9b6
commit 1b1d673
Showing
20 changed files
with
460 additions
and
3 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,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; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,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> |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.