Skip to content

Commit f79cfdf

Browse files
committed
add: attributes
1 parent c999d97 commit f79cfdf

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

example.nr

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ _CustomUnusedType, _custumUnusedVariable
2020
function(), Class(), _function()
2121
//structure<Hello, World <andEveryoneElse>> // THIS BREAKS: x < y
2222

23+
#[builtin(hello)]
24+
fn WithComment() {
25+
26+
}
27+
2328
// Import
2429

2530
use x::y::z::{

src/syntax.json

+13
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
{
1919
"include": "#syntax"
2020
},
21+
{
22+
"include": "#attribute"
23+
},
2124
{
2225
"include": "#keywords"
2326
},
@@ -188,6 +191,16 @@
188191
}
189192
]
190193
},
194+
"attribute": {
195+
"begin": "#\\[",
196+
"end": "\\]",
197+
"patterns": [{
198+
"begin": "[a-zA-Z_][a-zA-Z0-9_]\\s*\\(",
199+
"end": "\\)"
200+
}, {
201+
"match": "[a-zA-Z_][a-zA-Z0-9_]"
202+
}]
203+
},
191204
"keywords": {
192205
"patterns": [{
193206
"name": "keyword.control.nr",

0 commit comments

Comments
 (0)