From 7bf526e1ab7919af19953e3cfb3405a47fd9988b Mon Sep 17 00:00:00 2001 From: ibx34 Date: Wed, 25 Dec 2024 20:19:49 -0500 Subject: [PATCH] Update --- .gitignore | 3 +- astir/README.md | 66 +------------------- astir/language-configuration.json | 2 +- astir/package.json | 2 +- astir/syntaxes/astir.tmLanguage.json | 93 +++++++++++++++++++--------- boot.dal | 3 +- 6 files changed, 70 insertions(+), 99 deletions(-) diff --git a/.gitignore b/.gitignore index 1700508..e2ac9fa 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ whatever.s *.o boot whatever -.vscode \ No newline at end of file +.vscode +*.vsix \ No newline at end of file diff --git a/astir/README.md b/astir/README.md index 2c05ac4..05509fb 100644 --- a/astir/README.md +++ b/astir/README.md @@ -1,65 +1 @@ -# astir README - -This is the README for your extension "astir". After writing up a brief description, we recommend including the following sections. - -## Features - -Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. - -For example if there is an image subfolder under your extension project workspace: - -\!\[feature X\]\(images/feature-x.png\) - -> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. - -## Requirements - -If you have any requirements or dependencies, add a section describing those and how to install and configure them. - -## Extension Settings - -Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. - -For example: - -This extension contributes the following settings: - -* `myExtension.enable`: Enable/disable this extension. -* `myExtension.thing`: Set to `blah` to do something. - -## Known Issues - -Calling out known issues can help limit users opening duplicate issues against your extension. - -## Release Notes - -Users appreciate release notes as you update your extension. - -### 1.0.0 - -Initial release of ... - -### 1.0.1 - -Fixed issue #. - -### 1.1.0 - -Added features X, Y, and Z. - ---- - -## Working with Markdown - -You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: - -* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux). -* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux). -* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets. - -## For more information - -* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) -* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) - -**Enjoy!** +# Astir Syntax Highlighting \ No newline at end of file diff --git a/astir/language-configuration.json b/astir/language-configuration.json index 8f162a0..1bc9637 100644 --- a/astir/language-configuration.json +++ b/astir/language-configuration.json @@ -3,7 +3,7 @@ // 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": [ "/*", "*/" ] + "blockComment": [ ] }, // symbols used as brackets "brackets": [ diff --git a/astir/package.json b/astir/package.json index dbf1b65..20fca9e 100644 --- a/astir/package.json +++ b/astir/package.json @@ -18,7 +18,7 @@ }], "grammars": [{ "language": "astir", - "scopeName": "", + "scopeName": "source.astir", "path": "./syntaxes/astir.tmLanguage.json" }] } diff --git a/astir/syntaxes/astir.tmLanguage.json b/astir/syntaxes/astir.tmLanguage.json index 57a2b26..6b501d8 100644 --- a/astir/syntaxes/astir.tmLanguage.json +++ b/astir/syntaxes/astir.tmLanguage.json @@ -1,32 +1,67 @@ { - "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "scopeName": "boot.dal", - "name": "Astir", + "scopeName": "source.astir", "patterns": [ - { - "include": "#keywords" - }, - { - "include": "#strings" - } + { + "name": "comment.line.double-slash.astir", + "match": "//.*$" + }, + { + "name": "keyword.declaration.astir", + "match": "\\bd'[A-Za-z_][A-Za-z0-9_]*\\b" + }, + { + "name": "entity.name.function.astir", + "match": "\\b[A-Za-z_][A-Za-z0-9_]*\\\\" + }, + { + "name": "variable.parameter.astir", + "match": "\\b[A-Za-z_][A-Za-z0-9_]*\\s+[A-Za-z_][A-Za-z0-9_]*\\b" + }, + { + "name": "storage.type.astir", + "match": "::" + }, + { + "name": "constant.numeric.astir", + "match": "\\b\\d+\\b" + }, + { + "name": "keyword.control.arrow.astir", + "match": "→" + }, + { + "name": "string.quoted.double.astir", + "begin": "\\[\"", + "end": "\"\\]", + "patterns": [ + { + "name": "constant.character.escape.astir", + "match": "\\\\." + } + ] + }, + { + "name": "Comment", + "scopeName": "comment.line.double-slash", + "patterns": [ + { + "match": "//.*", + "name": "comment.line.double-slash" + } + ] + }, + { + "name": "meta.assembly.astir", + "begin": "asm \\[", + "end": "\\]", + "patterns": [ + { + "name": "string.unquoted.astir", + "match": "\".*?\"" + } + ] + } ], - "repository": { - "keywords": { - "patterns": [{ - "name": "keyword.control.astir", - "match": "\\b(if|while|for|return)\\b" - }] - }, - "strings": { - "name": "string.quoted.double.astir", - "begin": "\"", - "end": "\"", - "patterns": [ - { - "name": "constant.character.escape.astir", - "match": "\\\\." - } - ] - } - }, -} \ No newline at end of file + "repository": {} + } + \ No newline at end of file diff --git a/boot.dal b/boot.dal index f14eaa3..a39fcbe 100644 --- a/boot.dal +++ b/boot.dal @@ -7,5 +7,4 @@ //take_int_and_add_2\ x int, y int :: int → x + y print_hello_world\ :: () → asm ["mov X0, #1", "adr X1, helloworld", "mov X2, #13", "mov X16, #4", "svc 0", "ret"] -_start\ :: int → asm ["bl print_hello_world", "mov X0, #0", "mov X16, #1", "svc 0", "helloworld: .ascii \"Hello World!\""] - +_start\ :: int → asm ["bl print_hello_world", "mov X0, #0", "mov X16, #1", "svc 0", "helloworld: .ascii \"Hello World!\""] \ No newline at end of file