commit d585b6c82f9452f0936dcd68379efcd0b32fc0b2 Author: Olivier Guinart Date: Mon Aug 28 19:15:42 2017 -0700 Initial commit (syntax coloring) diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..8384213 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,13 @@ +// A launch configuration that launches the extension inside a new window +{ + "version": "0.1.0", + "configurations": [ + { + "name": "Launch Extension", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": ["--extensionDevelopmentPath=${workspaceRoot}" ] + } + ] +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..62ee0cc --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Change Log +All notable changes to the "merlin32" extension will be documented in this file. + +Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. + +## [Unreleased] +- Initial release \ No newline at end of file diff --git a/Images/VSCode01.JPG b/Images/VSCode01.JPG new file mode 100644 index 0000000..33be350 Binary files /dev/null and b/Images/VSCode01.JPG differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..f244dda --- /dev/null +++ b/README.md @@ -0,0 +1,65 @@ +# merlin32 README + +This is the README for your extension "merlin32". 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 + +**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: + +* Split the editor (`Cmd+\` on OSX or `Ctrl+\` on Windows and Linux) +* Toggle preview (`Shift+CMD+V` on OSX or `Shift+Ctrl+V` on Windows and Linux) +* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (OSX) 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!** \ No newline at end of file diff --git a/Test/test.s b/Test/test.s new file mode 100644 index 0000000..9df551a --- /dev/null +++ b/Test/test.s @@ -0,0 +1,11 @@ +; This is a comment +ADC X +DA Y +A EQU "STRING" +bne +BRA +* THat is a comment too. +"" + + + diff --git a/language-configuration.json b/language-configuration.json new file mode 100644 index 0000000..2c8b732 --- /dev/null +++ b/language-configuration.json @@ -0,0 +1,28 @@ +{ + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": [";", "*"] + }, + // symbols used as brackets + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + // symbols that are auto closed when typing + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + // symbols that that can be used to surround a selection + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..de3f63e --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "merlin32", + "displayName": "Merlin32", + "description": "Language support for Merlin32", + "version": "0.0.1", + "publisher": "Aito", + "engines": { + "vscode": "^1.15.0" + }, + "categories": [ + "Languages" + ], + "contributes": { + "languages": [{ + "id": "merlin32", + "aliases": ["Merlin32", "merlin32"], + "extensions": [".s"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "merlin32", + "scopeName": "source.asm.merlin32", + "path": "./syntaxes/merlin32.tmLanguage.json" + }] + } +} \ No newline at end of file diff --git a/syntaxes/merlin32.tmLanguage.json b/syntaxes/merlin32.tmLanguage.json new file mode 100644 index 0000000..23bf58f --- /dev/null +++ b/syntaxes/merlin32.tmLanguage.json @@ -0,0 +1,59 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "Merlin32", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#opcodes" + }, + { + "include": "#datadefines" + }, + { + "include": "#directives" + }, + { + "include": "#strings" + } + ], + "repository": { + "comments": { + "patterns": [{ + "name": "comment.line.semicolon.merlin32", + "match": "(;|\\*).*" + }] + }, + "opcodes": { + "patterns": [{ + "name": "keyword.control.opcode.merlin32", + "match": "(?i)\\b(ADC|ADCL|AND|ANDL|ASL|BCC|BLT|BCS|BGE|BEQ|BIT|BMI|BNE|BPL|BRA|BRK|BRL|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CMPL|COP|CPX|CPY|DEC|DEX|DEY|EOR|EORL|INC|INX|INY|JMP|JML|JMPL|JSR|JSL|LDA|LDAL|LDX|LDY|LSR|MVN|MVP|NOP|ORA|ORAL|PEA|PEI|PER|PHA|PHB|PHD|PHK|PHP|PHX|PHY|PLA|PLB|PLD|PLP|PLX|PLY|REP|ROL|ROR|RTI|RTL|RTS|SBC|SBCL|SEC|SED|SEI|SEP|STA|STAL|STP|STX|STY|STZ|TAX|TAY|TCD|TCS|TDC|TRB|TSB|TSC|TSX|TXA|TXS|TXY|TYA|TYX|WAI|WDM|XBA|XCE)\\b" + }] + }, + "datadefines": { + "patterns": [{ + "name": "storage.type.datadefine.merlin32", + "match": "(?i)\\b(DA|DW|DDB|DFB|DB|ADR|ADRL|HEX|DS|DC|DE|ASC|DCI|INV|FLS|REV|STR|STRL|CHK)\\b" + }] + }, + "directives": { + "patterns": [{ + "name": "support.function.directive.merlin32", + "match": "(?i)\\b(EQU|ANOP|ORG|PUT|PUTBIN|START|END|DUM|DEND|MX|XC|LONGA|LONGI|USE|USING|REL|DSK|LNK|SAV|TYP|IF|DO|ELSE|FIN|LUP|ELUP|\\^|ERR|DAT|AST|CYC|EXP|LST|LSTDO|PAG|TTL|SKP|TR|KBD|PAU|SW|USR)\\b" + }] + }, + "strings": { + "name": "string.quoted.double.merlin32", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "name": "constant.character.escape.merlin32", + "match": "\\\\." + } + ] + } + }, + "scopeName": "source.asm.merlin32" +} \ No newline at end of file diff --git a/vsc-extension-quickstart.md b/vsc-extension-quickstart.md new file mode 100644 index 0000000..2d1a636 --- /dev/null +++ b/vsc-extension-quickstart.md @@ -0,0 +1,27 @@ +# Welcome to your VS Code Extension + +## What's in the folder +* This folder contains all of the files necessary for your extension +* `package.json` - this is the manifest file in which you declare your language support and define +the location of the grammar file that has been copied into you extension. +* `syntaxes/merlin32.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization +* `language-configuration.json` - this the language configuration, defining the tokens that are used for +comments and brackets. + +## Get up and running straight away +* Make sure the language configuration settings in `language-configuration.json` are accurate +* press `F5` to open a new window with your extension loaded +* create a new file with a file name suffix matching your language +* verify that syntax highlight works and that the language configuration settings are working + +## Make changes +* you can relaunch the extension from the debug toolbar after making changes to the files listed above +* you can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes + +## Add more language features +* To add features such as intellisense, hovers and validators check out the VS Code extenders documentation at +https://code.visualstudio.com/docs + +## Install your extension +* To start using your extension with Visual Studio Code copy it into the `/.vscode/extensions` folder and restart Code. +* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension. \ No newline at end of file