vscode: add keywords, strings, comments, and selector labels to ivy grammar
This commit is contained in:
@@ -2,21 +2,84 @@
|
|||||||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
||||||
"name": "Ivy",
|
"name": "Ivy",
|
||||||
"patterns": [
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#comment"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#const"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#ident"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"include": "#keywords"
|
"include": "#keywords"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"include": "#strings"
|
"include": "#strings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#class"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"repository": {
|
"repository": {
|
||||||
|
"ident": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "variable.parameter.ivy",
|
||||||
|
"match": "\\b[a-z]([A-Za-z0-9_]+):\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "entity.name.type.ivy",
|
||||||
|
"match": "\\[A-Z]{1,2}([a-z0-9]+[A-Z]{0,2})*\\b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"const": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "constant.numeric.ivy",
|
||||||
|
"match": "[\\b\\s]#[a-z0-9]*[\\b\\s]"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"keywords": {
|
"keywords": {
|
||||||
"patterns": [{
|
"patterns": [
|
||||||
|
{
|
||||||
"name": "keyword.control.ivy",
|
"name": "keyword.control.ivy",
|
||||||
"match": "\\b(if|while|for|return)\\b"
|
"match": "\\b(for|while|break|continue|if|elif|else|unless|match)[^:]\\b"
|
||||||
}]
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.control.ivy",
|
||||||
|
"match": "\\b(for|while|break|continue|if|elif|else|unless|match)[^:]\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "storage.type.ivy",
|
||||||
|
"match": "\\b(class|protocol)[^:]\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.other.ivy",
|
||||||
|
"match": "\\b(package|use|in)[^:]\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.other.ivy",
|
||||||
|
"match": "\\b(package|use|in)[^:]\\b"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"strings": {
|
"strings": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "string.quoted.single.ivy",
|
||||||
|
"begin": "'",
|
||||||
|
"end": "'",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "constant.character.escape.ivy",
|
||||||
|
"match": "\\\\."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
"name": "string.quoted.double.ivy",
|
"name": "string.quoted.double.ivy",
|
||||||
"begin": "\"",
|
"begin": "\"",
|
||||||
"end": "\"",
|
"end": "\"",
|
||||||
@@ -27,6 +90,30 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"comment": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "comment.block.ivy",
|
||||||
|
"begin": "/\\*",
|
||||||
|
"end": "\\*/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "comment.line",
|
||||||
|
"begin": "--",
|
||||||
|
"end": "\\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "entity.name.function.ivy",
|
||||||
|
"match": "\\b(?<=- )[a-z][A-Za-z0-9_]*"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"scopeName": "source.ivy"
|
"scopeName": "source.ivy"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user