Skip to content

Commit

Permalink
Added syntax highlighting extension
Browse files Browse the repository at this point in the history
  • Loading branch information
BLM16 committed Feb 1, 2022
1 parent b56b560 commit 5fe332b
Show file tree
Hide file tree
Showing 18 changed files with 253 additions and 2 deletions.
17 changes: 17 additions & 0 deletions Blizzard.Ext/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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 changes: 4 additions & 0 deletions Blizzard.Ext/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vscode/**
.vscode-test/**
.gitignore
vsc-extension-quickstart.md
3 changes: 3 additions & 0 deletions Blizzard.Ext/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0

* Added syntax highlighting for Blizzard@1.0.0
21 changes: 21 additions & 0 deletions Blizzard.Ext/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Bradley Myers. All rights reserved.

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.
14 changes: 14 additions & 0 deletions Blizzard.Ext/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Blizzard
========

Blizzard is a programming language that aims for simplicity while maintaining readability. This extension provides support features for the language. You can find the language's repository [here](https://github.com/BLM16/Blizzard).

## Features

Syntax Highlighting

![Syntax Highlighting Preview](https://raw.githubusercontent.com/BLM16/Blizzard/master/Blizzard.Ext/assets/Extension_Preview.jpg)

## Requirements

This extension provides support for the Blizzard programming language. You can find the source code [here](https://github.com/BLM16/Blizzard). Either build the solution yourself, or download the binaries from the [releases](https://github.com/BLM16/Blizzard/releases).
Binary file added Blizzard.Ext/assets/Blizzard_Icon_128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Blizzard.Ext/assets/Extension_Preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Blizzard.Ext/language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// symbols that define comment regions
"comments": {
"lineComment": "//",
"blockComment": [ "/*", "*/" ]
},
// symbols used as brackets
"brackets": [
["(", ")"]
],
// symbols that are auto closed when typing
"autoClosingPairs": [
["(", ")"],
["\"", "\""]
],
// symbols that can be used to surround a selection
"surroundingPairs": [
["(", ")"],
["\"", "\""]
]
}
51 changes: 51 additions & 0 deletions Blizzard.Ext/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "blizzard",
"displayName": "Blizzard",
"version": "1.0.0",
"description": "Blizzard is a programming language that aims for simplicity while maintaining readability.",
"publisher": "BLM16",
"author": {
"name": "Bradley Myers",
"url": "https://github.com/BLM16"
},
"engines": {
"vscode": "*"
},
"categories": [
"Programming Languages"
],
"keywords": [
"blizzard",
"language"
],
"extensionKind": [
"ui",
"workspace"
],
"icon": "assets/Blizzard_Icon_128x128.png",
"galleryBanner": {
"color": "#37b9db",
"theme": "dark"
},
"homepage": "https://github.com/BLM16/Blizzard",
"readme": "https://github.com/BLM16/Blizzard/blob/master/Blizzard.Ext/README.md",
"license": "LICENSE",
"bugs": "https://github.com/BLM16/Blizzard/issues",
"repository": {
"type": "git",
"url": "https://github.com/BLM16/Blizzard.git"
},
"contributes": {
"languages": [{
"id": "blizzard",
"aliases": ["Blizzard", "bzz"],
"extensions": [".bzz"],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "blizzard",
"scopeName": "source.bzz",
"path": "./syntaxes/blizzard.tmLanguage.json"
}]
}
}
72 changes: 72 additions & 0 deletions Blizzard.Ext/syntaxes/blizzard.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Blizzard",
"patterns": [
{ "include": "#comments" },
{ "include": "#literals" },
{ "include": "#types" },
{ "include": "#functionCalls" }
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.block.bzz",
"begin": "/\\*",
"end": "\\*/"
},
{
"name": "comment.line.double-slash.bzz",
"begin": "//",
"end": "$"
}
]
},
"literals": {
"patterns": [
{
"name": "string.quoted.double.bzz",
"begin": "\"",
"end": "\""
},
{
"name": "constant.numeric.dec.bzz",
"match": "-?[0-9]*\\.[0-9]+"
},
{
"name": "constant.numeric.int.bzz",
"match": "-?[0-9]+"
}
]
},
"types": {
"patterns": [
{
"name": "storage.type.str.bzz",
"match": "str"
},
{
"name": "storage.type.dec.bzz",
"match": "dec"
},
{
"name": "storage.type.int.bzz",
"match": "int"
}
]
},
"functionCalls": {
"begin": "([a-zA-Z_][a-zA-Z0-9_]*)\\(",
"end": "\\)",
"beginCaptures": {
"1": {
"name": "entity.name.function"
}
},
"patterns": [
{ "include": "#literals" }
]
}
},
"scopeName": "source.bzz"
}
28 changes: 28 additions & 0 deletions Blizzard/Blizzard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<Company>BLM16</Company>
<Authors>BLM16</Authors>
<Copyright>Copyright (c) 2022 Bradley Myers. All rights reserved.</Copyright>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/BLM16/Blizzard</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>blizzard; language</PackageTags>
<Description>Blizzard is a programming language that aims for simplicity while maintaining readability.</Description>
<Version>1.0.0</Version>
<PackageId>BLM16.Lang.$(AssemblyName)</PackageId>
<PackageLicenseFile>..\LICENSE</PackageLicenseFile>
<PackageIcon>Blizzard_Icon_128x128.png</PackageIcon>
<ApplicationIcon>Blizzard_Icon_128x128.ico</ApplicationIcon>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -23,6 +36,21 @@
<Antlr4 Include="Grammar\blizzard.g4"></Antlr4>
</ItemGroup>

<ItemGroup>
<Content Include="Blizzard_Icon_128x128.ico" />
</ItemGroup>

<ItemGroup>
<None Include="..\assets\Blizzard_Icon_128x128.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Antlr4.Runtime.Standard" Version="4.9.3" />
<PackageReference Include="Antlr4BuildTasks" Version="8.17.0" />
Expand Down
Binary file added Blizzard/Blizzard_Icon_128x128.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion Blizzard/Grammar/blizzard.g4
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ functionCall: IDENTIFIER '(' (expression (',' expression)*)? ')';

TYPE: 'str' | 'int' | 'dec'; // The valid variable types
STRING: '"' ~'"'* '"'; // Matches a string literal
INTEGER: '-'? [1-9][0-9]*; // Matches an integer literal
INTEGER: '-'? [0-9]+; // Matches an integer literal
DECIMAL: '-'? [0-9]* '.' [0-9]+; // Matches a decimal literal

IDENTIFIER: [a-zA-Z_][a-zA-Z0-9_]*; // Name identifier for variables and functions
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## 1.0.0
### Initial language commit | 2022-02-01

* Types & Literals
* `str` uses double quotes "like this"
* `dec` matches decimal numbers
* `int` matches integer numbers
* Arrithmetic operations
* `*` multiplies dec and int
* `/` divides dec and int
* `+` adds dec and int, concatenates with str and any
* `-` subtracts dec and int
* Builtin Functions
* `WRITE` will output its parameters as space separated values to stdout
* `WRITELN` will output its parameters as space separated values to stdout and add the native line terminator
* Comments
* `// ...` creates a line comment
* `/* ... */` creates a block comment
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Blizzard
========

[![C#](https://img.shields.io/static/v1?label=C%23&message=v10&color=brightgreen&link=https://docs.microsoft.com/en-us/dotnet/)](https://docs.microsoft.com/en-us/dotnet/) [![License](https://img.shields.io/badge/license-MIT-blue.svg?label=License&link=https://mit-license.org/)](https://github.com/BLM16/Blizzard/blob/master/LICENSE)
[![C#](https://img.shields.io/static/v1?label=C%23&message=v10&color=brightgreen&link=https://docs.microsoft.com/en-us/dotnet/)](https://docs.microsoft.com/en-us/dotnet/)
[![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/BLM16.blizzard.svg?color=003578&label=VS%20Marketplace)](https://marketplace.visualstudio.com/items?itemName=BLM16.blizzard)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?label=License&link=https://mit-license.org/)](https://github.com/BLM16/Blizzard/blob/master/LICENSE)

Blizzard is a programming language that aims for simplicity while maintaining readability.

Expand Down
Binary file added assets/Blizzard_Icon.psd
Binary file not shown.
Binary file added assets/Blizzard_Icon_128x128.ico
Binary file not shown.
Binary file added assets/Blizzard_Icon_128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5fe332b

Please sign in to comment.