Skip to content

Commit 672a581

Browse files
pedro-ricardokrvajal
authored andcommitted
Highlight Fixes (#129)
* Fix F77 dimension declaration * Fix select type highlight * Fix else highlight with end-line operator `;`
1 parent 9dcba63 commit 672a581

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

syntaxes/fortran_free-form.tmLanguage.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@
12361236
"patterns": [
12371237
{
12381238
"comment": "rest of else line",
1239-
"begin": "(?!(\\s*!)|(\\s*\\n))",
1239+
"begin": "(?!(\\s*(;|!|\\n)))",
12401240
"end": "(?=[;!\\n])",
12411241
"patterns": [
12421242
{
@@ -1278,7 +1278,7 @@
12781278
"patterns": [
12791279
{
12801280
"name": "meta.block.select.fortran",
1281-
"begin": "(?i)\\b(select\\s*case|selectcase)\\b",
1281+
"begin": "(?i)\\b(select)",
12821282
"beginCaptures": {
12831283
"1": {
12841284
"name": "keyword.control.select.fortran"
@@ -1293,7 +1293,7 @@
12931293
"patterns": [
12941294
{
12951295
"comment": "Select case construct. Introduced in the Fortran 1990 standard.",
1296-
"begin": "(?i)^\\s*\\b(case)\\b",
1296+
"begin": "(?i)\\s*(case)\\b",
12971297
"beginCaptures": {
12981298
"1": {
12991299
"name": "keyword.control.case.fortran"
@@ -1336,10 +1336,10 @@
13361336
},
13371337
{
13381338
"comment": "Select type construct. Introduced in the Fortran 2003 standard.",
1339-
"begin": "(?i)\\G\\s*\\b(type)\\b",
1339+
"begin": "(?i)\\s*(type)\\b",
13401340
"beginCaptures": {
13411341
"1": {
1342-
"name": "keyword.control.case.fortran"
1342+
"name": "keyword.control.type.fortran"
13431343
}
13441344
},
13451345
"end": "(?i)(?=\\b(end\\s*select)\\b)",
@@ -1348,7 +1348,7 @@
13481348
"include": "#parentheses"
13491349
},
13501350
{
1351-
"begin": "(?i)\\b(?:(class)|(type))\\b",
1351+
"begin": "(?i)\\b(?:(class)|(type))",
13521352
"beginCaptures": {
13531353
"1": {
13541354
"name": "keyword.control.class.fortran"
@@ -1368,7 +1368,7 @@
13681368
}
13691369
},
13701370
{
1371-
"match": "(?i)\\G\\s*\\b(is)\\b",
1371+
"match": "(?i)\\G\\s*(is)\\b",
13721372
"captures": {
13731373
"1": {
13741374
"name": "keyword.control.is.fortran"
@@ -4064,7 +4064,7 @@
40644064
},
40654065
"type-specification-statements": {
40664066
"name": "meta.specification.type.fortran",
4067-
"begin": "(?ix)(?=\\b(?:character|class|complex|double\\s*precision|double\\s*complex|integer|logical|real|type)\\b(?![^'\";!\\n]*\\bfunction\\b))",
4067+
"begin": "(?ix)(?=\\b(?:character|class|complex|double\\s*precision|double\\s*complex|integer|logical|real|type|dimension)\\b(?![^'\";!\\n]*\\bfunction\\b))",
40684068
"end": "(?=[\\);!\\n])",
40694069
"patterns": [
40704070
{
@@ -4670,7 +4670,7 @@
46704670
]
46714671
},
46724672
{
4673-
"match": "(?ix)\\b(?:(complex)|(double\\s*precision)|(double\\s*complex)|(integer)|(real))\\b(?:\\s*(\\*)\\s*(\\d*))?",
4673+
"match": "(?ix)\\b(?:(complex)|(double\\s*precision)|(double\\s*complex)|(integer)|(real)|(dimension))\\b(?:\\s*(\\*)\\s*(\\d*))?",
46744674
"captures": {
46754675
"1": {
46764676
"name": "storage.type.complex.fortran"
@@ -4688,9 +4688,12 @@
46884688
"name": "storage.type.real.fortran"
46894689
},
46904690
"6": {
4691+
"name": "storage.type.dimension.fortran"
4692+
},
4693+
"7": {
46914694
"name": "keyword.operator.multiplication.fortran"
46924695
},
4693-
"7": {
4696+
"8": {
46944697
"name": "constant.numeric.fortran"
46954698
}
46964699
}

0 commit comments

Comments
 (0)