Skip to content

Commit 6537b38

Browse files
committed
Fixes preprocessor syntax highlighting
The line continuation operator is a bit too aggressive so instead of adding lookaheads for every case where we don't need to apply it we have excluded the preprocessor directives from the lint cont. The original .cson highlighting does the same, see: https://github.com/dparkins/language-fortran/blob/master/grammars/fortran%20-%20free%20form.cson for injections see: https://gist.github.com/Aerijo/b8c82d647db783187804e86fa0a604a1 Fixes Preprocessor statements in line continuations break syntax highlighting #248 Fixes Erroneous syntax highlighting for preprocessor conditionals in derived types #249
1 parent 25eb5bb commit 6537b38

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

syntaxes/fortran_free-form.tmLanguage.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717
],
1818
"firstLineMatch": "(?i)-[*]- mode: fortran free -[*]-",
1919
"injections": {
20-
"source.fortran.free - ( string | comment )": {
20+
"source.fortran.free - ( string | comment | source.preprocessor )": {
2121
"patterns": [
2222
{
2323
"include": "#line-continuation-operator"
24+
},
25+
{
26+
"include": "#preprocessor"
2427
}
2528
]
2629
},
@@ -121,6 +124,7 @@
121124
],
122125
"repository": {
123126
"preprocessor": {
127+
"name": "source.preprocessor",
124128
"begin": "^\\s*(#)",
125129
"beginCaptures": {
126130
"1": {

0 commit comments

Comments
 (0)