Skip to content

Commit

Permalink
Merge pull request #104 from woolgathering/pr
Browse files Browse the repository at this point in the history
Updated keywords and syntax, updated README
  • Loading branch information
crucialfelix authored Mar 20, 2020
2 parents 00b5f5c + 6c52faa commit b7b8eb8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ See the [supercollider.js configuration documentation](http://supercolliderjs.re

`"C:\Program Files\SuperCollider\sclang.exe"`

## Themes

A couple SuperCollider-specific themes have been created to add symbol colorization, argument tags, argument parameters in pipes, and function names when using functional notation: [Woolgathering Light Syntax](https://atom.io/themes/woolgathering-light-syntax) and [Woolgathering Dark Syntax](https://atom.io/themes/woolgathering-dark-syntax).

## Missing Features

Expand Down
19 changes: 18 additions & 1 deletion grammars/supercollider.cson
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'name': 'SuperCollider'
'patterns': [
{
'match': '\\b(arg|var|classvar|const|this|thisThread|thisMethod|thisFunction|thisProcess|true|false|inf|nil)\\b'
'match': '\\b(arg|var|classvar|const|this|thisThread|thisMethod|thisFunction|thisProcess|true|false|inf|nil|for|forBy|if|switch|which|case|pi|super|const)\\b'
'name': 'keyword.control.supercollider'
}
{
Expand Down Expand Up @@ -59,6 +59,19 @@
'name': 'entity.name.class.supercollider'
'match': '[^a-zA-Z0-9\\\\]([A-Z_]{1}[a-zA-Z0-9_]*)[^a-zA-Z0-9_]'
}
{
'match': '([a-zA-Z\d])+:'
'name': 'entity.name.argument.supercollider'
}
# find *pi as keyword
{
'match': '([0-9\d])+pi'
'name': 'keyword.control.supercollider'
}
{
'match': '^(?<=\s)([a-zA-Z\d])+(?=\(.\))'
'name': 'entity.name.functionname.supercollider'
}
{
'match': '\\\\[a-zA-Z0-9\\_]+'
'name': 'entity.name.symbol.supercollider'
Expand All @@ -82,6 +95,10 @@
'end': '\\*\\/'
'name': 'comment.multiline.supercollider'
}
{
'match': '(^[a-z]{1}\\w+)(?=\\()'
'name': 'entity.name.functional-name.supercollider'
}
{
'comment': 'source: ruby bundle'
'match': '\\b(0[xX][0-9A-Fa-f](?>_?[0-9A-Fa-f])*|\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?|0[bB][01]+)\\b'
Expand Down
1 change: 1 addition & 0 deletions keymaps/supercollider.cson
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
'ctrl-shift-h': 'supercollider:open-help-file'
'alt-shift-b': 'supercollider:boot-server'
'alt-shift-q': 'supercollider:quit-server'
'shift-alt-ctrl-x': 'supercollider:quit-lang'

# OS X
'.platform-darwin atom-workspace':
Expand Down
5 changes: 5 additions & 0 deletions lib/controller.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class Controller
'supercollider:cmd-period', => @cmdPeriod()
atom.commands.add 'atom-workspace',
'supercollider:boot-server', => @bootServer()
atom.commands.add 'atom-workspace',
'supercollider:quit-lang', => @quitLang()
atom.commands.add 'atom-workspace',
'supercollider:quit-server', => @quitServer()
atom.commands.add 'atom-workspace',
Expand Down Expand Up @@ -168,6 +170,9 @@ class Controller
quitServer: () ->
@evalWithRepl('Server.default.quit;')

quitLang: () ->
@evalWithRepl('0.exit;')

rebootServer: () ->
@evalWithRepl('Server.default.reboot;')

Expand Down

0 comments on commit b7b8eb8

Please sign in to comment.