Skip to content

Commit 6bb99d2

Browse files
committed
Initial commit.
0 parents  commit 6bb99d2

File tree

8 files changed

+232
-0
lines changed

8 files changed

+232
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
out
2+
dist
3+
node_modules
4+
.vscode-test-web/
5+
*.vsix

.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Test Extension",
6+
"type": "extensionHost",
7+
"request": "launch",
8+
"runtimeExecutable": "${execPath}",
9+
"args": [
10+
"--extensionDevelopmentPath=${workspaceFolder}",
11+
"${workspaceFolder}/examples"
12+
],
13+
}
14+
]
15+
}

.vscodeignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vscode/**
2+
node_modules/**
3+
.gitignore
4+
examples/**

LICENSE.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Copyright (C) Project Unnamed contributors
2+
3+
Permission to use, copy, modify, and/or distribute this software for
4+
any purpose with or without fee is hereby granted.
5+
6+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
11+
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
12+
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Project Unnamed IR Syntax Highlighting
2+
======================================
3+
4+
This repository provides Project Unnamed intermediate representation syntax highlighting for [Visual Studio Code](https://code.visualstudio.com/).
5+
6+
Installation
7+
------------
8+
9+
Run `vsce pack` and install the resulting `*.vsix` file manually.
10+
11+
License
12+
-------
13+
14+
[0-clause BSD](LICENSE.txt).

examples/alsru.uir

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
; Boneless ALSRU
2+
%0:2 = input "i_a"
3+
%2:2 = input "i_b"
4+
%4:1 = input "i_c"
5+
%5:5 = input "c_op"
6+
%10:1 = input "i_h"
7+
%11:1 = input "c_dir"
8+
%12:1 = input "clk"
9+
%13:1 = input "rst"
10+
%14:2 = match en=1 %11 {
11+
[0]
12+
[1]
13+
}
14+
%16:4 = match en=1 {%5+1 %5+0} {
15+
[01]
16+
[10]
17+
[11]
18+
[00]
19+
}
20+
%20:2 = and %0:2 %2:2
21+
%22:2 = or %0:2 %2:2
22+
%24:2 = xor %0:2 %2:2
23+
%26:4 = match en=1 {%5+3 %5+2} {
24+
[00]
25+
[01]
26+
[10]
27+
[11]
28+
}
29+
%30:2 = not %2:2
30+
%32:4 = adc {0 %58+1 %58+0} {0 %66+1 %66+0} 0
31+
%36:5 = adc {0 %32+2 %32+1 %32+0} {0 0 0 %4+0} 0
32+
%41:2 = match en=1 %5+4 {
33+
[0]
34+
[1]
35+
}
36+
%43:2 = match en=1 {%70+1 %66+1 %58+1} {
37+
[100]
38+
[011]
39+
}
40+
%45:1 = eq %70:2 00
41+
%46:2 = assign en=%14+0 00 {%77+0 %10+0} at=#0
42+
%48:2 = assign en=%14+1 %46:2 {%10+0 %77+1} at=#0
43+
%50:1 = assign en=%14+0 0 %77+1 at=#0
44+
%51:1 = assign en=%14+1 %50 %77+0 at=#0
45+
%52:2 = assign en=%16+0 00 %20:2 at=#0
46+
%54:2 = assign en=%16+1 %52:2 %22:2 at=#0
47+
%56:2 = assign en=%16+2 %54:2 %24:2 at=#0
48+
%58:2 = assign en=%16+3 %56:2 %0:2 at=#0
49+
%60:2 = assign en=%26+0 00 00 at=#0
50+
%62:2 = assign en=%26+1 %60:2 %48:2 at=#0
51+
%64:2 = assign en=%26+2 %62:2 %2:2 at=#0
52+
%66:2 = assign en=%26+3 %64:2 %30:2 at=#0
53+
%68:2 = assign en=%41+0 00 {%36+1 %36+0} at=#0
54+
%70:2 = assign en=%41+1 %68:2 %66:2 at=#0
55+
%72:1 = assign en=%43+0 0 1 at=#0
56+
%73:1 = assign en=%43+1 %72 1 at=#0
57+
%74:1 = match en=1 %13 {
58+
[1]
59+
}
60+
%75:2 = assign en=%74 %70:2 00 at=#0
61+
%77:2 = dff %75:2 clk=%12 init=00
62+
%79:0 = output "o_o" %70:2
63+
%80:0 = output "o_z" %45
64+
%81:0 = output "o_s" %70+1
65+
%82:0 = output "o_c" %36+2
66+
%83:0 = output "o_v" %73
67+
%84:0 = output "o_h" %51
68+
%85:0 = name "alsru i_a" %0:2
69+
%86:0 = name "alsru i_b" %2:2
70+
%87:0 = name "alsru i_c" %4
71+
%88:0 = name "alsru o_o" %70:2
72+
%89:0 = name "alsru o_z" %45
73+
%90:0 = name "alsru o_s" %70+1
74+
%91:0 = name "alsru o_c" %36+2
75+
%92:0 = name "alsru o_v" %73
76+
%93:0 = name "alsru c_op" %5:5
77+
%94:0 = name "alsru i_h" %10
78+
%95:0 = name "alsru o_h" %51
79+
%96:0 = name "alsru c_dir" %11
80+
%97:0 = name "alsru clk" %12
81+
%98:0 = name "alsru rst" %13
82+
%99:0 = name "alsru dec_op" %5:5
83+
%100:0 = name "alsru s_s" %48:2
84+
%101:0 = name "alsru r_o" %77:2
85+
%102:0 = name "alsru s_x" %58:2
86+
%103:0 = name "alsru s_y" %66:2
87+
%104:0 = name "alsru s_p" {%36+1 %36+0}

package.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"publisher": "whitequark",
3+
"name": "prjunnamed-syntax",
4+
"displayName": "Project Unnamed IR syntax",
5+
"description": "Project Unnamed intermediate representation syntax highlighting for Visual Studio Code",
6+
"author": "Catherine <[email protected]>",
7+
"license": "BSD-0-Clause",
8+
"homepage": "https://github.com/prjunnamed/",
9+
"version": "0.1.0",
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/prjunnamed/vscode-syntax.git"
13+
},
14+
"engines": {
15+
"vscode": "^1.82.0"
16+
},
17+
"extensionKind": [
18+
"ui"
19+
],
20+
"categories": [
21+
"Programming Languages"
22+
],
23+
"contributes": {
24+
"languages": [
25+
{
26+
"id": "prjunnamed",
27+
"aliases": [
28+
"Project Unnamed IR"
29+
],
30+
"extensions": [
31+
".uir"
32+
]
33+
}
34+
],
35+
"grammars": [
36+
{
37+
"language": "prjunnamed",
38+
"scopeName": "source.prjunnamed",
39+
"path": "./syntaxes/prjunnamed.tmLanguage.json"
40+
}
41+
]
42+
},
43+
"scripts": {},
44+
"devDependencies": {}
45+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"scopeName": "source.prjunnamed",
3+
"patterns": [
4+
{"include": "#comment"},
5+
{"include": "#decimal"},
6+
{"include": "#ternary"},
7+
{"include": "#string"},
8+
{"include": "#io-port"},
9+
{"include": "#cell-ref"},
10+
{"include": "#cell-name"}
11+
],
12+
"repository": {
13+
"comment": {
14+
"match": ";.+",
15+
"name": "comment.line.prjunnamed"
16+
},
17+
"decimal": {
18+
"match": "#\\d+",
19+
"name": "constant.numeric.decimal.prjunnamed"
20+
},
21+
"ternary": {
22+
"match": "[01X]+",
23+
"name": "constant.numeric.binary.prjunnamed"
24+
},
25+
"string-escape": {
26+
"match": "\\[0-9a-f]{2}",
27+
"name": "constant.character.escape.prjunnamed"
28+
},
29+
"string": {
30+
"begin": "\"",
31+
"end": "\"",
32+
"name": "string.quoted.double.prjunnamed",
33+
"patterns": [{ "include": "#string-escape" }]
34+
},
35+
"io-port": {
36+
"begin": "&\"",
37+
"end": "(\"):\\d+",
38+
"name": "entity.name.io-port.prjunnamed",
39+
"patterns": [{ "include": "#string-escape" }]
40+
},
41+
"cell-ref": {
42+
"match": "%\\d+(:\\d+)?(\\+\\d+)?",
43+
"name": "variable.parameter.prjunnamed"
44+
},
45+
"cell-name": {
46+
"match": "buf|not|and|or|xor|mux|adc|eq|ult|slt|shl|ushr|sshr|xshr|mul|udiv|umod|sdiv_trunc|sdiv_floor|smod_trunc|smod_floor|match|assign|dff|memory|iob|target|input|output|name",
47+
"name": "keyword.other.cell.prjunnamed"
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)