Skip to content

Commit 7568e79

Browse files
authored
Update fortran_free-form.tmLanguage.json for labeled "if" and "where" statements
Some correct syntax of labeled "if" and "where" statements messed up the syntax highlighting. This commit fixes those issues.
1 parent 2e2182a commit 7568e79

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

syntaxes/fortran_free-form.tmLanguage.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,11 +1642,11 @@
16421642
{
16431643
"comment": "rest of else line",
16441644
"begin": "(?!(\\s*(;|!|\\n)))",
1645-
"end": "(?=[;!\\n])",
1645+
"end": "\\s*(?=[;!\\n])",
16461646
"patterns": [
16471647
{
16481648
"comment": "capture the label if present",
1649-
"match": "\\s*([a-z]\\w*)?\\s*\\b(\\w*)\\b",
1649+
"match": "(?i)\\s*([a-z]\\w*)?\\s*\\b(\\w*)\\b",
16501650
"captures": {
16511651
"1": {
16521652
"name": "meta.label.else.fortran"
@@ -1882,11 +1882,20 @@
18821882
"name": "keyword.control.elsewhere.fortran"
18831883
}
18841884
},
1885-
"end": "(?=[;!\\n])",
1885+
"end": "\\s*(?=[;!\\n])",
18861886
"patterns": [
18871887
{
18881888
"include": "#parentheses"
18891889
},
1890+
{
1891+
"comment": "capture the label if present",
1892+
"match": "(?i)(\\s*[a-z]\\w*)?",
1893+
"captures": {
1894+
"1": {
1895+
"name": "meta.label.elsewhere.fortran"
1896+
}
1897+
}
1898+
},
18901899
{
18911900
"include": "#invalid-word"
18921901
}

0 commit comments

Comments
 (0)