]> git.lizzy.rs Git - micro.git/commitdiff
improve fortran syntax highlighting (#2479)
authoryeti <deedlebum41@gmail.com>
Sun, 17 Jul 2022 19:18:30 +0000 (20:18 +0100)
committerGitHub <noreply@github.com>
Sun, 17 Jul 2022 19:18:30 +0000 (12:18 -0700)
* support integer highlighting

* add missing keywords and move some to where they fit better

* add missing operators

* fix previous commit

* add and

* add import

runtime/syntax/fortran.yaml

index b30e5443cce5151f3afee8bb28677218c53a30f8..9e3ed1735d0e6f575c66491b607bf680c799e8e6 100644 (file)
@@ -5,18 +5,18 @@ detect:
 
 rules:
     - type:  "(?i)\\b(action|advance|all|allocatable|allocated|any|apostrophe)\\b"
-    - type:  "(?i)\\b(append|asis|assign|assignment|associated|character|common)\\b"
+    - type:  "(?i)\\b(append|asis|assign|assignment|associated|bind|character|common)\\b"
     - type:  "(?i)\\b(complex|data|default|delim|dimension|double precision)\\b"
-    - type:  "(?i)\\b(elemental|epsilon|external|file|fmt|form|format|huge)\\b"
+    - type:  "(?i)\\b(elemental|enum|enumerator|epsilon|external|file|fmt|form|format|huge)\\b"
     - type:  "(?i)\\b(implicit|include|index|inquire|integer|intent|interface)\\b"
     - type:  "(?i)\\b(intrinsic|iostat|kind|logical|module|none|null|only)\\\\b"
     - type:  "(?i)\\b(operator|optional|pack|parameter|pointer|position|private)\\b"
     - type:  "(?i)\\b(program|public|real|recl|recursive|selected_int_kind)\\b"
-    - type:  "(?i)\\b(selected_real_kind|subroutine|status)\\b"
+    - type:  "(?i)\\b(selected_real_kind|subroutine|status|module|function|logical)\\b"
 
     - constant:  "(?i)\\b(abs|achar|adjustl|adjustr|allocate|bit_size|call|char)\\b" 
     - constant:  "(?i)\\b(close|contains|count|cpu_time|cshift|date_and_time)\\b" 
-    - constant:  "(?i)\\b(deallocate|digits|dot_product|eor|eoshift|function|iachar)\\b" 
+    - constant:  "(?i)\\b(deallocate|digits|dot_product|eor|eoshift|iachar)\\b" 
     - constant:  "(?i)\\b(iand|ibclr|ibits|ibset|ichar|ieor|iolength|ior|ishft|ishftc)\\b" 
     - constant:  "(?i)\\b(lbound|len|len_trim|matmul|maxexponent|maxloc|maxval|merge)\\b" 
     - constant:  "(?i)\\b(minexponent|minloc|minval|mvbits|namelist|nearest|nullify)\\b" 
@@ -24,16 +24,18 @@ rules:
     - constant:  "(?i)\\b(random_number|random_seed|range|read|readwrite|replace)\\b" 
     - constant:  "(?i)\\b(reshape|rewind|save|scan|sequence|shape|sign|size|spacing)\\b" 
     - constant:  "(?i)\\b(spread|sum|system_clock|target|transfer|transpose|trim)\\b" 
-    - constant:  "(?i)\\b(ubound|unpack|verify|write|tiny|type|use|yes)\\b"
+    - constant:  "(?i)\\b(ubound|unpack|verify|write|tiny|type|use|yes|true|false|not)\\b"
+
+    - constant.number: "\\b([0-9]+)\\b"
 
     - statement: "(?i)\\b(.and.|case|do|else|else?if|else?where|end|end?do|end?if)\\b"
     - statement: "(?i)\\b(end?select|.eqv.|forall|if|lge|lgt|lle|llt|.neqv.|.not.)\\b"
-    - statement: "(?i)\\b(.or.|repeat|select case|then|where|while)\\b"
+    - statement: "(?i)\\b(or|and|repeat|select|case|then|where|while|import)\\b"
 
     - special: "(?i)\\b(continue|cycle|exit|go?to|result|return)\\b"
 
       #Operator Color
-    - symbol.operator: "[.:;,+*|=!\\%]|/|-|&"
+    - symbol.operator: "[.:;,+*|=!\\%]|/|-|>|<|&"
 
       #Parenthetical Color
     - symbol.bracket: "[(){}]|\\[|\\]"
@@ -60,4 +62,3 @@ rules:
         end: "$"
         rules:
             - todo: "(TODO|XXX|FIXME):?"
-