128 lines
3.7 KiB
JSON
128 lines
3.7 KiB
JSON
{
|
|
"name": "Viper",
|
|
"scopeName": "source.viper",
|
|
"patterns": [
|
|
{
|
|
"include": "#comment"
|
|
},
|
|
{
|
|
"include": "#keyword"
|
|
},
|
|
{
|
|
"include": "#string"
|
|
},
|
|
{
|
|
"include": "#number"
|
|
},
|
|
{
|
|
"include": "#decorator"
|
|
}
|
|
],
|
|
"repository": {
|
|
"comment": {
|
|
"patterns": [
|
|
{
|
|
"name": "comment.line.number-sign.viper",
|
|
"match": "#.*$"
|
|
}
|
|
]
|
|
},
|
|
"keyword": {
|
|
"patterns": [
|
|
{
|
|
"name": "keyword.control.flow.viper",
|
|
"match": "\\b(if|elif|else|while|for|in|return|break|continue|pass|raise|try|except|finally|with|as|import|from|yield|async|await|del|assert|lambda|match|case)\\b"
|
|
},
|
|
{
|
|
"name": "storage.type.function.viper",
|
|
"match": "\\bdef\\b"
|
|
},
|
|
{
|
|
"name": "storage.type.class.viper",
|
|
"match": "\\bclass\\b"
|
|
},
|
|
{
|
|
"name": "keyword.other.viper",
|
|
"match": "\\b(global|nonlocal|is|not|and|or|type)\\b"
|
|
},
|
|
{
|
|
"name": "constant.language.null.viper",
|
|
"match": "\\bNone\\b"
|
|
},
|
|
{
|
|
"name": "constant.language.boolean.viper",
|
|
"match": "\\b(True|False)\\b"
|
|
}
|
|
]
|
|
},
|
|
"string": {
|
|
"patterns": [
|
|
{
|
|
"name": "string.quoted.double.block.viper",
|
|
"begin": "\"\"\"",
|
|
"end": "\"\"\"",
|
|
"patterns": [
|
|
{
|
|
"include": "#fstring-interpolation"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "string.quoted.single.block.viper",
|
|
"begin": "'''",
|
|
"end": "'''",
|
|
"patterns": [
|
|
{
|
|
"include": "#fstring-interpolation"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "string.quoted.double.viper",
|
|
"begin": "\"",
|
|
"end": "\"",
|
|
"patterns": [
|
|
{
|
|
"include": "#fstring-interpolation"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "string.quoted.single.viper",
|
|
"begin": "'",
|
|
"end": "'",
|
|
"patterns": [
|
|
{
|
|
"include": "#fstring-interpolation"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"fstring-interpolation": {
|
|
"patterns": [
|
|
{
|
|
"name": "meta.embedded.interpolation.viper",
|
|
"match": "\\{[^}]*\\}"
|
|
}
|
|
]
|
|
},
|
|
"number": {
|
|
"patterns": [
|
|
{
|
|
"name": "constant.numeric.viper",
|
|
"match": "\\b(0x[0-9a-fA-F]+|0o[0-7]+|0b[01]+|\\d+\\.?\\d*([eE][+-]?\\d+)?)\\b"
|
|
}
|
|
]
|
|
},
|
|
"decorator": {
|
|
"patterns": [
|
|
{
|
|
"name": "entity.name.function.decorator.viper",
|
|
"match": "@[a-zA-Z_][a-zA-Z0-9_.]*"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|