Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions README.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,8 @@
<!-- fortran: Inline Grammars -->
<!-- ======================================== -->
<extension point="org.eclipse.tm4e.registry.grammars">
<grammar scopeName="comment.line.fixed.injection" path="syntaxes/fortran/comment.line.fixed.injection.tmLanguage.json" />
<injection scopeName="comment.line.fixed.injection" injectTo="source.fortran.fixed" />
<grammar scopeName="source.openacc" path="syntaxes/fortran/source.openacc.tmLanguage.json" />
<injection scopeName="source.openacc" injectTo="source.fortran.free" />
<grammar scopeName="source.openmp" path="syntaxes/fortran/source.openmp.tmLanguage.json" />
Expand Down
32 changes: 32 additions & 0 deletions plugin/syntaxes/cobol/cobol.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
{
"include": "#exec-cics-block"
},
{
"include": "#exec-unknown-block"
},
{
"include": "#number-constant"
},
Expand Down Expand Up @@ -148,6 +151,35 @@
}
}
},
"exec-unknown-block": {
"begin": "(?i:(?<=^| )EXEC(\\s+|$))",
"beginCaptures": {
"0": {
"name": "string.quoted.single.cobol"
}
},
"patterns": [
{
"include": "#comment-cobol-source"
},
{
"include": "#sequence-number-area"
},
{
"include": "#string-quoted-constant"
},
{
"include": "#string-double-quoted-constant"
}
],
"name": "string.quoted.single.cobol",
"end": "(?<=^| )(?i:END-EXEC)(?=$| |[.])|\\S(?<=^.{8,10}\\S*\\s*[.])",
"endCaptures": {
"0": {
"name": "string.quoted.single.cobol"
}
}
},
"db2-host-var-definition": {
"name": "sql.embedded.code",
"begin": "(?i:\\s+SQL\\s+TYPE\\s+IS)",
Expand Down
19 changes: 19 additions & 0 deletions plugin/syntaxes/fortran/FortranFixedForm.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,25 @@
{
"include": "#comments"
},
{
"comment": "Labelled FORMAT statement (spanning continuation lines)",
"name": "meta.statement.IO.fortran",
"begin": "(?ix)^(?=.{5}|(?<!^)\\t)\\s*(?:([0-9]{1,5})\\s+)?(format)\\b",
"beginCaptures": {
"1": { "name": "constant.numeric.fortran" },
"2": { "name": "keyword.control.format.fortran" }
},
"end": "(?=^(?![^!#\\n]{5}\\S))",
"patterns": [
{ "include": "#comments" },
{ "include": "#line-header" },
{ "match": "!.*$", "name": "comment.line.fortran" },
{ "include": "source.fortran.free#string-constant" },
{ "include": "source.fortran.free#numeric-constant" },
{ "include": "source.fortran.free#operators" },
{ "include": "source.fortran.free#format-parentheses" }
]
},
{
"include": "#line-header"
},
Expand Down
202 changes: 156 additions & 46 deletions plugin/syntaxes/fortran/FortranFreeForm.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -2056,28 +2056,40 @@
}
},
"end": "(?=[;!\\n])",
"applyEndPatternLast": 1,
"patterns": [
{
"comment": "type-bound subroutines",
"begin": "(?ix)\\G\\s*([a-z]\\w*)(%)([a-z]\\w*)\\b\\s*(?=\\()",
"beginCaptures": {
"1": {
"name": "variable.other.fortran"
"begin": "(?ix)(?=\\s*[a-z]\\w*\\s*%)",
"end": "(?=[;!\\n])",
"patterns": [
{
"include": "#comments"
},
"2": {
"name": "keyword.accessor.fortran"
{
"include": "#line-continuation-operator"
},
{
"comment": "Variable and accessor",
"match": "(?ix)\\s*([a-z]\\w*)\\s*(%)",
"captures": {
"1": {
"name": "variable.other.fortran"
},
"2": {
"name": "keyword.accessor.fortran"
}
}
},
{
"comment": "Final function",
"match": "(?ix)\\s*([a-z]\\w*)",
"captures": {
"1": {
"name": "entity.name.function.subroutine.fortran"
}
}
},
"3": {
"name": "entity.name.function.subroutine.fortran"
}
},
"end": "(?<!\\G)",
"endCaptures": {
"1": {
"name": "punctuation.parentheses.right.fortran"
}
},
"patterns": [
{
"include": "#parentheses-dummy-variables"
}
Expand Down Expand Up @@ -3056,10 +3068,32 @@
},
"IO-statements": {
"patterns": [
{
"comment": "Format statement Introduced in the Fortran 1977 standard.",
"name": "meta.statement.IO.fortran",
"begin": "(?ix)\\b(format)(?=\\s*(?:\\(|&|!))",
"beginCaptures": {
"1": {
"name": "keyword.control.format.fortran"
}
},
"end": "(?=[;!\\n])",
"patterns": [
{
"include": "#comments"
},
{
"include": "#line-continuation-operator"
},
{
"include": "#format-parentheses"
}
]
},
{
"comment": "Introduced in the Fortran 1977 standard.",
"name": "meta.statement.IO.fortran",
"begin": "(?ix)\\b(?:(backspace)|(close)|(endfile)|(format)|(inquire)|(open)|(read)|(rewind)|(write))\\s*(?=\\()",
"begin": "(?ix)\\b(?:(backspace)|(close)|(endfile)|(inquire)|(open)|(read)|(rewind)|(write))\\s*(?=\\()",
"beginCaptures": {
"1": {
"name": "keyword.control.backspace.fortran"
Expand All @@ -3071,24 +3105,21 @@
"name": "keyword.control.endfile.fortran"
},
"4": {
"name": "keyword.control.format.fortran"
},
"5": {
"name": "keyword.control.inquire.fortran"
},
"6": {
"5": {
"name": "keyword.control.open.fortran"
},
"7": {
"6": {
"name": "keyword.control.read.fortran"
},
"8": {
"7": {
"name": "keyword.control.rewind.fortran"
},
"9": {
"8": {
"name": "keyword.control.write.fortran"
},
"10": {
"9": {
"name": "punctuation.parentheses.left.fortran"
}
},
Expand Down Expand Up @@ -5365,9 +5396,29 @@
}
]
},
"format-descriptor": {
"comment": "FORMAT descriptor content for FORMAT statements (avoids array constructor scoping)",
"contentName": "meta.format-descriptor.fortran",
"begin": "\\(\\/",
"beginCaptures": {
"0": { "name": "punctuation.bracket.left.fortran" }
},
"end": "\\)",
"endCaptures": {
"0": { "name": "punctuation.bracket.right.fortran" }
},
"patterns": [
{ "include": "#comments" },
{ "include": "#constants" },
{ "include": "#operators" },
{ "include": "#parentheses" },
{ "include": "#intrinsic-functions" },
{ "include": "#variable" }
]
},
"array-constructor": {
"name": "meta.contructor.array",
"begin": "(?=\\s*(\\[|\\(\\/))",
"begin": "(?<!\\n)(?=\\s*(\\[|\\(\\/))",
"end": "(?<!\\G)",
"patterns": [
{
Expand Down Expand Up @@ -5661,7 +5712,55 @@
}
]
},
"parentheses": {
"format-descriptors": {
"patterns": [
{
"comment": "Format descriptors.",
"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))",
"captures": {
"1": { "name": "keyword.other.format-descriptor.fortran" }
}
},
{
"match": "\\/",
"name": "keyword.operator.format.newline.fortran"
},
{
"match": ":",
"name": "keyword.operator.format.separator.fortran"
},
{
"comment": "Non-standard newline suppression",
"match": "\\$|\\\\",
"name": "keyword.other.format-descriptor.nonstandard.fortran"
},
{
"comment": "Legacy Hollerith constant (e.g. 4HText)",
"match": "(?i)(?:\\b|(?<=\\d))\\d+H",
"name": "keyword.other.format-descriptor.legacy.fortran"
}
]
},
"parentheses-common": {
"patterns": [
{
"include": "#comments"
},
{
"include": "#constants"
},
{
"include": "#operators"
},
{
"include": "#intrinsic-functions"
},
{
"include": "#variable"
}
]
},
"format-parentheses": {
"begin": "\\s*(\\()",
"beginCaptures": {
"1": {
Expand All @@ -5679,26 +5778,24 @@
"include": "#comments"
},
{
"include": "#constants"
},
{
"include": "#operators"
"include": "#line-continuation-operator"
},
{
"include": "#array-constructor"
"match": "(?:\\b|\\+|-)\\d+(?=[A-Za-z])",
"name": "constant.numeric.fortran"
},
{
"include": "#parentheses"
"include": "#format-descriptors"
},
{
"include": "#intrinsic-functions"
"include": "#format-parentheses"
},
{
"include": "#variable"
"include": "#parentheses-common"
}
]
},
"parentheses-dummy-variables": {
"parentheses": {
"begin": "\\s*(\\()",
"beginCaptures": {
"1": {
Expand All @@ -5713,16 +5810,32 @@
},
"patterns": [
{
"include": "#procedure-call-dummy-variable"
"include": "#array-constructor"
},
{
"include": "#comments"
"include": "#parentheses"
},
{
"include": "#constants"
},
"include": "#parentheses-common"
}
]
},
"parentheses-dummy-variables": {
"begin": "\\s*(\\()",
"beginCaptures": {
"1": {
"name": "punctuation.parentheses.left.fortran"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.parentheses.right.fortran"
}
},
"patterns": [
{
"include": "#operators"
"include": "#procedure-call-dummy-variable"
},
{
"include": "#array-constructor"
Expand All @@ -5731,10 +5844,7 @@
"include": "#parentheses"
},
{
"include": "#intrinsic-functions"
},
{
"include": "#variable"
"include": "#parentheses-common"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"scopeName": "comment.line.fixed.injection",
"injectionSelector": "L:source.fortran.fixed",
"patterns": [
{
"match": "^[cC*].*$\\n?",
"name": "comment.line.fortran"
}
]
}
2 changes: 1 addition & 1 deletion plugin/syntaxes/ring/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016-2025 Mahmoud Fayed
Copyright (c) 2016-2026 Mahmoud Fayed

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