Skip to content

Commit b3a5362

Browse files
committed
Add syntax for metadata.
1 parent 58a7c1f commit b3a5362

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

examples/metadata.uir

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
!1 = source "top.py" (#1 #2) (#3 #4)
2+
!2 = scope "top" src=!1
3+
!3 = scope "buf" in=!2 src=!1
4+
!4 = ident "meow" in=!3
5+
!5 = {!3 !4}
6+
%0:1 = buf 0 !5

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"author": "Catherine <[email protected]>",
77
"license": "BSD-0-Clause",
88
"homepage": "https://github.com/prjunnamed/",
9-
"version": "0.3.0",
9+
"version": "0.4.0",
1010
"repository": {
1111
"type": "git",
1212
"url": "https://github.com/prjunnamed/vscode-syntax.git"

syntaxes/prjunnamed.tmLanguage.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
{"include": "#ternary"},
1010
{"include": "#string"},
1111
{"include": "#keyword"},
12-
{"include": "#io-port"},
12+
{"include": "#metadata-ref"},
13+
{"include": "#io-ref"},
1314
{"include": "#cell-ref"},
14-
{"include": "#cell-ref-added"},
15+
{"include": "#cell-ref-new"},
1516
{"include": "#memory-cell"},
1617
{"include": "#diff-added"},
1718
{"include": "#diff-removed"}
@@ -40,20 +41,24 @@
4041
"patterns": [{"include": "#string-escape"}]
4142
},
4243
"keyword": {
43-
"match": "set|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|iobuf|target|param|input|output|io|name|debug",
44+
"match": "source|scope|ident|set|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|iobuf|target|param|input|output|io|name|debug",
4445
"name": "keyword.other.prjunnamed"
4546
},
46-
"io-port": {
47+
"metadata-ref": {
48+
"match": "!\\d+",
49+
"name": "variable.other.prjunnamed"
50+
},
51+
"io-ref": {
4752
"begin": "&\"",
4853
"end": "(\")(:\\d+)?(\\+\\d+)?",
49-
"name": "entity.name.io-port.prjunnamed",
54+
"name": "entity.name.io-ref.prjunnamed",
5055
"patterns": [{"include": "#string-escape"}]
5156
},
5257
"cell-ref": {
5358
"match": "%\\d+(:\\d+)?(\\+\\d+)?",
5459
"name": "variable.other.prjunnamed"
5560
},
56-
"cell-ref-added": {
61+
"cell-ref-new": {
5762
"match": "%_\\d+(:\\d+)?(\\+\\d+)?",
5863
"name": "markup.inserted.prjunnamed"
5964
},
@@ -66,7 +71,7 @@
6671
{"include": "#decimal"},
6772
{"include": "#ternary"},
6873
{"include": "#cell-ref"},
69-
{"include": "#cell-ref-added"},
74+
{"include": "#cell-ref-new"},
7075
{"include": "#memory-keyword"}
7176
]
7277
},

0 commit comments

Comments
 (0)