2019-05-13 17:16:03 +00:00
|
|
|
{
|
|
|
|
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
|
|
"name": "RISC-V Assembly",
|
|
|
|
"patterns": [
|
|
|
|
{
|
|
|
|
"include": "#structure"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"include": "#entities"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"repository": {
|
|
|
|
"structure": {
|
|
|
|
"patterns": [
|
|
|
|
{
|
|
|
|
"match": "\\b([A-Za-z0-9_]+)(:)",
|
|
|
|
"name": "meta.line.label.riscv",
|
|
|
|
"captures": {
|
|
|
|
"1": {
|
|
|
|
"name": "keyword.name.tag.riscv"
|
|
|
|
},
|
|
|
|
"2": {
|
|
|
|
"name": "punctuation.colon.riscv"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2019-05-19 14:25:03 +00:00
|
|
|
"match": "\\b([A-Za-z]+)\\s*([A-Za-z0-9_-]+)(,)\\s*([A-Za-z0-9_-]+)(\\()([A-Za-z0-9_-]+)(\\))",
|
2019-05-13 17:16:03 +00:00
|
|
|
"name": "meta.line.instruction.parenthesis.riscv",
|
|
|
|
"captures": {
|
|
|
|
"1": {
|
|
|
|
"name": "entity.name.function.riscv"
|
|
|
|
},
|
|
|
|
"2": {
|
|
|
|
"name": "variable.parameter.riscv"
|
|
|
|
},
|
|
|
|
"3": {
|
|
|
|
"name": "punctuation.comma.riscv"
|
|
|
|
},
|
|
|
|
"4": {
|
|
|
|
"name": "variable.parameter.riscv"
|
|
|
|
},
|
|
|
|
"5": {
|
|
|
|
"name": "punctuation.parenthesis.open.riscv"
|
|
|
|
},
|
|
|
|
"6": {
|
|
|
|
"name": "variable.parameter.riscv"
|
|
|
|
},
|
|
|
|
"7": {
|
|
|
|
"name": "punctuation.parenthesis.close.riscv"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2019-05-19 14:25:03 +00:00
|
|
|
"match": "\\b([A-Za-z]+)(?:\\s*([A-Za-z0-9_-]+))?(?:(,)\\s*([A-Za-z0-9_-]+))?(?:(,)\\s*([A-Za-z0-9_-]+))?\\b",
|
2019-05-13 17:16:03 +00:00
|
|
|
"name": "meta.line.instruction.riscv",
|
|
|
|
"captures": {
|
|
|
|
"1": {
|
|
|
|
"name": "entity.name.function.riscv"
|
|
|
|
},
|
|
|
|
"2": {
|
|
|
|
"name": "variable.parameter.riscv"
|
|
|
|
},
|
|
|
|
"3": {
|
|
|
|
"name": "punctuation.comma.riscv"
|
|
|
|
},
|
|
|
|
"4": {
|
|
|
|
"name": "variable.parameter.riscv"
|
|
|
|
},
|
|
|
|
"5": {
|
|
|
|
"name": "punctuation.comma.riscv"
|
|
|
|
},
|
|
|
|
"6": {
|
|
|
|
"name": "variable.parameter.riscv"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"entities": {
|
|
|
|
"patterns": [
|
|
|
|
{
|
|
|
|
"begin": "\"",
|
|
|
|
"end": "\"",
|
|
|
|
"name": "string.quoted.double.riscv",
|
|
|
|
"patterns": [
|
|
|
|
{
|
|
|
|
"match": "\\\\.",
|
|
|
|
"name": "constant.character.escape.riscv"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2019-05-19 14:27:42 +00:00
|
|
|
"match": "#.*",
|
2019-05-13 17:16:03 +00:00
|
|
|
"name": "comment.line.number-sign.riscv"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"match": "\\.[A-Za-z0-9_-]+",
|
|
|
|
"name": "constant.language.riscv"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"scopeName": "source.riscv"
|
|
|
|
}
|