Skip to content

Commit

Permalink
Syntax highlighting for interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
pdesaulniers committed Aug 24, 2024
1 parent dfcc884 commit 34732a8
Showing 1 changed file with 41 additions and 6 deletions.
47 changes: 41 additions & 6 deletions syntaxes/teal.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"include": "#table-constructor"
},
{
"include": "#record-block"
"include": "#record-or-interface-block"
},
{
"include": "#enum-block"
Expand Down Expand Up @@ -621,19 +621,54 @@
}
]
},
"record-block": {
"begin": "\\brecord\\b",
"record-or-interface-block": {
"begin": "\\b(record|interface)\\b",
"end": "\\bend\\b",
"captures": {
"0": {
"name": "storage.type.record.teal"
}
},
"name": "statement.record-block.teal",
"name": "statement.record-or-interface-block.teal",
"patterns": [
{
"include": "#comment"
},
{
"begin": "\\b(is)\\b",
"end": "(?=\\bend\\b|\\bwhere\\b|\\brecord\\b|\\benum\\b|\\buserdata\\b|\\bmetamethod\\b|\\[|^\\s*[a-zA-Z_][a-zA-Z0-9_]*\\s*:)",
"captures": {
"0": {
"name": "keyword.other.teal"
}
},
"patterns": [
{
"include": "#comment"
},
{
"include": "#type"
}
]
},
{
"begin": "\\b(where)\\b",
"end": "(?=\\bend\\b|\\brecord\\b|\\benum\\b|\\buserdata\\b|\\bmetamethod\\b|\\[|^\\s*[a-zA-Z_][a-zA-Z0-9_]*\\s*:)",
"name": "where-clause.teal",
"captures": {
"0": {
"name": "keyword.control.teal"
}
},
"patterns": [
{
"include": "#comment"
},
{
"include": "#expression"
}
]
},
{
"comment": "Support ['key'] notation in record declarations; see https://github.com/teal-language/tl/issues/746#issuecomment-2108757909",
"include": "#brackets"
Expand All @@ -642,7 +677,7 @@
"include": "#enum-block"
},
{
"include": "#record-block"
"include": "#record-or-interface-block"
},
{
"include": "#new-type-declaration"
Expand Down Expand Up @@ -713,7 +748,7 @@
"include": "#function-call"
},
{
"include": "#record-block"
"include": "#record-or-interface-block"
},
{
"include": "#enum-block"
Expand Down

0 comments on commit 34732a8

Please sign in to comment.