diff --git a/syntaxes/fortran_free-form.tmLanguage.json b/syntaxes/fortran_free-form.tmLanguage.json index 4f6cb6b1..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" + "name": "keyword.control.default.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" - } - ] + } }, { - "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" } ] }, @@ -2110,6 +2162,9 @@ "include": "#invalid-word" } ] + }, + { + "include": "#line-continuation-operator" } ] }, @@ -4070,6 +4125,9 @@ { "include": "#types" }, + { + "include": "#line-continuation-operator" + }, { "comment": "Attribute list.", "contentName": "meta.attribute-list.fortran", @@ -4148,6 +4206,9 @@ "include": "#invalid-word" } ] + }, + { + "include": "#line-continuation-operator" } ] }, @@ -4939,6 +5000,9 @@ }, { "include": "#variable" + }, + { + "include": "#line-continuation-operator" } ] },