Skip to content

Commit

Permalink
Improved syntax colouration for operator support for #if
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Chen <alchen@redhat.com>
  • Loading branch information
Alexander Chen committed Apr 1, 2022
1 parent 6b7ef63 commit 8e112dc
Showing 1 changed file with 44 additions and 12 deletions.
56 changes: 44 additions & 12 deletions language-support/qute/qute.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"repository": {
"templates": {
"patterns": [
{
"include": "#section_start_if_tag"
},
{
"include": "#section_start_default_tag"
},
Expand Down Expand Up @@ -86,7 +89,7 @@
"name": "string.unquoted.cdata.qute"
},
"section_start_default_tag": {
"begin": "({)(#)((each|else|else\\sif|eval|for|if|include|insert|set|let|with|switch|case|is|when)\\b)",
"begin": "({)(#)((each|else|else\\sif|eval|for|include|insert|set|let|with|switch|case|is|when)\\b)",
"end": "(\\/)?((?<![\\\\])})",
"beginCaptures": {
"1": {
Expand Down Expand Up @@ -133,6 +136,38 @@
}
}
},
"section_start_if_tag": {
"begin": "({)(#)((if)\\b)",
"end": "(\\/)?((?<![\\\\])})",
"beginCaptures": {
"1": {
"name": "support.constant.handlebars"
},
"2": {
"name": "keyword.control"
},
"3": {
"name": "keyword.control"
}
},
"endCaptures": {
"1": {
"name": "keyword.control"
},
"2": {
"name": "support.constant.handlebars"
}
},
"patterns": [
{
"match": "(gt|ge|lt|le|eq|is|ne|and|or)",
"name": "keyword.control.qute"
},
{
"include": "#code"
}
]
},
"section_start_user_tag": {
"begin": "({)(#)(\\w+(\\.\\w+)*)",
"end": "(\\/)?((?<![\\\\])})",
Expand Down Expand Up @@ -221,9 +256,6 @@
{
"include": "#lambda-expression"
},
{
"include": "#keywords"
},
{
"include": "#method-call"
},
Expand Down Expand Up @@ -361,7 +393,7 @@
}
]
},
"keywords": {
"keywordsToRemove": {
"patterns": [
{
"match": "\\bthrow\\b",
Expand All @@ -379,10 +411,6 @@
"match": "((&|\\^|\\||<<|>>>?)=)",
"name": "keyword.operator.assignment.bitwise.java"
},
{
"match": "(===?|!=|<=|>=|<>|<|>)",
"name": "keyword.operator.comparison.java"
},
{
"match": "([+*/%-]=)",
"name": "keyword.operator.assignment.arithmetic.java"
Expand All @@ -400,16 +428,20 @@
"name": "keyword.operator.arithmetic.java"
},
{
"match": "(!|&&|\\|\\|)",
"match": "(!)",
"name": "keyword.operator.logical.java"
},
{
"match": "(\\||&)",
"name": "keyword.operator.bitwise.java"
},
{
"match": "\\b(is|as|eq|ne|gt|ge|lt|le)\\b",
"name": "keyword.control.operator"
"match": "(?<=({#if\\s(\\w)*\\s))(gt|ge|lt|le|eq|is|ne|and|or)",
"name": "keyword.control.qute"
},
{
"match": "(?<=({#if\\s(\\w)*\\s))(>|>=|<|<=|==|!=|&&|\\|\\|)",
"name": "keyword.operator.qute"
},
{
"match": "(?<=({#for\\s(\\w)*\\s))in",
Expand Down

0 comments on commit 8e112dc

Please sign in to comment.