AI poop out a vs code extension (that honestly barely works111!!)

This commit is contained in:
Xircon 2026-08-02 02:12:22 -04:00
parent 0f201aa8c8
commit f1412061f2
7 changed files with 140 additions and 30 deletions

View File

@ -4,8 +4,8 @@ var x = 1 + 2 * 3;
var y = 2;
}
var y = x - 3;
var z = (3*5) / 3;
var z = (3 * 5) / 3;
if (x) {
exit(y + z);
exit(y + z);
}
exit (1);
exit (1); // Should never exit

View File

@ -1,5 +1,14 @@
# Change Log
## 0.0.2
- Added operator highlighting (+, -, *, /)
- Added variable highlighting for declarations (var keyword) and usage
- Added bracket/parenthesis highlighting
- Fixed comment highlighting for single-line and block comments
- Added BSD-3-Clause license
- Improved scope names for better VSCode theme compatibility
## 0.0.1
- Initial release
- Initial release

29
vs-extension/LICENSE Normal file
View File

@ -0,0 +1,29 @@
BSD 3-Clause License
Copyright (c) 2026, Xircon Contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -2,10 +2,30 @@
## Features
Adds syntax highlighting for XLang thats it.
- **Syntax Highlighting**: Full syntax highlighting support for XLang language
- **Keywords**: Highlighting for control flow keywords (if, else, return, var, exit)
- **Comments**: Support for single-line (//) and block (/* */) comments
- **Strings**: Double-quoted string highlighting with escape sequence support
- **Operators**: Highlighting for arithmetic operators (+, -, *, /)
- **Brackets**: Highlighting for parentheses (), square brackets [], and curly braces {}
- **Variables**: Highlighting for variable declarations and usage
- **Auto-closing Pairs**: Auto-completion for brackets, quotes, and parentheses
## Language Support
Syntax highlighting for files with `.x` extension.
## Release Notes
### 0.0.2
- Added operator highlighting
- Added variable highlighting (declarations with `var` and usage)
- Added bracket/parenthesis highlighting
- Fixed comment highlighting (both line and block comments)
- Added BSD-3-Clause license
### 0.0.1
Initial release
- Initial release with basic keyword and string highlighting

View File

@ -1,17 +1,13 @@
{
"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": [
["{", "}"],
["[", "]"],
@ -19,12 +15,13 @@
["\"", "\""],
["'", "'"]
],
// symbols that can be used to surround a selection
"autoCloseBefore": ":;,.)]}'\"`",
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
["'", "'"],
["/*", "*/"]
]
}

View File

@ -2,7 +2,7 @@
"name": "xlang",
"displayName": "XLang",
"description": "Syntax highlighting for XLang.",
"version": "0.0.1",
"version": "0.0.2",
"engines": {
"vscode": "^1.120.0"
},
@ -23,3 +23,5 @@
}]
}
}

View File

@ -2,42 +2,95 @@
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "xlang",
"patterns": [
{
"include": "#comments"
},
{
"include": "#operators"
},
{
"include": "#brackets"
},
{
"include": "#variables"
},
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"include": "#operators"
}
],
"repository": {
"keywords": {
"patterns": [{
"name": "keyword.control.xlang",
"name": "keyword.control",
"match": "\\b(if|else|return|var|exit)\\b"
}]
},
"strings": {
"name": "string.quoted.double.xlang",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.xlang",
"match": "\\\\."
"name": "string.quoted.double",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape",
"match": "\\\\."
}
]
}
]
},
"operators": {
"patterns": [
{
"name": "keyword.operator",
"match": "[+*/-]|\\*|/"
}
]
},
"brackets": {
"patterns": [
{
"name": "punctuation.bracket",
"match": "[\\(\\)\\[\\]\\{\\}]"
}
]
},
"variables": {
"patterns": [
{
"match": "\\bvar\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
"captures": {
"0": {
"name": "keyword.control"
},
"1": {
"name": "variable.other"
}
}
},
{
"name": "variable.other",
"match": "\\b(?!if|else|return|var|exit\\b)[a-zA-Z_][a-zA-Z0-9_]*\\b"
}
]
},
"comments": {
"patterns": [
{
"name": "comment.line.double-slash",
"match": "//.*$"
},
{
"name": "comment.block",
"begin": "/\\*",
"end": "\\*/"
}
]
}
},
"operators": {
"patterns": [
{
"name": "keyword.operator.xlang",
"match": "*|+|-|/"
}
]
},
"scopeName": "source.x"
}