;; ;; add 'dcmplx' ;; (defconst f90-procedures-re ;; ("abs" "achar" "acos" "adjustl" "adjustr" "aimag" "aint" "all" "allocated" ;; "anint" "any" "asin" "associated" "atan" "atan2" "bit_size" "btest" ;; "ceiling" "char" "cmplx" "conjg" "cos" "cosh" "count" "cshift" ;; "date_and_time" "dble" "dcmplx" "digits" "dim" "dot_product" "dprod" "eoshift" ;; "epsilon" "exp" "exponent" "floor" "fraction" "huge" "iachar" "iand" ;; "ibclr" "ibits" "ibset" "ichar" "ieor" "index" "int" "ior" "ishft" ;; "ishftc" "kind" "lbound" "len" "len_trim" "lge" "lgt" "lle" "llt" "log" ;; "logical" "log10" "matmul" "max" "maxexponent" "maxloc" "maxval" "merge" ;; "min" "minexponent" "minloc" "minval" "mod" "modulo" "mvbits" "nearest" ;; "nint" "not" "pack" "precision" "present" "product" "radix" ;; "random_number" "random_seed" "range" "real" "repeat" "reshape" ;; "rrspacing" "scale" "scan" "selected_int_kind" "selected_real_kind" ;; "set_exponent" "shape" "sign" "sin" "sinh" "size" "spacing" "spread" ;; "sqrt" "sum" "system_clock" "tan" "tanh" "tiny" "transfer" "transpose" ;; "trim" "ubound" "unpack" "verify") ;; A left parenthesis to avoid highlighting non-procedures. ;; Real is taken out here to avoid highlighting declarations. (concat "\\<\\(a\\(bs\\|c\\(har\\|os\\)\\|djust[lr]\\|i\\(mag\\|nt\\)\\|ll\\(\\|" "ocated\\)\\|n\\(int\\|y\\)\\|s\\(in\\|sociated\\)\\|tan2?\\)\\|b\\(" "it_size\\|test\\)\\|c\\(eiling\\|har\\|mplx\\|o\\(njg\\|sh?\\|unt\\)\\|" "shift\\)\\|d\\(ate_and_time\\|ble\\|cmplx\\|i\\(gits\\|m\\)\\|ot_product\\|prod" "\\)\\|e\\(oshift\\|psilon\\|xp\\(\\|onent\\)\\)\\|f\\(loor\\|" "raction\\)\\|huge\\|i\\(a\\(char\\|nd\\)\\|b\\(clr\\|its\\|set\\)\\|" "char\\|eor\\|n\\(dex\\|t\\)\\|or\\|shftc?\\)\\|kind\\|l\\(bound\\|" "en\\(\\|_trim\\)\\|g[et]\\|l[et]\\|og\\(\\|10\\|ical\\)\\)\\|m\\(a\\(" "tmul\\|x\\(\\|exponent\\|loc\\|val\\)\\)\\|erge\\|in\\(\\|exponent\\|" "loc\\|val\\)\\|od\\(\\|ulo\\)\\|vbits\\)\\|n\\(earest\\|int\\|ot\\)\\|" "p\\(ack\\|r\\(e\\(cision\\|sent\\)\\|oduct\\)\\)\\|r\\(a\\(dix\\|n\\(" "dom_\\(number\\|seed\\)\\|ge\\)\\)\\|e\\(peat\\|shape\\)\\|rspacing\\)\\|" "s\\(ca\\(le\\|n\\)\\|e\\(lected_\\(int_kind\\|real_kind\\)\\|" "t_exponent\\)\\|hape\\|i\\(gn\\|nh?\\|ze\\)\\|p\\(acing\\|read\\)\\|" "qrt\\|um\\|ystem_clock\\)\\|t\\(anh?\\|iny\\|r\\(ans\\(fer\\|pose\\)\\|" "im\\)\\)\\|u\\(bound\\|npack\\)\\|verify\\)[ \t]*(") "Regexp whose first part matches F90 intrinsic procedures.") ;; ;; add declarations 'double precision' and 'double complex' ;; (defconst f90-font-lock-keywords-2 (append f90-font-lock-keywords-1 (list ;; Variable declarations (avoid the real function call) '("^[ \t0-9]*\\(real\\|integer\\|c\\(haracter\\|omplex\\)\\|logical\\|type[ \t]*(\\sw+)\\|double \\(precision\\|complex\\)\\)\\(.*::\\|[ \t]*(.*)\\)?\\([^!\n]*\\)" (1 font-lock-type-face t) (4 font-lock-variable-name-face)) ;; do, if, select, where, and forall constructs '("\\<\\(end[ \t]*\\(do\\|if\\|select\\|forall\\|where\\)\\)\\>\\([ \t]+\\(\\sw+\\)\\)?" (1 font-lock-keyword-face) (3 font-lock-constant-face nil t)) '("^[ \t0-9]*\\(\\(\\sw+\\)[ \t]*:[ \t]*\\)?\\(\\(if\\|do\\([ \t]*while\\)?\\|select[ \t]*case\\|where\\|forall\\)\\)\\>" (2 font-lock-constant-face nil t) (3 font-lock-keyword-face)) ;; implicit declaration '("\\<\\(implicit\\)[ \t]*\\(real\\|integer\\|c\\(haracter\\|omplex\\)\\|logical\\|type[ \t]*(\\sw+)\\|none\\)[ \t]*" (1 font-lock-keyword-face) (2 font-lock-type-face)) '("\\<\\(namelist\\|common\\)[ \t]*\/\\(\\sw+\\)?\/" (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) "\\" "\\<\\(then\\|continue\\|format\\|include\\|stop\\|return\\)\\>" '("\\<\\(exit\\|cycle\\)[ \t]*\\(\\sw+\\)?\\>" (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) '("\\<\\(case\\)[ \t]*\\(default\\|(\\)" . 1) '("\\<\\(do\\|go *to\\)\\>[ \t]*\\([0-9]+\\)" (1 font-lock-keyword-face) (2 font-lock-constant-face)) ;; line numbers (lines whose first character after number is letter) '("^[ \t]*\\([0-9]+\\)[ \t]*[a-z]+" (1 font-lock-constant-face t)))) "Highlights declarations, do-loops and other constructions") ;;; ;;; Followings are same as original f90.el. ;;; (except changing from 'defvar' to 'defconst') ;;; These re-definitions are necessary for font-lock. ;;; (defconst f90-font-lock-keywords-3 (append f90-font-lock-keywords-2 (list f90-keywords-level-3-re f90-operators-re (list f90-procedures-re '(1 font-lock-keyword-face keep)) "\\" ; Avoid overwriting real defs. )) "Highlights all F90 keywords and intrinsic procedures.") (defconst f90-font-lock-keywords-4 (append f90-font-lock-keywords-3 (list f90-hpf-keywords-re)) "Highlights all F90 and HPF keywords.")