mirror of
https://github.com/SymboScript/symboscript-vs.git
synced 2024-12-03 18:46:23 +03:00
feat: basic syntax highlighting
This commit is contained in:
commit
b67e6f481d
11 changed files with 347 additions and 0 deletions
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Set default behavior to automatically normalize line endings.
|
||||
* text=auto
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
node_modules
|
||||
*.vsix
|
17
.vscode/launch.json
vendored
Normal file
17
.vscode/launch.json
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
// 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",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
4
.vscodeignore
Normal file
4
.vscodeignore
Normal file
|
@ -0,0 +1,4 @@
|
|||
.vscode/**
|
||||
.vscode-test/**
|
||||
.gitignore
|
||||
vsc-extension-quickstart.md
|
11
CHANGELOG.md
Normal file
11
CHANGELOG.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Change Log
|
||||
|
||||
All notable changes to the "symboscript-vs" extension will be documented in this file.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- Nothing
|
||||
|
||||
## [0.1.0] - 2023-12-29
|
||||
|
||||
- Initial release
|
21
LICENSE
Normal file
21
LICENSE
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2023 Artemy Egorov (artegoser)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
7
README.md
Normal file
7
README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
# symboscript-vs README
|
||||
|
||||
This extension adds support for the [Symboscript](https://github.com/symboscript/symboscript) programming language to VS Code.
|
||||
|
||||
## Features
|
||||
|
||||
- Syntax highlighting
|
BIN
icon.png
Normal file
BIN
icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
32
language-configuration.json
Normal file
32
language-configuration.json
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"comments": {
|
||||
// symbol used for single line comment.
|
||||
"lineComment": "#",
|
||||
// symbols used for start and end a block comment.
|
||||
"blockComment": ["#/", "/#"]
|
||||
},
|
||||
// symbols used as brackets
|
||||
"brackets": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"]
|
||||
],
|
||||
// symbols that are auto closed when typing
|
||||
"autoClosingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["\"", "\""],
|
||||
["'", "'"],
|
||||
["`", "`"]
|
||||
],
|
||||
// symbols that can be used to surround a selection
|
||||
"surroundingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["\"", "\""],
|
||||
["'", "'"],
|
||||
["`", "`"]
|
||||
]
|
||||
}
|
41
package.json
Normal file
41
package.json
Normal file
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"name": "symboscript-vs",
|
||||
"displayName": "SymboScript-vs",
|
||||
"description": "Official language support for SymboScrypt",
|
||||
"version": "0.1.1",
|
||||
"publisher": "symboscript",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symboscript/symboscript-vs"
|
||||
},
|
||||
"icon": "icon.png",
|
||||
"engines": {
|
||||
"vscode": "^1.85.0"
|
||||
},
|
||||
"categories": [
|
||||
"Programming Languages"
|
||||
],
|
||||
"contributes": {
|
||||
"languages": [
|
||||
{
|
||||
"id": "symboscript",
|
||||
"aliases": [
|
||||
"SymboScript",
|
||||
"symboscript"
|
||||
],
|
||||
"extensions": [
|
||||
".syms"
|
||||
],
|
||||
"configuration": "./language-configuration.json"
|
||||
}
|
||||
],
|
||||
"grammars": [
|
||||
{
|
||||
"language": "symboscript",
|
||||
"scopeName": "source.symboscript",
|
||||
"path": "./syntaxes/symboscript.tmLanguage.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
210
syntaxes/symboscript.tmLanguage.json
Normal file
210
syntaxes/symboscript.tmLanguage.json
Normal file
|
@ -0,0 +1,210 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
||||
"name": "SymboScript",
|
||||
"scopeName": "source.symboscript",
|
||||
"patterns": [
|
||||
{ "include": "#comment" },
|
||||
{ "include": "#function" },
|
||||
{ "include": "#number" },
|
||||
{ "include": "#keyword" },
|
||||
{ "include": "#punctuation" },
|
||||
{ "include": "#string" },
|
||||
{ "include": "#variables" }
|
||||
],
|
||||
"repository": {
|
||||
"comment": {
|
||||
"comment": "Comments",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "comment.block.doc.symboscript",
|
||||
"begin": "#/",
|
||||
"end": "/#"
|
||||
},
|
||||
{
|
||||
"name": "comment.line.symboscript",
|
||||
"begin": "#",
|
||||
"end": "\n"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"function": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "Function call",
|
||||
"name": "meta.function.call.symboscript",
|
||||
"match": "([A-Za-z0-9_]+)((\\[))",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.function.symboscript"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.brackets.square.symboscript"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Function declaration",
|
||||
"name": "meta.name.function.symboscript",
|
||||
"match": "\\b(fn)\\s+([A-Za-z0-9_]+)((\\[))",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.other.fn.symboscript"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.function.symboscript"
|
||||
},
|
||||
"4": {
|
||||
"name": "punctuation.brackets.square.symboscript"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"number": {
|
||||
"comment": "Numbers",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "constant.numeric.symboscript",
|
||||
"match": "(\\.|)[0-9]+"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"keyword": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "keyword.control.symboscript",
|
||||
"match": "\\b(if|else|while|for|loop|return|yield|async|await|break|continue|in)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.other.fn.symboscript",
|
||||
"match": "\\b(fn)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.other.let.symboscript",
|
||||
"match": "\\b(let)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.other.bool.symboscript",
|
||||
"match": "\\b(true|false)\\b"
|
||||
},
|
||||
{
|
||||
"comment": "logical operators",
|
||||
"name": "keyword.operator.logical.symboscript",
|
||||
"match": "(\\||\\|\\||&|&&|<<|>>|!)(?!=)"
|
||||
},
|
||||
{
|
||||
"comment": "assignment operators",
|
||||
"name": "keyword.operator.assignment.symboscript",
|
||||
"match": "(\\+=|-=|\\*=|/=|%=|\\^=|&=|\\|=|<<=|>>=)"
|
||||
},
|
||||
{
|
||||
"comment": "single equal",
|
||||
"name": "keyword.operator.assignment.equal.symboscript",
|
||||
"match": "(?<![<>])=(?!=|>)"
|
||||
},
|
||||
{
|
||||
"comment": "comparison operators",
|
||||
"name": "keyword.operator.comparison.symboscript",
|
||||
"match": "(=(=)?(?!>)|!=|<=|(?<!=)>=)"
|
||||
},
|
||||
{
|
||||
"comment": "math operators",
|
||||
"name": "keyword.operator.math.symboscript",
|
||||
"match": "(\\^|([+%]|(\\*(?!\\w)))(?!=))|(-(?!>))|(/(?!/))"
|
||||
},
|
||||
{
|
||||
"comment": "range operator",
|
||||
"name": "keyword.operator.range.symboscript",
|
||||
"match": "\\.\\."
|
||||
},
|
||||
{
|
||||
"comment": "dot expr access",
|
||||
"name": "keyword.operator.access.dot.expr.symboscript",
|
||||
"match": "\\.[^\\w]"
|
||||
},
|
||||
{
|
||||
"comment": "dot access",
|
||||
"name": "keyword.operator.access.dot.symboscript",
|
||||
"match": "\\."
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"punctuation": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "comma",
|
||||
"name": "punctuation.comma.symboscript",
|
||||
"match": ","
|
||||
},
|
||||
{
|
||||
"comment": "curly braces",
|
||||
"name": "punctuation.brackets.curly.symboscript",
|
||||
"match": "[{}]"
|
||||
},
|
||||
{
|
||||
"comment": "parentheses, round brackets",
|
||||
"name": "punctuation.brackets.round.symboscript",
|
||||
"match": "[()]"
|
||||
},
|
||||
{
|
||||
"comment": "semicolon",
|
||||
"name": "punctuation.semi.symboscript",
|
||||
"match": ";"
|
||||
},
|
||||
{
|
||||
"comment": "square brackets",
|
||||
"name": "punctuation.brackets.square.symboscript",
|
||||
"match": "[\\[\\]]"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"string": {
|
||||
"comment": "Strings",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "string.quoted.double.symboscript",
|
||||
"begin": "\"",
|
||||
"end": "\"",
|
||||
"patterns": [{ "include": "#escape" }]
|
||||
},
|
||||
{
|
||||
"name": "string.quoted.single.symboscript",
|
||||
"begin": "'",
|
||||
"end": "'",
|
||||
"patterns": [{ "include": "#escape" }]
|
||||
},
|
||||
{
|
||||
"name": "string.quoted.other.symboscript",
|
||||
"begin": "`",
|
||||
"end": "`",
|
||||
"patterns": [{ "include": "#escape" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"escape": {
|
||||
"name": "constant.character.escape.symboscript",
|
||||
"match": "\\\\."
|
||||
},
|
||||
|
||||
"variables": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "variables",
|
||||
"name": "variable.other.symboscript",
|
||||
"match": "[a-z][a-z0-9_]*",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "constant.numeric.symboscript"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue