Skip to content

Commit 6cf601b

Browse files
chore: Update Syntax Files (#203)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 8594ed2 commit 6cf601b

File tree

8 files changed

+252
-76
lines changed

8 files changed

+252
-76
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Large diffs are not rendered by default.

plugin/plugin.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,8 @@
861861
<!-- fortran: Inline Grammars -->
862862
<!-- ======================================== -->
863863
<extension point="org.eclipse.tm4e.registry.grammars">
864+
<grammar scopeName="comment.line.fixed.injection" path="syntaxes/fortran/comment.line.fixed.injection.tmLanguage.json" />
865+
<injection scopeName="comment.line.fixed.injection" injectTo="source.fortran.fixed" />
864866
<grammar scopeName="source.openacc" path="syntaxes/fortran/source.openacc.tmLanguage.json" />
865867
<injection scopeName="source.openacc" injectTo="source.fortran.free" />
866868
<grammar scopeName="source.openmp" path="syntaxes/fortran/source.openmp.tmLanguage.json" />

plugin/syntaxes/cobol/cobol.tmLanguage.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
{
2121
"include": "#exec-cics-block"
2222
},
23+
{
24+
"include": "#exec-unknown-block"
25+
},
2326
{
2427
"include": "#number-constant"
2528
},
@@ -148,6 +151,35 @@
148151
}
149152
}
150153
},
154+
"exec-unknown-block": {
155+
"begin": "(?i:(?<=^| )EXEC(\\s+|$))",
156+
"beginCaptures": {
157+
"0": {
158+
"name": "string.quoted.single.cobol"
159+
}
160+
},
161+
"patterns": [
162+
{
163+
"include": "#comment-cobol-source"
164+
},
165+
{
166+
"include": "#sequence-number-area"
167+
},
168+
{
169+
"include": "#string-quoted-constant"
170+
},
171+
{
172+
"include": "#string-double-quoted-constant"
173+
}
174+
],
175+
"name": "string.quoted.single.cobol",
176+
"end": "(?<=^| )(?i:END-EXEC)(?=$| |[.])|\\S(?<=^.{8,10}\\S*\\s*[.])",
177+
"endCaptures": {
178+
"0": {
179+
"name": "string.quoted.single.cobol"
180+
}
181+
}
182+
},
151183
"db2-host-var-definition": {
152184
"name": "sql.embedded.code",
153185
"begin": "(?i:\\s+SQL\\s+TYPE\\s+IS)",

plugin/syntaxes/fortran/FortranFixedForm.tmLanguage.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,25 @@
1919
{
2020
"include": "#comments"
2121
},
22+
{
23+
"comment": "Labelled FORMAT statement (spanning continuation lines)",
24+
"name": "meta.statement.IO.fortran",
25+
"begin": "(?ix)^(?=.{5}|(?<!^)\\t)\\s*(?:([0-9]{1,5})\\s+)?(format)\\b",
26+
"beginCaptures": {
27+
"1": { "name": "constant.numeric.fortran" },
28+
"2": { "name": "keyword.control.format.fortran" }
29+
},
30+
"end": "(?=^(?![^!#\\n]{5}\\S))",
31+
"patterns": [
32+
{ "include": "#comments" },
33+
{ "include": "#line-header" },
34+
{ "match": "!.*$", "name": "comment.line.fortran" },
35+
{ "include": "source.fortran.free#string-constant" },
36+
{ "include": "source.fortran.free#numeric-constant" },
37+
{ "include": "source.fortran.free#operators" },
38+
{ "include": "source.fortran.free#format-parentheses" }
39+
]
40+
},
2241
{
2342
"include": "#line-header"
2443
},

plugin/syntaxes/fortran/FortranFreeForm.tmLanguage.json

Lines changed: 156 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,28 +2056,40 @@
20562056
}
20572057
},
20582058
"end": "(?=[;!\\n])",
2059+
"applyEndPatternLast": 1,
20592060
"patterns": [
20602061
{
20612062
"comment": "type-bound subroutines",
2062-
"begin": "(?ix)\\G\\s*([a-z]\\w*)(%)([a-z]\\w*)\\b\\s*(?=\\()",
2063-
"beginCaptures": {
2064-
"1": {
2065-
"name": "variable.other.fortran"
2063+
"begin": "(?ix)(?=\\s*[a-z]\\w*\\s*%)",
2064+
"end": "(?=[;!\\n])",
2065+
"patterns": [
2066+
{
2067+
"include": "#comments"
20662068
},
2067-
"2": {
2068-
"name": "keyword.accessor.fortran"
2069+
{
2070+
"include": "#line-continuation-operator"
2071+
},
2072+
{
2073+
"comment": "Variable and accessor",
2074+
"match": "(?ix)\\s*([a-z]\\w*)\\s*(%)",
2075+
"captures": {
2076+
"1": {
2077+
"name": "variable.other.fortran"
2078+
},
2079+
"2": {
2080+
"name": "keyword.accessor.fortran"
2081+
}
2082+
}
2083+
},
2084+
{
2085+
"comment": "Final function",
2086+
"match": "(?ix)\\s*([a-z]\\w*)",
2087+
"captures": {
2088+
"1": {
2089+
"name": "entity.name.function.subroutine.fortran"
2090+
}
2091+
}
20692092
},
2070-
"3": {
2071-
"name": "entity.name.function.subroutine.fortran"
2072-
}
2073-
},
2074-
"end": "(?<!\\G)",
2075-
"endCaptures": {
2076-
"1": {
2077-
"name": "punctuation.parentheses.right.fortran"
2078-
}
2079-
},
2080-
"patterns": [
20812093
{
20822094
"include": "#parentheses-dummy-variables"
20832095
}
@@ -3056,10 +3068,32 @@
30563068
},
30573069
"IO-statements": {
30583070
"patterns": [
3071+
{
3072+
"comment": "Format statement Introduced in the Fortran 1977 standard.",
3073+
"name": "meta.statement.IO.fortran",
3074+
"begin": "(?ix)\\b(format)(?=\\s*(?:\\(|&|!))",
3075+
"beginCaptures": {
3076+
"1": {
3077+
"name": "keyword.control.format.fortran"
3078+
}
3079+
},
3080+
"end": "(?=[;!\\n])",
3081+
"patterns": [
3082+
{
3083+
"include": "#comments"
3084+
},
3085+
{
3086+
"include": "#line-continuation-operator"
3087+
},
3088+
{
3089+
"include": "#format-parentheses"
3090+
}
3091+
]
3092+
},
30593093
{
30603094
"comment": "Introduced in the Fortran 1977 standard.",
30613095
"name": "meta.statement.IO.fortran",
3062-
"begin": "(?ix)\\b(?:(backspace)|(close)|(endfile)|(format)|(inquire)|(open)|(read)|(rewind)|(write))\\s*(?=\\()",
3096+
"begin": "(?ix)\\b(?:(backspace)|(close)|(endfile)|(inquire)|(open)|(read)|(rewind)|(write))\\s*(?=\\()",
30633097
"beginCaptures": {
30643098
"1": {
30653099
"name": "keyword.control.backspace.fortran"
@@ -3071,24 +3105,21 @@
30713105
"name": "keyword.control.endfile.fortran"
30723106
},
30733107
"4": {
3074-
"name": "keyword.control.format.fortran"
3075-
},
3076-
"5": {
30773108
"name": "keyword.control.inquire.fortran"
30783109
},
3079-
"6": {
3110+
"5": {
30803111
"name": "keyword.control.open.fortran"
30813112
},
3082-
"7": {
3113+
"6": {
30833114
"name": "keyword.control.read.fortran"
30843115
},
3085-
"8": {
3116+
"7": {
30863117
"name": "keyword.control.rewind.fortran"
30873118
},
3088-
"9": {
3119+
"8": {
30893120
"name": "keyword.control.write.fortran"
30903121
},
3091-
"10": {
3122+
"9": {
30923123
"name": "punctuation.parentheses.left.fortran"
30933124
}
30943125
},
@@ -5365,9 +5396,29 @@
53655396
}
53665397
]
53675398
},
5399+
"format-descriptor": {
5400+
"comment": "FORMAT descriptor content for FORMAT statements (avoids array constructor scoping)",
5401+
"contentName": "meta.format-descriptor.fortran",
5402+
"begin": "\\(\\/",
5403+
"beginCaptures": {
5404+
"0": { "name": "punctuation.bracket.left.fortran" }
5405+
},
5406+
"end": "\\)",
5407+
"endCaptures": {
5408+
"0": { "name": "punctuation.bracket.right.fortran" }
5409+
},
5410+
"patterns": [
5411+
{ "include": "#comments" },
5412+
{ "include": "#constants" },
5413+
{ "include": "#operators" },
5414+
{ "include": "#parentheses" },
5415+
{ "include": "#intrinsic-functions" },
5416+
{ "include": "#variable" }
5417+
]
5418+
},
53685419
"array-constructor": {
53695420
"name": "meta.contructor.array",
5370-
"begin": "(?=\\s*(\\[|\\(\\/))",
5421+
"begin": "(?<!\\n)(?=\\s*(\\[|\\(\\/))",
53715422
"end": "(?<!\\G)",
53725423
"patterns": [
53735424
{
@@ -5661,7 +5712,55 @@
56615712
}
56625713
]
56635714
},
5664-
"parentheses": {
5715+
"format-descriptors": {
5716+
"patterns": [
5717+
{
5718+
"comment": "Format descriptors.",
5719+
"match": "(?i)(?:\\b|(?<=\\d)|(?<=P))(EN|ES|EX|DT|DC|DP|RC|RD|RN|RP|RU|RZ|BN|BZ|SP|SS|TL|TR|I|F|E|D|G|L|A|B|O|Z|T|X|Q|S|P)(?=$|[^A-Za-z_]|[EFDG](?i))",
5720+
"captures": {
5721+
"1": { "name": "keyword.other.format-descriptor.fortran" }
5722+
}
5723+
},
5724+
{
5725+
"match": "\\/",
5726+
"name": "keyword.operator.format.newline.fortran"
5727+
},
5728+
{
5729+
"match": ":",
5730+
"name": "keyword.operator.format.separator.fortran"
5731+
},
5732+
{
5733+
"comment": "Non-standard newline suppression",
5734+
"match": "\\$|\\\\",
5735+
"name": "keyword.other.format-descriptor.nonstandard.fortran"
5736+
},
5737+
{
5738+
"comment": "Legacy Hollerith constant (e.g. 4HText)",
5739+
"match": "(?i)(?:\\b|(?<=\\d))\\d+H",
5740+
"name": "keyword.other.format-descriptor.legacy.fortran"
5741+
}
5742+
]
5743+
},
5744+
"parentheses-common": {
5745+
"patterns": [
5746+
{
5747+
"include": "#comments"
5748+
},
5749+
{
5750+
"include": "#constants"
5751+
},
5752+
{
5753+
"include": "#operators"
5754+
},
5755+
{
5756+
"include": "#intrinsic-functions"
5757+
},
5758+
{
5759+
"include": "#variable"
5760+
}
5761+
]
5762+
},
5763+
"format-parentheses": {
56655764
"begin": "\\s*(\\()",
56665765
"beginCaptures": {
56675766
"1": {
@@ -5679,26 +5778,24 @@
56795778
"include": "#comments"
56805779
},
56815780
{
5682-
"include": "#constants"
5683-
},
5684-
{
5685-
"include": "#operators"
5781+
"include": "#line-continuation-operator"
56865782
},
56875783
{
5688-
"include": "#array-constructor"
5784+
"match": "(?:\\b|\\+|-)\\d+(?=[A-Za-z])",
5785+
"name": "constant.numeric.fortran"
56895786
},
56905787
{
5691-
"include": "#parentheses"
5788+
"include": "#format-descriptors"
56925789
},
56935790
{
5694-
"include": "#intrinsic-functions"
5791+
"include": "#format-parentheses"
56955792
},
56965793
{
5697-
"include": "#variable"
5794+
"include": "#parentheses-common"
56985795
}
56995796
]
57005797
},
5701-
"parentheses-dummy-variables": {
5798+
"parentheses": {
57025799
"begin": "\\s*(\\()",
57035800
"beginCaptures": {
57045801
"1": {
@@ -5713,16 +5810,32 @@
57135810
},
57145811
"patterns": [
57155812
{
5716-
"include": "#procedure-call-dummy-variable"
5813+
"include": "#array-constructor"
57175814
},
57185815
{
5719-
"include": "#comments"
5816+
"include": "#parentheses"
57205817
},
57215818
{
5722-
"include": "#constants"
5723-
},
5819+
"include": "#parentheses-common"
5820+
}
5821+
]
5822+
},
5823+
"parentheses-dummy-variables": {
5824+
"begin": "\\s*(\\()",
5825+
"beginCaptures": {
5826+
"1": {
5827+
"name": "punctuation.parentheses.left.fortran"
5828+
}
5829+
},
5830+
"end": "(\\))",
5831+
"endCaptures": {
5832+
"1": {
5833+
"name": "punctuation.parentheses.right.fortran"
5834+
}
5835+
},
5836+
"patterns": [
57245837
{
5725-
"include": "#operators"
5838+
"include": "#procedure-call-dummy-variable"
57265839
},
57275840
{
57285841
"include": "#array-constructor"
@@ -5731,10 +5844,7 @@
57315844
"include": "#parentheses"
57325845
},
57335846
{
5734-
"include": "#intrinsic-functions"
5735-
},
5736-
{
5737-
"include": "#variable"
5847+
"include": "#parentheses-common"
57385848
}
57395849
]
57405850
},
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"scopeName": "comment.line.fixed.injection",
3+
"injectionSelector": "L:source.fortran.fixed",
4+
"patterns": [
5+
{
6+
"match": "^[cC*].*$\\n?",
7+
"name": "comment.line.fortran"
8+
}
9+
]
10+
}

plugin/syntaxes/ring/LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016-2025 Mahmoud Fayed
3+
Copyright (c) 2016-2026 Mahmoud Fayed
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)