From 7568e7982d19167ab61693cbed2ed8fa811f81c1 Mon Sep 17 00:00:00 2001 From: wilsong-anl Date: Mon, 29 Sep 2025 15:29:31 -0500 Subject: [PATCH] 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. --- syntaxes/fortran_free-form.tmLanguage.json | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/syntaxes/fortran_free-form.tmLanguage.json b/syntaxes/fortran_free-form.tmLanguage.json index 619eb14c..c0df09d9 100644 --- a/syntaxes/fortran_free-form.tmLanguage.json +++ b/syntaxes/fortran_free-form.tmLanguage.json @@ -1642,11 +1642,11 @@ { "comment": "rest of else line", "begin": "(?!(\\s*(;|!|\\n)))", - "end": "(?=[;!\\n])", + "end": "\\s*(?=[;!\\n])", "patterns": [ { "comment": "capture the label if present", - "match": "\\s*([a-z]\\w*)?\\s*\\b(\\w*)\\b", + "match": "(?i)\\s*([a-z]\\w*)?\\s*\\b(\\w*)\\b", "captures": { "1": { "name": "meta.label.else.fortran" @@ -1882,11 +1882,20 @@ "name": "keyword.control.elsewhere.fortran" } }, - "end": "(?=[;!\\n])", + "end": "\\s*(?=[;!\\n])", "patterns": [ { "include": "#parentheses" }, + { + "comment": "capture the label if present", + "match": "(?i)(\\s*[a-z]\\w*)?", + "captures": { + "1": { + "name": "meta.label.elsewhere.fortran" + } + } + }, { "include": "#invalid-word" }