Skip to content

Commit

Permalink
add: attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Anatoly03 committed Oct 2, 2021
1 parent c999d97 commit f79cfdf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions example.nr
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ _CustomUnusedType, _custumUnusedVariable
function(), Class(), _function()
//structure<Hello, World <andEveryoneElse>> // THIS BREAKS: x < y

#[builtin(hello)]
fn WithComment() {

}

// Import

use x::y::z::{
Expand Down
13 changes: 13 additions & 0 deletions src/syntax.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
{
"include": "#syntax"
},
{
"include": "#attribute"
},
{
"include": "#keywords"
},
Expand Down Expand Up @@ -188,6 +191,16 @@
}
]
},
"attribute": {
"begin": "#\\[",
"end": "\\]",
"patterns": [{
"begin": "[a-zA-Z_][a-zA-Z0-9_]\\s*\\(",
"end": "\\)"
}, {
"match": "[a-zA-Z_][a-zA-Z0-9_]"
}]
},
"keywords": {
"patterns": [{
"name": "keyword.control.nr",
Expand Down

0 comments on commit f79cfdf

Please sign in to comment.