From a4eaca43e1328d1b55948c457f48a068243223a6 Mon Sep 17 00:00:00 2001 From: "Pedro Ricardo C. Souza" Date: Mon, 24 Feb 2020 20:36:23 -0300 Subject: [PATCH 1/2] Fix wrong select highlight on declarations with --- syntaxes/fortran_free-form.tmLanguage.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/syntaxes/fortran_free-form.tmLanguage.json b/syntaxes/fortran_free-form.tmLanguage.json index 4f6cb6b1..84af8d51 100644 --- a/syntaxes/fortran_free-form.tmLanguage.json +++ b/syntaxes/fortran_free-form.tmLanguage.json @@ -2110,6 +2110,9 @@ "include": "#invalid-word" } ] + }, + { + "include": "#line-continuation-operator" } ] }, @@ -4070,6 +4073,9 @@ { "include": "#types" }, + { + "include": "#line-continuation-operator" + }, { "comment": "Attribute list.", "contentName": "meta.attribute-list.fortran", @@ -4148,6 +4154,9 @@ "include": "#invalid-word" } ] + }, + { + "include": "#line-continuation-operator" } ] }, @@ -4939,6 +4948,9 @@ }, { "include": "#variable" + }, + { + "include": "#line-continuation-operator" } ] }, From 5f71dc508b8a5c0c4783acb641c2068060ad772d Mon Sep 17 00:00:00 2001 From: "Pedro Ricardo C. Souza" Date: Tue, 25 Feb 2020 10:38:43 -0300 Subject: [PATCH 2/2] Rebuild select constructs to be separated by kind (case|type|rank) --- syntaxes/fortran_free-form.tmLanguage.json | 244 +++++++++++++-------- 1 file changed, 148 insertions(+), 96 deletions(-) diff --git a/syntaxes/fortran_free-form.tmLanguage.json b/syntaxes/fortran_free-form.tmLanguage.json index 84af8d51..296fbcca 100644 --- a/syntaxes/fortran_free-form.tmLanguage.json +++ b/syntaxes/fortran_free-form.tmLanguage.json @@ -994,7 +994,13 @@ "include": "#if-construct" }, { - "include": "#select-construct" + "include": "#select-case-construct" + }, + { + "include": "#select-type-construct" + }, + { + "include": "#select-rank-construct" }, { "include": "#where-construct" @@ -1274,121 +1280,167 @@ } ] }, - "select-construct": { + "select-case-construct":{ + "comment": "Select case construct. Introduced in the Fortran 1990 standard.", + "begin": "(?i)\\b(select)\\s*(case)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.select.fortran" + }, + "2": { + "name": "keyword.control.case.fortran" + } + }, + "end": "(?i)(?=\\b(end\\s*select)\\b)", + "endCaptures": { + "1": { + "name": "keyword.control.endselect.fortran" + } + }, "patterns": [ { - "name": "meta.block.select.fortran", - "begin": "(?i)\\b(select)", + "include": "#parentheses" + }, + { + "begin": "(?i)\\b(case)\\b", "beginCaptures": { "1": { - "name": "keyword.control.select.fortran" + "name": "keyword.control.case.fortran" } }, - "end": "(?i)\\b(end\\s*select)\\b", - "endCaptures": { + "end": "(?i)(?=[;!\\n])", + "patterns": [ + { + "match": "(?i)\\G\\s*\\b(default)\\b", + "captures": { + "1": { + "name": "keyword.control.default.fortran" + } + } + }, + { + "include": "#parentheses" + }, + { + "include": "#invalid-word" + } + ] + }, + { + "include": "$base" + } + ] + }, + "select-type-construct":{ + "comment": "Select type construct. Introduced in the Fortran 2003 standard.", + "begin": "(?i)\\b(select)\\s*(type)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.select.fortran" + }, + "2": { + "name": "keyword.control.type.fortran" + } + }, + "end": "(?i)(?=\\b(end\\s*select)\\b)", + "endCaptures": { + "1": { + "name": "keyword.control.endselect.fortran" + } + }, + "patterns": [ + { + "include": "#parentheses" + }, + { + "begin": "(?i)\\b(?:(class)|(type))", + "beginCaptures": { "1": { - "name": "keyword.control.endselect.fortran" + "name": "keyword.control.class.fortran" + }, + "2": { + "name": "keyword.control.type.fortran" } }, + "end": "(?i)(?=[;!\\n])", "patterns": [ { - "comment": "Select case construct. Introduced in the Fortran 1990 standard.", - "begin": "(?i)\\s*(case)\\b", - "beginCaptures": { + "match": "(?i)\\G\\s*\\b(default)\\b", + "captures": { "1": { - "name": "keyword.control.case.fortran" - } - }, - "end": "(?i)(?=\\b(end\\s*select)\\b)", - "patterns": [ - { - "include": "#parentheses" - }, - { - "begin": "(?i)\\b(case)\\b", - "beginCaptures": { - "1": { - "name": "keyword.control.case.fortran" - } - }, - "end": "(?i)(?=[;!\\n])", - "patterns": [ - { - "match": "(?i)\\G\\s*\\b(default)\\b", - "captures": { - "1": { - "name": "keyword.control.default.fortran" - } - } - }, - { - "include": "#parentheses" - }, - { - "include": "#invalid-word" - } - ] - }, - { - "include": "$base" + "name": "keyword.control.default.fortran" } - ] + } }, { - "comment": "Select type construct. Introduced in the Fortran 2003 standard.", - "begin": "(?i)\\s*(type)\\b", - "beginCaptures": { + "match": "(?i)\\G\\s*(is)\\b", + "captures": { "1": { - "name": "keyword.control.type.fortran" + "name": "keyword.control.is.fortran" } - }, - "end": "(?i)(?=\\b(end\\s*select)\\b)", - "patterns": [ - { - "include": "#parentheses" - }, - { - "begin": "(?i)\\b(?:(class)|(type))", - "beginCaptures": { - "1": { - "name": "keyword.control.class.fortran" - }, - "2": { - "name": "keyword.control.type.fortran" - } - }, - "end": "(?i)(?=[;!\\n])", - "patterns": [ - { - "match": "(?i)\\G\\s*\\b(default)\\b", - "captures": { - "1": { - "name": "keyword.control.default.fortran" - } - } - }, - { - "match": "(?i)\\G\\s*(is)\\b", - "captures": { - "1": { - "name": "keyword.control.is.fortran" - } - } - }, - { - "include": "#parentheses" - }, - { - "include": "#invalid-word" - } - ] - }, - { - "include": "$base" + } + }, + { + "include": "#parentheses" + }, + { + "include": "#invalid-word" + } + ] + }, + { + "include": "$base" + } + ] + }, + "select-rank-construct":{ + "comment": "Select rank construct. Introduced in the Fortran 2008 standard.", + "begin": "(?i)\\b(select)\\s*(rank)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.select.fortran" + }, + "2": { + "name": "keyword.control.rank.fortran" + } + }, + "end": "(?i)(?=\\b(end\\s*select)\\b)", + "endCaptures": { + "1": { + "name": "keyword.control.endselect.fortran" + } + }, + "patterns": [ + { + "include": "#parentheses" + }, + { + "begin": "(?i)\\b(rank)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.rank.fortran" + } + }, + "end": "(?i)(?=[;!\\n])", + "patterns": [ + { + "match": "(?i)\\G\\s*\\b(default)\\b", + "captures": { + "1": { + "name": "keyword.control.default.fortran" } - ] + } + }, + { + "include": "#parentheses" + }, + { + "include": "#invalid-word" } ] + }, + { + "include": "$base" } ] },