diff options
| -rw-r--r-- | editors/vscode/README.txt | 1 | ||||
| -rw-r--r-- | editors/vscode/sail/CHANGELOG.md | 5 | ||||
| -rw-r--r-- | editors/vscode/sail/README.md | 11 | ||||
| -rw-r--r-- | editors/vscode/sail/language-configuration.json | 30 | ||||
| -rw-r--r-- | editors/vscode/sail/package.json | 25 | ||||
| -rw-r--r-- | editors/vscode/sail/syntaxes/sail.tmLanguage.json | 163 |
6 files changed, 235 insertions, 0 deletions
diff --git a/editors/vscode/README.txt b/editors/vscode/README.txt new file mode 100644 index 00000000..bc5046af --- /dev/null +++ b/editors/vscode/README.txt @@ -0,0 +1 @@ +Open the `sail` folder for Visual Studio Code syntax highlighting. diff --git a/editors/vscode/sail/CHANGELOG.md b/editors/vscode/sail/CHANGELOG.md new file mode 100644 index 00000000..99c2195b --- /dev/null +++ b/editors/vscode/sail/CHANGELOG.md @@ -0,0 +1,5 @@ +# Change Log + +## 0.1 + +- Initial release diff --git a/editors/vscode/sail/README.md b/editors/vscode/sail/README.md new file mode 100644 index 00000000..d9cb1c92 --- /dev/null +++ b/editors/vscode/sail/README.md @@ -0,0 +1,11 @@ +# sail README + +Visual Studio Code syntax highlighting mode for the Sail ISA specification language. + +## Features + +Very basic syntax highlighting. + +## Known Issues + +It's not very good yet. diff --git a/editors/vscode/sail/language-configuration.json b/editors/vscode/sail/language-configuration.json new file mode 100644 index 00000000..8f162a0c --- /dev/null +++ b/editors/vscode/sail/language-configuration.json @@ -0,0 +1,30 @@ +{ + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": "//", + // symbols used for start and end a block comment. Remove this entry if your language does not support block comments + "blockComment": [ "/*", "*/" ] + }, + // symbols used as brackets + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + // symbols that are auto closed when typing + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + // symbols that can be used to surround a selection + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +}
\ No newline at end of file diff --git a/editors/vscode/sail/package.json b/editors/vscode/sail/package.json new file mode 100644 index 00000000..72b59feb --- /dev/null +++ b/editors/vscode/sail/package.json @@ -0,0 +1,25 @@ +{ + "name": "sail", + "displayName": "sail", + "description": "Sail ISA specification language", + "version": "0.0.1", + "engines": { + "vscode": "^1.42.0" + }, + "categories": [ + "Programming Languages" + ], + "contributes": { + "languages": [{ + "id": "sail", + "aliases": ["Sail", "sail"], + "extensions": [".sail"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "sail", + "scopeName": "source.sail", + "path": "./syntaxes/sail.tmLanguage.json" + }] + } +}
\ No newline at end of file diff --git a/editors/vscode/sail/syntaxes/sail.tmLanguage.json b/editors/vscode/sail/syntaxes/sail.tmLanguage.json new file mode 100644 index 00000000..7de25579 --- /dev/null +++ b/editors/vscode/sail/syntaxes/sail.tmLanguage.json @@ -0,0 +1,163 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "Sail", + "patterns": [ + { + "include": "#keywords" + }, + { + "include": "#operators" + }, + { + "include": "#strings" + }, + { + "include": "#numbers" + } + ], + "repository": { + "keywords": { + "patterns": [{ + "name": "keyword.control.sail", + "match": "\\b(if|then|while|for|return|match)\\b" + },{ + "name": "keyword.other.sail", + "match": "\\b(type|val|let|in|function|scattered|enum|union|clause|default|order|dec|register|vector)\\b" + },{ + "name": "keyword.other.sail", + "match": "\\b(effect)\\b" + },{ + "name": "keyword.other.sail", + "match": "\\b(infix|overload|operator)\\b" + },{ + "name": "keyword.other.sail", + "match": "\\b(\\$include)\\b" + },{ + "name": "keyword.other.sail", + "match": "(=>|=|->|:|,|\\+|\\*)" + },{ + "name": "keyword.other.sail", + "match": "\\b_\\b" + },{ + "begin": "/\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.sail" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.sail" + } + }, + "name": "comment.block.sail" + },{ + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.paren.open" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.paren.close" + } + }, + "patterns": [{ + "include": "$self" + }] + },{ + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.curly.open" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.close.open" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + + { + "begin": "^\\s*((\\$)\\s*(include|import))\\b\\s*", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.$3.c" + }, + "2": { + "name": "punctuation.definition.directive.c" + } + }, + "end": "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)", + "name": "meta.preprocessor.include.c", + "patterns": [ + { + "include": "#line_continuation_character" + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.c" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.c" + } + }, + "name": "string.quoted.double.include.c" + }, + { + "begin": "<", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.c" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.c" + } + }, + "name": "string.quoted.other.lt-gt.include.c" + } + ] + } + + ] + }, + "strings": { + "name": "string.quoted.double.sail", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "name": "constant.character.escape.sail", + "match": "\\\\." + } + ] + }, + "numbers": { + "patterns": [ + { + "match": "\\b((0(x|X)[0-9a-fA-F]*)|(0(b|B)[01]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b", + "name": "constant.numeric.c" + } + ] + } + }, + "scopeName": "source.sail" +}
\ No newline at end of file |
