Skip to content

Commit 6ff2a5d

Browse files
authored
Merge pull request #16 from pedro-ricardo/master
Fortran90: Added missing intrinsics. Corrected logical highlight.
2 parents 2c130ef + 2912e86 commit 6ff2a5d

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

syntaxes/fortran.tmLanguage

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
</dict>
166166
<dict>
167167
<key>begin</key>
168-
<string>\b(?i:(integer|real|double\s+precision|complex|logical|character))\b(?=.*::)</string>
168+
<string>\b(?i:(integer|real|double\sprecision|complex|logical|character))\b(?=.*::)</string>
169169
<key>beginCaptures</key>
170170
<dict>
171171
<key>1</key>
@@ -216,7 +216,7 @@
216216
<key>comment</key>
217217
<string>operators</string>
218218
<key>match</key>
219-
<string>((?&lt;!\=)\=(?!\=)|\-|\+|\/\/|\/|(?!^)\*|::)</string>
219+
<string>((?&lt;!\=)\=(?!\=)|\-|\+|\/\/|\/(?!\=|\))|(?!^)\*|::)</string>
220220
<key>name</key>
221221
<string>keyword.operator.fortran</string>
222222
</dict>
@@ -226,7 +226,7 @@
226226
<key>match</key>
227227
<string>(?i:(\.and\.|\.or\.|\.eq\.|\.lt\.|\.le\.|\.gt\.|\.ge\.|\.ne\.|\.not\.|\.eqv\.|\.neqv\.))</string>
228228
<key>name</key>
229-
<string>keyword.operator.logical.fortran</string>
229+
<string>keyword.logical.operator.fortran</string>
230230
</dict>
231231
<dict>
232232
<key>comment</key>
@@ -256,7 +256,7 @@
256256
<key>comment</key>
257257
<string>mathematical intrisics</string>
258258
<key>match</key>
259-
<string>\b(?i:(((acos|asin|atan|atan2|cos|cosh|exp|log|log10|sin|sinh|sqrt|tan|tanh)(?=\())|(random_number|random_seed)))\b</string>
259+
<string>\b(?i:(((acos|asin|atan|atan2|cos|cosh|exp|log|log10|sin|sinh|sqrt|tan|tanh|abs)(?=\())|(random_number|random_seed)))\b</string>
260260
<key>name</key>
261261
<string>keyword.other.instrisic.math.fortran</string>
262262
</dict>
@@ -304,15 +304,15 @@
304304
<key>comment</key>
305305
<string>other intrisics</string>
306306
<key>match</key>
307-
<string>\b(?i:(((dtime)(?=\())|(date_and_time|system_clock)))\b</string>
307+
<string>\b(?i:(((dtime)(?=\())|(date_and_time|system_clock|cpu_time)))\b</string>
308308
<key>name</key>
309309
<string>keyword.other.instrisic.fortran</string>
310310
</dict>
311311
<dict>
312312
<key>comment</key>
313313
<string>data specification</string>
314314
<key>match</key>
315-
<string>\b(?i:(integer|real|double\s+precision|complex|logical|character|block\sdata|operator|assignment))\b</string>
315+
<string>\b(?i:(integer|real|double\sprecision|complex|logical|character|block\sdata|operator|assignment))\b</string>
316316
<key>name</key>
317317
<string>storage.type.fortran</string>
318318
</dict>

syntaxes/fortran90.tmLanguage

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,27 +299,43 @@
299299
<dict>
300300
<key>comment</key>
301301
<string>logical operators in symbolic format</string>
302-
<key>match</key>
303-
<string>\b(\=\=|\/\=|\&gt;\=|\&gt;|\&lt;|\&lt;\=)\b</string>
302+
<key>match</key>
303+
<string>(?i:(\<\=|\>\=|\<|\>|\/\=|\=\=))</string>
304304
<key>name</key>
305-
<string>keyword.operator.logical.fortran.modern</string>
305+
<string>keyword.logical.operator.fortran.modern</string>
306306
</dict>
307307
<dict>
308308
<key>comment</key>
309309
<string>operators</string>
310310
<key>match</key>
311-
<string>(\%|\=\&gt;)</string>
311+
<string>(\%|\/\)|\(\/)</string>
312312
<key>name</key>
313-
<string>keyword.operator.fortran.modern</string>
313+
<string>keyword.other.operator.fortran.modern</string>
314314
</dict>
315315
<dict>
316316
<key>comment</key>
317317
<string>numeric instrinsics</string>
318318
<key>match</key>
319-
<string>\b(?i:(ceiling|floor|modulo|abs|sin)(?=\())</string>
320-
<key>name</key>
321-
<string>keyword.other.instrinsic.numeric.fortran.modern</string>
319+
<string>\b(?i:(ceiling|floor|modulo|isnan|idint|idnint|norm2|dsqrt)(?=\())</string>
320+
<key>name</key>
321+
<string>keyword.other.instrinsic.math.fortran.modern</string>
322322
</dict>
323+
<dict>
324+
<key>comment</key>
325+
<string>trigonometric instrinsics</string>
326+
<key>match</key>
327+
<string>\b(?i:(cabs|dabs|iabs|dcos|dcosd|dcosh|dacos|dacosd|dacosh|dsin|dsind|dsinh|dasin|dasind|dasinh|dtan|dtand|dtanh|datan|datan2|datan2d|datand|datanh)(?=\())</string>
328+
<key>name</key>
329+
<string>keyword.other.instrinsic.math.fortran.modern</string>
330+
</dict>
331+
<dict>
332+
<key>comment</key>
333+
<string>memory instrinsic functions</string>
334+
<key>match</key>
335+
<string>\b(?i:(move_alloc|malloc)(?=\())</string>
336+
<key>name</key>
337+
<string>keyword.other.instrinsic.math.fortran.modern</string>
338+
</dict>
323339
<dict>
324340
<key>comment</key>
325341
<string>matrix/vector/array instrinsics</string>

0 commit comments

Comments
 (0)