├── .gitignore ├── images └── logo.png ├── .vscodeignore ├── README.md ├── .gitattributes ├── CHANGELOG.md ├── .vscode └── launch.json ├── language-configuration.json ├── LICENSE ├── package.json └── syntaxes └── hex.tmLanguage.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.vsix 3 | test.min 4 | -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h3rald/vscode-hex-lang/master/images/logo.png -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | .gitignore 4 | vsc-extension-quickstart.md 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vscode-hex-lang 2 | VS Code syntax highlighting for the hex programming language 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behavior to automatically normalize line endings. 2 | * text=auto 3 | 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## 0.5.0 - 20250108 4 | 5 | - Aligned with hex v0.6.0. 6 | 7 | ## 0.4.0 - 20250108 8 | 9 | - Aligned with hex v0.5.0. 10 | 11 | ## 0.3.0 - 20250108 12 | 13 | - Aligned with hex v0.4.0. 14 | 15 | ## 0.2.0 - 20241224 16 | 17 | - Aligned with hex v0.3.0. 18 | 19 | ## 0.1.0 - 20241210 20 | 21 | - Initial release, providing syntax highlighting. 22 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ] 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /language-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | "lineComment": ";", 4 | "blockComment": [ 5 | "#|", 6 | "|#" 7 | ] 8 | }, 9 | "brackets": [ 10 | [ 11 | "(", 12 | ")" 13 | ] 14 | ], 15 | "autoClosingPairs": [ 16 | [ 17 | "(", 18 | ")" 19 | ], 20 | [ 21 | "\"", 22 | "\"" 23 | ] 24 | ], 25 | "surroundingPairs": [ 26 | [ 27 | "(", 28 | ")" 29 | ], 30 | [ 31 | "\"", 32 | "\"" 33 | ] 34 | ], 35 | "indentationRules": {} 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Fabio Cevasco 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-hex-lang", 3 | "displayName": "hex", 4 | "description": "Syntax highlighting for the hex programming language", 5 | "publisher": "h3rald", 6 | "author": { 7 | "name": "Fabio Cevasco", 8 | "email": "h3rald@h3rald.com", 9 | "url": "https://h3rald.com" 10 | }, 11 | "license": "MIT", 12 | "version": "0.5.0", 13 | "homepage": "https://github.com/h3rald/vscode-hex-lang/blob/master/README.md", 14 | "icon": "images/logo.png", 15 | "scripts": { 16 | "publish": "vsce publish", 17 | "package": "vsce package", 18 | "install": "npm run package && code --install-extension ./vscode-hex-lang-0.2.0.vsix" 19 | }, 20 | "galleryBanner": { 21 | "color": "#000000", 22 | "theme": "dark" 23 | }, 24 | "repository": { 25 | "type": "git", 26 | "url": "https://github.com/h3rald/vscode-hex-lang.git" 27 | }, 28 | "bugs": { 29 | "url": "https://github.com/h3rald/vscode-hex-lang/issues" 30 | }, 31 | "engines": { 32 | "vscode": "^1.51.0" 33 | }, 34 | "categories": [ 35 | "Programming Languages" 36 | ], 37 | "contributes": { 38 | "languages": [ 39 | { 40 | "id": "hex", 41 | "aliases": [ 42 | "Min", 43 | "hex" 44 | ], 45 | "extensions": [ 46 | ".hex" 47 | ], 48 | "configuration": "./language-configuration.json" 49 | } 50 | ], 51 | "grammars": [ 52 | { 53 | "language": "hex", 54 | "scopeName": "source.hex", 55 | "path": "./syntaxes/hex.tmLanguage.json" 56 | } 57 | ] 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /syntaxes/hex.tmLanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", 3 | "name": "hex", 4 | "scopeName": "source.hex", 5 | "patterns": [ 6 | { 7 | "include": "#value" 8 | } 9 | ], 10 | "repository": { 11 | "comments": { 12 | "patterns": [ 13 | { 14 | "include": "#comments-inline" 15 | }, 16 | { 17 | "include": "#comments-block" 18 | }, 19 | { 20 | "match": "^#!.*\\n", 21 | "name": "comment.line.shebang.hex" 22 | } 23 | ] 24 | }, 25 | "comments-inline": { 26 | "patterns": [ 27 | { 28 | "captures": { 29 | "1": { 30 | "name": "punctuation.definition.comment.hex" 31 | } 32 | }, 33 | "match": "(;).*$\\n?", 34 | "name": "comment.line.semicolon.hex" 35 | } 36 | ] 37 | }, 38 | "comments-block": { 39 | "patterns": [ 40 | { 41 | "begin": "\\#\\|", 42 | "end": "\\|\\#", 43 | "name": "comment.block.hashpipe.hex", 44 | "patterns": [ 45 | { 46 | "include": "#comments-block" 47 | } 48 | ] 49 | } 50 | ] 51 | }, 52 | "number": { 53 | "match": "(?<=(\\s|^|\\(|\\{))0x[0-9a-fA-F]{1,8}(?=(\\s|\\)|\\}|$))", 54 | "name": "constant.numeric.hex" 55 | }, 56 | "native-symbol": { 57 | "patterns": [ 58 | { 59 | "match": "(?<=(\\s|^|\\())(if|timestamp|while|error|try|throw|dup|drop|swap|stack|and|or|not|xor|int|str|hex|dec|type|ord|chr|cat|len|get|index|join|split|sub|map|puts|warn|print|gets|read|write|append|args|exit|exec|run|symbols|!|!=|%|&&|\\.|'|\\+|-|\\*|\\/|:|::|<|>|<=|==|>=|>>|<<|\\^|~|\\|\\||\\||&|#)(?=(\\s|\\)|$))", 60 | "name": "keyword.native.hex" 61 | } 62 | ] 63 | }, 64 | "quotation": { 65 | "begin": "(\\()", 66 | "beginCaptures": { 67 | "1": { 68 | "name": "punctuation.definition.array.begin.hex" 69 | } 70 | }, 71 | "end": "(\\))", 72 | "endCaptures": { 73 | "1": { 74 | "name": "punctuation.definition.array.end.hex" 75 | } 76 | }, 77 | "name": "meta.structure.array.hex", 78 | "patterns": [ 79 | { 80 | "include": "#value" 81 | } 82 | ] 83 | }, 84 | "user-symbol": { 85 | "patterns": [ 86 | { 87 | "include": "#system-module" 88 | }, 89 | { 90 | "include": "#dot" 91 | }, 92 | { 93 | "include": "#bang" 94 | }, 95 | { 96 | "match": "([a-zA-Z_][a-zA-Z0-9_-]*)", 97 | "name": "variable.name.hex" 98 | } 99 | ] 100 | }, 101 | "string": { 102 | "begin": "\"", 103 | "beginCaptures": { 104 | "0": { 105 | "name": "punctuation.definition.string.begin.hex" 106 | } 107 | }, 108 | "end": "\"", 109 | "endCaptures": { 110 | "0": { 111 | "name": "punctuation.definition.string.end.hex" 112 | } 113 | }, 114 | "name": "string.quoted.double.hex", 115 | "patterns": [ 116 | { 117 | "include": "#escaped-char" 118 | }, 119 | { 120 | "include": "#placeholder" 121 | } 122 | ] 123 | }, 124 | "escaped-char": { 125 | "patterns": [ 126 | { 127 | "match": "\\\\[cC]|\\\\[rR]", 128 | "name": "constant.character.escape.carriagereturn.hex" 129 | }, 130 | { 131 | "match": "\\\\[lL]|\\\\[nN]", 132 | "name": "constant.character.escape.linefeed.hex" 133 | }, 134 | { 135 | "match": "\\\\[fF]", 136 | "name": "constant.character.escape.formfeed.hex" 137 | }, 138 | { 139 | "match": "\\\\[tT]", 140 | "name": "constant.character.escape.tabulator.hex" 141 | }, 142 | { 143 | "match": "\\\\[vV]", 144 | "name": "constant.character.escape.verticaltabulator.hex" 145 | }, 146 | { 147 | "match": "\\\\\\\"", 148 | "name": "constant.character.escape.double-quote.hex" 149 | }, 150 | { 151 | "match": "\\\\'", 152 | "name": "constant.character.escape.single-quote.hex" 153 | }, 154 | { 155 | "match": "\\\\[aA]", 156 | "name": "constant.character.escape.alert.hex" 157 | }, 158 | { 159 | "match": "\\\\[bB]", 160 | "name": "constant.character.escape.backspace.hex" 161 | }, 162 | { 163 | "match": "\\\\[eE]", 164 | "name": "constant.character.escape.escape.hex" 165 | }, 166 | { 167 | "match": "\\\\\\\\", 168 | "name": "constant.character.escape.backslash.hex" 169 | } 170 | ] 171 | }, 172 | "value": { 173 | "patterns": [ 174 | { 175 | "include": "#comments" 176 | }, 177 | { 178 | "include": "#quotation" 179 | }, 180 | { 181 | "include": "#native-symbol" 182 | }, 183 | { 184 | "include": "#string" 185 | }, 186 | { 187 | "include": "#number" 188 | }, 189 | { 190 | "include": "#user-symbol" 191 | } 192 | ] 193 | } 194 | } 195 | } 196 | --------------------------------------------------------------------------------