diff --git a/docs/SOUL_Language.md b/docs/SOUL_Language.md index b98ef39..32914a3 100644 --- a/docs/SOUL_Language.md +++ b/docs/SOUL_Language.md @@ -214,7 +214,7 @@ float getAnArrayElement (float[] a, int index) { return a.at (index); } To avoid confusion with fixed-size array indexes needing to use the `wrap` or `clamp` types, the `array[index]` syntax is not allowed on dynamic slices. Instead, you can use the following accessor methods: `array.at (index)` - this casts the index argument to an integer (rounding down if it's a floating point value), wraps it if it's out-of-range, and returns the element at that index. -`array.read (index)` - (essentially a synonum for `at`) +`array.read (index)` - (essentially a synonym for `at`) `array.readLinearInterpolated (index)` - returns the linearly-interpolated value at the fractional position (after wrapping it if it's out-of-bounds). This us only available for arrays of floating-point types. Other interpolators such as LaGrange, Catmull-Rom, etc, may be added in future releases. @@ -334,7 +334,7 @@ Where the runtime is providing an audio sample, you can add the annotation: external float[] audioFileData [[ resample: 48000 ]]; ``` -...which will tell the runtime to pre-process the audio file (or buffer) provided so that it is resampled to the given rate. The runtime will use a high-queality interpolator and there'll be no run-time overhead once the code is running. +...which will tell the runtime to pre-process the audio file (or buffer) provided so that it is resampled to the given rate. The runtime will use a high-quality interpolator and there'll be no run-time overhead once the code is running. You can also use the annotation 'sourceChannel' to pull out a specific channel from the file: diff --git a/docs/SOUL_Overview.md b/docs/SOUL_Overview.md index 3876120..1f800f1 100644 --- a/docs/SOUL_Overview.md +++ b/docs/SOUL_Overview.md @@ -56,7 +56,7 @@ We expect SOUL to be valuable to audio developers at all levels - from absolute ### Who is the target audience for the SOUL platform architecture? -At the high-end, SOUL will allow musicians to connect external accelarator devices to work on larger, more power-hungry sessions with much lower latency, while freeing up their laptop CPUs to handle the UI for their tools. +At the high-end, SOUL will allow musicians to connect external accelerator devices to work on larger, more power-hungry sessions with much lower latency, while freeing up their laptop CPUs to handle the UI for their tools. At a more general consumer level, SOUL can improve power and battery life for mobile devices that support it with dedicated hardware. And by providing a flexible platform for implementing audio codecs, it could be a more future-proof replacement for silicon which is dedicated to performing decompression of specific common codec formats. @@ -150,7 +150,7 @@ The main concepts involved in this API are **Performers** and **Venues**. - A *Performer* is an implementation of a JIT compiler which can be given a SOUL program and asked to synchronously render blocks of data. -- A *Venue* is an independant device (e.g. a machine accessed via a network, or a separate process or driver running on your local machine), which can be sent a SOUL program to run, and then controlled remotely and asynchronously. +- A *Venue* is an independent device (e.g. a machine accessed via a network, or a separate process or driver running on your local machine), which can be sent a SOUL program to run, and then controlled remotely and asynchronously. A developer can build a SOUL host which either compiles and runs SOUL synchronously inside its own process using a *performer*, or which dispatches the code to run remotely (and at low latency) in a suitable *venue*. Either way, using these APIs means that the programs are not limited to simple audio/MIDI i/o like the SOUL Patch format, and can have input and output channels containing any kind of data stream. diff --git a/source/API/soul_patch/API/soul_patch_Library.h b/source/API/soul_patch/API/soul_patch_Library.h index 5d8aa3f..b3ba42d 100644 --- a/source/API/soul_patch/API/soul_patch_Library.h +++ b/source/API/soul_patch/API/soul_patch_Library.h @@ -25,7 +25,7 @@ static constexpr int currentLibraryAPIVersion = 0x1005; /** Dynamically opens and connects to the shared library containing the patch loader. You should only create a single instance of this class. and use it in an RAII - style, making sure it lives longer than all the objects that orginate from it. + style, making sure it lives longer than all the objects that originate from it. */ struct SOULPatchLibrary { diff --git a/source/README.md b/source/README.md index 62cac1a..b9c957c 100644 --- a/source/README.md +++ b/source/README.md @@ -13,7 +13,7 @@ The low-level C++ source code for various compiler tasks is arranged as JUCE mod - `modules/soul_patch_loader` - this module implements a lot of the glue logic required to turn a `soul::Performer` into a set of COM classes which implement the SOUL Patch API - `API/soul_patch/API` - This contains the completely dependency-free C++ header-only COM base classes which define the SOUL Patch API -- `API/soul_patch/helper_classes` - A set of header-only C++ utlities providing various client-side helpers for dealing with the SOUL Patch API. This includes classes to load patches as a `juce::AudioPluginInstance` +- `API/soul_patch/helper_classes` - A set of header-only C++ utilities providing various client-side helpers for dealing with the SOUL Patch API. This includes classes to load patches as a `juce::AudioPluginInstance` ### Current Project Status diff --git a/source/modules/soul_core/diagnostics/soul_Errors.h b/source/modules/soul_core/diagnostics/soul_Errors.h index 0673bb5..6d97735 100644 --- a/source/modules/soul_core/diagnostics/soul_Errors.h +++ b/source/modules/soul_core/diagnostics/soul_Errors.h @@ -179,7 +179,7 @@ namespace soul X(expectedUnqualifiedName, "This name cannot have a namespace qualifier") \ X(qualifierOnGeneric, "Generic function types must be a non-qualified identifier") \ X(tooManyParameters, "Too many function parameters") \ - X(tooManyInitialisers, "Initialiser list exceeeds max length limit") \ + X(tooManyInitialisers, "Initialiser list exceeds max length limit") \ X(cannotPassConstAsNonConstRef, "Cannot pass a const value as a non-const reference") \ X(assignmentInsideExpression, "Assignment is not allowed inside an expression") \ X(propertiesOutsideProcessor, "Processor properties are only valid inside a processor declaration") \ diff --git a/tools/editors/atom/heart/grammars/heart.cson b/tools/editors/atom/heart/grammars/heart.cson new file mode 100644 index 0000000..809a59c --- /dev/null +++ b/tools/editors/atom/heart/grammars/heart.cson @@ -0,0 +1,181 @@ +scopeName: 'source.heart' +name: 'HEART' +fileTypes: ['heart'] +patterns: [ + { + name: 'keyword.control.heart' + match: '\\b(branch_if|branch|return)\\b' + } + { + name: 'storage.type.heart' + match: '\\b(void|int|int32|int64|float|float32|float64|bool|string|(wrap|clamp)(?=\\s*<))\\b' + } + { + name: 'storage.class.heart' + match: '''\\b(event|stream|value|node)(?=[\\s+|{])\\b''' + } + { + name: 'storage.modifier.core.heart' + match: '\\b(const|fixed|external)\\b' + } + { + name: 'entity.name.type.heart' + match: '\\b(let|var|input|output|connection|import)\\b' + } + { + name: 'entity.name.tag.heart' + match: '\\b(none|latch|linear|sinc|fast|best)\\b' + } + { + name: 'entity.name.function.heart' + match: '\\b(read|write|advance|cast|call)\\b' + } + { + name: 'entity.name.section.heart' + match: '[@]\\w+\\b' + } + { + name: 'variable.other.heart' + match: '[$]\\w+\\b' + } + { + name: 'invalid.illegal.heart' + match: '\\b(try|catch|throw|class|default|operator|switch|case)\\b' + } + { + name: 'comment.line.number-sign.heart' + begin: '#' + beginCaptures: + '0': + name: 'punctuation.definition.comment.cpp' + end: '(?=\\n)' + patterns: [ + { + match: '(\\\\)\\n' + } + ] + } + { + match: '->|<-' + name: 'keyword.other.heart' + } + { + match: '<<|>>' + name: 'keyword.other.heart' + } + { + match: '\\.|::' + name: 'punctuation.separator.heart' + } + { + match: ';' + name: 'punctuation.terminator.heart' + } + { + match: '=' + name: 'keyword.operator.assignment.heart' + } + { + match: '%|\\*|/|-|\\+' + name: 'keyword.operator.heart' + } + { + match: '\\b(true|false)\\b' + name: 'constant.language.heart' + } + { + match: '\\b(processor(?=[.]))\\b' + name: 'support.constant.core.heart' + } + { + match: '\\b[0-9]+[.]([0-9]+)?[f]?([e][+-]?[0-9]+)?[f]?\\b' + name: 'constant.numeric.float.heart' + } + { + match: '\\b[0-9]+(L)?\\b' + name: 'constant.numeric.integer.decimal.heart' + } + { + match: '\\b0x[a-fA-F0-9]+(L)?\\b' + name: 'constant.numeric.integer.hexadecimal.heart' + } + { + match: '\\b0o[0-7]+(L)?\\b' + name: 'constant.numeric.integer.octal.heart' + } + { + match: '\\b0b[01]+(L)?\\b' + name: 'constant.numeric.integer.binary.heart' + } + { + match: '\\b([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\s*\\(' + captures: + '1': + name: 'entity.name.function.heart' + } + { + match: '\\b(function)\\s+([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\s*\\(' + captures: + '1': + name: 'storage.type.heart' + '2': + name: 'entity.name.function.heart' + } + { + comment: 'Module declaration' + match: '\\b(graph|processor|namespace)\\s+([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_(::)]+)\\b' + captures: + '1': + name: 'storage.type.heart' + '2': + name: 'entity.name.type.heart' + } + { + comment: 'Type declaration' + begin: '\\b(enum|struct)\\s+([a-zA-Z_][a-zA-Z0-9_]*)' + end: '[\\{\\(]' + beginCaptures: + '1': + name: 'storage.type.heart' + '2': + name: 'entity.name.type.heart' + patterns: [ + { + match: '\\b(enum|struct)\\b' + name: 'keyword.other.type-decl.heart' + } + ] + } + { + match: '(\\[)|(\\])' + captures: + '1': + name: 'punctuation.definition.begin.bracket.square.heart' + '2': + name: 'punctuation.definition.end.bracket.square.heart' + } + { + match: '(\\[\\[)|(\\]\\])' + captures: + '1': + name: 'punctuation.definition.block.begin.bracket.square.heart' + '2': + name: 'punctuation.definition.block.end.bracket.square.heart' + } + { + name: 'string.quoted.double.heart' + begin: '"' + end: '"' + patterns: [ + { + name: 'constant.character.escape.heart' + match: '\\\\.' + } + ] + } + { + name: 'keyword.control.directive.heart' + begin: '^##' + end: '(?=\\n)' + } +] diff --git a/tools/editors/atom/heart/package.json b/tools/editors/atom/heart/package.json new file mode 100644 index 0000000..12c57d5 --- /dev/null +++ b/tools/editors/atom/heart/package.json @@ -0,0 +1,11 @@ +{ + "name": "language-heart", + "version": "0.0.1", + "description": "Syntax highlighting for HEART", + "repository": "https://github.com/nicochatzi/SOUL", + "license": "MIT", + "engines": { + "atom": "*" + }, + "dependencies": {} + } \ No newline at end of file diff --git a/tools/editors/atom/soul/grammars/soul.cson b/tools/editors/atom/soul/grammars/soul.cson new file mode 100644 index 0000000..29838e0 --- /dev/null +++ b/tools/editors/atom/soul/grammars/soul.cson @@ -0,0 +1,209 @@ +scopeName: 'source.soul' +name: 'SOUL' +fileTypes: ['soul'] +patterns: [ + { + name: 'keyword.control.soul' + match: '\\b(if|else|do|while|for|loop|break|continue|return)\\b' + } + { + name: 'storage.type.core.soul' + match: '\\b(void|int|int32|int64|float|float32|float64|bool|string|(wrap|clamp)(?=\\s*<))\\b' + } + { + name: 'storage.class.soul' + match: '\\b(event|stream|value)(?=[\\s+|{])\\b' + } + { + name: 'storage.modifier.core.soul' + match: '\\b(const|fixed|external)\\b' + } + { + name: 'entity.name.type.soul' + match: '\\b(let|var|input|output|connection|import)\\b' + } + { + name: 'invalid.illegal.soul' + match: '\\b(try|catch|throw|class|default|operator|switch|case)\\b' + } + { + name: 'comment.block.soul' + begin: '/\\*' + beginCaptures: + '0': + name: 'punctuation.definition.comment.begin.c' + end: '\\*/' + endCaptures: + '0': + name: 'punctuation.definition.comment.end.c' + } + { + name: 'invalid.illegal.stray-comment-end.soul' + match: '\\*/.*\\n' + } + { + name: 'comment.line.double-slash.soul' + begin: '//' + beginCaptures: + '0': + name: 'punctuation.definition.comment.cpp' + end: '(?=\\n)' + patterns: [ + { + match: '(\\\\)\\n' + } + ] + } + { + match: '--' + name: 'keyword.operator.decrement.soul' + } + { + match: '\\+\\+' + name: 'keyword.operator.increment.soul' + } + { + match: '->|<-' + name: 'keyword.other.soul' + } + { + match: '%=|\\+=|-=|\\*=' + name: 'keyword.operator.assignment.compound.soul' + } + { + match: '&=|\\^=|<<=|>>=|\\|=' + name: 'keyword.operator.assignment.compound.bitwise.soul' + } + { + match: '<<|>>' + name: 'keyword.other.soul' + } + { + match: '!=|<=|>=|==|<|>' + name: 'keyword.operator.comparison.soul' + } + { + match: '&&|!|\\|\\|' + name: 'keyword.operator.logical.soul' + } + { + match: '&|\\||\\^|~' + name: 'keyword.operator.soul' + } + { + match: '\\.|::' + name: 'punctuation.separator.soul' + } + { + match: ';' + name: 'punctuation.terminator.soul' + } + { + match: '=' + name: 'keyword.operator.assignment.soul' + } + { + match: '%|\\*|/|-|\\+|\\?|\\:' + name: 'keyword.operator.soul' + } + { + match: '\\b(true|false)\\b' + name: 'constant.language.soul' + } + { + match: '\\b(processor(?=[.]))\\b' + name: 'support.constant.core.soul' + } + { + match: '\\b[0-9]+[.]([0-9]+)?[_]?([f](32|64)?)?([e][+-]?[0-9]+)?[_]?([f](32|64)?)?\\b' + name: 'constant.numeric.float.soul' + } + { + match: '\\b[0-9]+(_)?(([i](32|64))|L)?\\b' + name: 'constant.numeric.integer.decimal.soul' + } + { + match: '\\b0x[a-fA-F0-9]+(_)?(([i](32|64))|L)?\\b' + name: 'constant.numeric.integer.hexadecimal.soul' + } + { + match: '\\b0o[0-7]+(_)?(([i](32|64))|L)?\\b' + name: 'constant.numeric.integer.octal.soul' + } + { + match: '\\b0b[01]+(_)?(([i](32|64))|L)?\\b' + name: 'constant.numeric.integer.binary.soul' + } + { + match: '\\b([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\s*\\(' + captures: + '1': + name: 'entity.name.function.soul' + } + { + comment: 'Module declaration' + match: '\\b(graph|processor|namespace)\\s+([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\b' + captures: + '1': + name: 'storage.type.soul' + '2': + name: 'entity.name.type.soul' + } + { + comment: 'Type declaration' + begin: '\\b(enum|struct)\\s+([a-zA-Z_][a-zA-Z0-9_]*)' + end: '[\\{\\(]' + beginCaptures: + '1': + name: 'storage.type.soul' + '2': + name: 'entity.name.type.soul' + patterns: [ + { + match: '\\b(enum|struct)\\b' + name: 'keyword.other.type-decl.soul' + } + ] + } + { + comment: 'Type alias' + match: '\\b(using)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\b' + captures: + '1': + name: 'storage.type.soul' + '2': + name: 'entity.name.type.soul' + } + { + match: '(\\[)|(\\])' + captures: + '1': + name: 'punctuation.definition.begin.bracket.square.soul' + '2': + name: 'punctuation.definition.end.bracket.square.soul' + } + { + match: '(\\[\\[)|(\\]\\])' + captures: + '1': + name: 'punctuation.definition.block.begin.bracket.square.soul' + '2': + name: 'punctuation.definition.block.end.bracket.square.soul' + } + { + name: 'string.quoted.double.soul' + begin: '"' + end: '"' + patterns: [ + { + name: 'constant.character.escape.soul' + match: '\\\\.' + } + ] + } + { + name: 'keyword.control.directive.soul' + begin: '^##' + end: '(?=\\n)' + } +] \ No newline at end of file diff --git a/tools/editors/atom/soul/package.json b/tools/editors/atom/soul/package.json new file mode 100644 index 0000000..aa08de6 --- /dev/null +++ b/tools/editors/atom/soul/package.json @@ -0,0 +1,11 @@ +{ + "name": "language-soul", + "version": "0.0.1", + "description": "Syntax highlighting for SOUL", + "repository": "https://github.com/nicochatzi/SOUL", + "license": "MIT", + "engines": { + "atom": "*" + }, + "dependencies": {} + } \ No newline at end of file diff --git a/tools/editors/vs_code_extension/heart/.vscode/launch.json b/tools/editors/vs_code_extension/heart/.vscode/launch.json new file mode 100644 index 0000000..7bc18a4 --- /dev/null +++ b/tools/editors/vs_code_extension/heart/.vscode/launch.json @@ -0,0 +1,18 @@ +// A launch configuration that launches the extension inside a new window +// Use IntelliSense to learn about possible attributes. +// Hover to view descriptions of existing attributes. +// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Extension", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ] + } + ] +} \ No newline at end of file diff --git a/tools/editors/vs_code_extension/heart/language-configuration.json b/tools/editors/vs_code_extension/heart/language-configuration.json new file mode 100644 index 0000000..dbcefab --- /dev/null +++ b/tools/editors/vs_code_extension/heart/language-configuration.json @@ -0,0 +1,28 @@ +{ + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": "#", + }, + // symbols used as brackets + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + // symbols that are auto closed when typing + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + // symbols that that can be used to surround a selection + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/tools/editors/vs_code_extension/heart/package.json b/tools/editors/vs_code_extension/heart/package.json new file mode 100644 index 0000000..dd7f573 --- /dev/null +++ b/tools/editors/vs_code_extension/heart/package.json @@ -0,0 +1,25 @@ +{ + "name": "heart", + "displayName": "heart", + "description": "HEART language support", + "version": "0.0.1", + "engines": { + "vscode": "^1.32.0" + }, + "categories": [ + "Programming Languages" + ], + "contributes": { + "languages": [{ + "id": "heart", + "aliases": ["HEART", "heart"], + "extensions": [".heart",".hearttest"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "heart", + "scopeName": "source.heart", + "path": "./syntaxes/heart.tmLanguage.json" + }] + } +} \ No newline at end of file diff --git a/tools/editors/vs_code_extension/heart/syntaxes/heart.tmLanguage.json b/tools/editors/vs_code_extension/heart/syntaxes/heart.tmLanguage.json new file mode 100644 index 0000000..6724e66 --- /dev/null +++ b/tools/editors/vs_code_extension/heart/syntaxes/heart.tmLanguage.json @@ -0,0 +1,241 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "HEART", + "scopeName": "source.heart", + "patterns": [ + { + "name": "keyword.control.heart", + "match": "\\b(branch_if|branch|return)\\b" + }, + { + "name": "storage.type.heart", + "match": "\\b(void|int|int32|int64|float|float32|float64|bool|string|(wrap|clamp)(?=\\s*<))\\b" + }, + { + "name": "storage.class.heart", + "match": "\\b(event|stream|value|node)(?=[\\s+|\n|{])\\b" + }, + { + "name": "storage.modifier.core.heart", + "match": "\\b(const|fixed|external)\\b" + }, + { + "name": "entity.name.type.heart", + "match": "\\b(let|var|input|output|connection|import)\\b" + }, + { + "name": "entity.name.tag.heart", + "match": "\\b(none|latch|linear|sinc|fast|best)\\b" + }, + { + "name": "entity.name.function.heart", + "match": "\\b(read|write|advance|cast|call)\\b" + }, + { + "name": "entity.name.section.heart", + "match": "[@]\\w+\\b" + }, + { + "name": "variable.other.heart", + "match": "[$]\\w+\\b" + }, + { + "name": "invalid.illegal.heart", + "match": "\\b(try|catch|throw|class|default|operator|switch|case)\\b" + }, + { + "name": "comment.line.number-sign.heart", + "begin": "#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.cpp" + } + }, + "end": "(?=\\n)", + "patterns": [ + { + "match": "(\\\\)\\n" + } + ] + }, + { + "match": "->|<-", + "name": "keyword.other.heart" + }, + { + "match": "<<|>>", + "name": "keyword.other.heart" + }, + { + "match": "\\.|::", + "name": "punctuation.separator.heart" + }, + { + "match": ";", + "name": "punctuation.terminator.heart" + }, + { + "match": "=", + "name": "keyword.operator.assignment.heart" + }, + { + "match": "%|\\*|/|-|\\+", + "name": "keyword.operator.heart" + }, + { + "match": "\\b(true|false)\\b", + "name": "constant.language.heart" + }, + { + "match": "\\b(processor(?=[.]))\\b", + "name": "support.constant.core.heart" + }, + { + "match": "\\b[0-9]+[.]([0-9]+)?[f]?([e][+-]?[0-9]+)?[f]?\\b", + "name": "constant.numeric.float.heart" + }, + { + "match": "\\b[0-9]+(L)?\\b", + "name": "constant.numeric.integer.decimal.heart" + }, + { + "match": "\\b0x[a-fA-F0-9]+(L)?\\b", + "name": "constant.numeric.integer.hexadecimal.heart" + }, + { + "match": "\\b0o[0-7]+(L)?\\b", + "name": "constant.numeric.integer.octal.heart" + }, + { + "match": "\\b0b[01]+(L)?\\b", + "name": "constant.numeric.integer.binary.heart" + }, + { + "match": "\\b([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\s*\\(", + "captures": { + "1": { + "name": "entity.name.function.heart" + } + } + }, + { + "match": "\\b(function)\\s+([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\s*\\(", + "captures": { + "1": { + "name": "storage.type.heart" + }, + "2": { + "name": "entity.name.function.heart" + } + } + }, + { + "comment": "Module declaration", + "match": "\\b(graph|processor|namespace)\\s+([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_(::)]+)\\b", + "captures": { + "1": { + "name": "storage.type.heart" + }, + "2": { + "name": "entity.name.type.heart" + } + } + }, + { + "comment": "Type declaration", + "begin": "\\b(enum|struct)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", + "end": "[\\{\\(]", + "beginCaptures": { + "1": { + "name": "storage.type.heart" + }, + "2": { + "name": "entity.name.type.heart" + } + }, + "patterns": [ + { + "match": "\\b(enum|struct)\\b", + "name": "keyword.other.type-decl.heart" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.heart" + } + }, + "end": "\\)|(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(? audioIn;", + "output stream float<2> audioOut;" + ], + "description": "Stereo I/O stream pair." + }, + "Mono Out Processor": { + "prefix": ["processor", "prm"], + "body": [ + "processor ${1:Name}", + "{", + "\toutput stream float audioOut;", + "", + "\tvoid run()", + "\t{", + "\t\tloop", + "\t\t{", + "\t\t\t$2", + "\t\t}", + "\t}", + "}" + ], + "description": "Simplest processor." + }, + "Stereo I/O Processor": { + "prefix": ["processors", "prs"], + "body": [ + "processor ${1:Name}", + "{", + "\tinput stream float<2> audioIn;", + "\toutput stream float<2> audioOut;", + "", + "\tvoid run()", + "\t{", + "\t\tloop", + "\t\t{", + "\t\t\t$2", + "\t\t}", + "\t}", + "}" + ], + "description": "Stereo in/out processor." + }, + "Mono Out Graph": { + "prefix": ["graph", "grm"], + "body": [ + "graph ${1:Name}", + "{", + "\toutput stream float audioOut;", + "", + "\tlet", + "\t{", + "\t\t$2", + "\t}", + "", + "\tconnection", + "\t{", + "\t\t$3", + "\t}", + "}" + ], + "description": "Simplest Graph." + }, + "Stereo I/O Graph": { + "prefix": ["graphs", "grs"], + "body": [ + "graph ${1:Name}", + "{", + "\tinput stream float<2> audioOut;", + "\toutput stream float<2> audioOut;", + "", + "\tlet", + "\t{", + "\t\t$2", + "\t}", + "", + "\tconnection", + "\t{", + "\t\t$3", + "\t}", + "}" + ], + "description": "Simplest Graph." + }, + "Namespace": { + "prefix": ["namespace", "nmsp"], + "body": [ + "namespace ${1:Name}", + "{", + "\t$2", + "}" + ], + "description": "Namespace skeleton." + } +} diff --git a/tools/editors/vs_code_extension/soul/syntaxes/soul.tmLanguage.json b/tools/editors/vs_code_extension/soul/syntaxes/soul.tmLanguage.json index 68f5c67..b5344ee 100644 --- a/tools/editors/vs_code_extension/soul/syntaxes/soul.tmLanguage.json +++ b/tools/editors/vs_code_extension/soul/syntaxes/soul.tmLanguage.json @@ -8,12 +8,20 @@ "match": "\\b(if|else|do|while|for|loop|break|continue|return)\\b" }, { - "name": "storage.type.soul", - "match": "\\b(const|void|int|int32|int64|float|float32|float64|fixed|bool|string|event|wrap|clamp|external)\\b" + "name": "storage.type.core.soul", + "match": "\\b(void|int|int32|int64|float|float32|float64|bool|string|(wrap|clamp)(?=\\s*<))\\b" + }, + { + "name": "storage.class.soul", + "match": "\\b(event|stream|value)(?=[\\s+|\n|{])\\b" + }, + { + "name": "storage.modifier.core.soul", + "match": "\\b(const|fixed|external)\\b" }, { "name": "entity.name.type.soul", - "match": "\\b(let|var|graph|processor|namespace|struct|using|enum|input|output|connection|import)\\b" + "match": "\\b(let|var|input|output|connection|import)\\b" }, { "name": "invalid.illegal.soul", @@ -102,7 +110,7 @@ "name": "keyword.operator.assignment.soul" }, { - "match": "%|\\*|/|-|\\+", + "match": "%|\\*|/|-|\\+|\\?|\\:", "name": "keyword.operator.soul" }, { @@ -110,8 +118,79 @@ "name": "constant.language.soul" }, { - "match": "\\b((0(x|X)[0-9a-fA-F]([0-9a-fA-F']*[0-9a-fA-F])?)|(0(b|B)[01]([01']*[01])?)|(([0-9]([0-9']*[0-9])?\\.?[0-9]*([0-9']*[0-9])?)|(\\.[0-9]([0-9']*[0-9])?))((e|E)(\\+|-)?[0-9]([0-9']*[0-9])?)?)(F|f)?\\b", - "name": "constant.numeric.soul" + "match": "\\b(processor(?=[.]))\\b", + "name": "support.constant.core.soul" + }, + { + "match": "\\b[0-9]+[.]([0-9]+)?[_]?([f](32|64)?)?([e][+-]?[0-9]+)?[_]?([f](32|64)?)?\\b", + "name": "constant.numeric.float.soul" + }, + { + "match": "\\b[0-9]+(_)?(([i](32|64))|L)?\\b", + "name": "constant.numeric.integer.decimal.soul" + }, + { + "match": "\\b0x[a-fA-F0-9]+(_)?(([i](32|64))|L)?\\b", + "name": "constant.numeric.integer.hexadecimal.soul" + }, + { + "match": "\\b0o[0-7]+(_)?(([i](32|64))|L)?\\b", + "name": "constant.numeric.integer.octal.soul" + }, + { + "match": "\\b0b[01]+(_)?(([i](32|64))|L)?\\b", + "name": "constant.numeric.integer.binary.soul" + }, + { + "match": "\\b([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\s*\\(", + "captures": { + "1": { + "name": "entity.name.function.soul" + } + } + }, + { + "comment": "Module declaration", + "match": "\\b(graph|processor|namespace)\\s+([A-Za-z][A-Za-z0-9_]*|_[A-Za-z0-9_]+)\\b", + "captures": { + "1": { + "name": "storage.type.soul" + }, + "2": { + "name": "entity.name.type.soul" + } + } + }, + { + "comment": "Type declaration", + "begin": "\\b(enum|struct)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", + "end": "[\\{\\(]", + "beginCaptures": { + "1": { + "name": "storage.type.soul" + }, + "2": { + "name": "entity.name.type.soul" + } + }, + "patterns": [ + { + "match": "\\b(enum|struct)\\b", + "name": "keyword.other.type-decl.soul" + } + ] + }, + { + "comment": "Type alias", + "match": "\\b(using)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\b", + "captures": { + "1": { + "name": "storage.type.soul" + }, + "2": { + "name": "entity.name.type.soul" + } + } }, { "begin": "\\(",