Skip to content

Commit

Permalink
fix: support syntax highlighting for oneliners (#266)
Browse files Browse the repository at this point in the history
Support syntax highligthing for oneliners
  • Loading branch information
vetlek authored Sep 1, 2023
1 parent f15b4f1 commit 608a0a5
Showing 1 changed file with 20 additions and 35 deletions.
55 changes: 20 additions & 35 deletions syntaxes/septic.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
{
"include": "#tagmap"
},
{
"include": "#numeric"
},
{
"include": "#bitfield"
},
{
"include": "#variable"
},
{
"comment": "Should be removed and fix grps etc explicitly using begin/end instead",
"include": "#string"
Expand All @@ -25,25 +34,13 @@
"keyword": {
"patterns": [
{
"match": "\\b(\\w*)\\b(:)[\\s]*([\\w\\ \\{\\}\\*\\-<>]*)\\b",
"match": "\\b(\\w+)(:)\\s",
"captures": {
"1": {
"name": "entity.name.class.septic"
},
"2": {
"name": "punctuation.separator.key-value.mapping.septic"
},
"3": {
"name": "entity.other.variable.septic",
"patterns": [
{
"include": "source.jinja"
},
{
"name": "variable.name.septic",
"match": "\\b([\\w\\ \\{\\}\\*\\-<>]*)\\b"
}
]
}
}
}
Expand All @@ -62,33 +59,13 @@
"tagmap_default": {
"patterns": [
{
"match": "\\b(\\w*)\\b(=)[\\s]*(.*)$",
"match": "\\b(\\w*)\\b(=)[\\s]+",
"captures": {
"1": {
"name": "entity.name.tag.septic"
},
"2": {
"name": "punctuation.separator.key-value.mapping.septic"
},
"3": {
"name": "entity.other.variable.septic",
"patterns": [
{
"include": "source.jinja"
},
{
"include": "#line_comment"
},
{
"include": "#bitfield"
},
{
"include": "#numeric"
},
{
"include": "#string"
}
]
}
}
}
Expand All @@ -98,7 +75,7 @@
"comment": "Overrides regular tagmap for the Alg line in CalcPvr",
"patterns": [
{
"match": "^\\s*\\b(Alg)\\b(=)[\\s]*(\")(.*)(\")",
"match": "\\b(Alg)\\b(=)[\\s]*(\")(.*?)(\")",
"captures": {
"1": {
"name": "entity.name.tag.septic"
Expand Down Expand Up @@ -139,6 +116,14 @@
}
]
},
"variable": {
"patterns": [
{
"match": "(\\{\\{[\\S\\s]+?\\}\\}|[\\w\\-\\*]+)+",
"name": "variable.name.septic"
}
]
},
"calc": {
"begin": "(\\w*)(\\()",
"end": "\\)",
Expand Down

0 comments on commit 608a0a5

Please sign in to comment.