;; Verilog Font Lock Mode ;; ;; Parts of this are from , I think. I honestly had ;; so many verilog modes that I lost track of which one contained the ;; parts of this file. Modified by Mark Mabry ;; ;; $Id: verilog-font-lock.el,v 1.3 1998/12/08 14:08:00 mmabry Exp $ ;; $Log: verilog-font-lock.el,v $ ;; Revision 1.3 1998/12/08 14:08:00 mmabry ;; fixed faces for emacs v20. rewrote functions with regexp-opt. Added ;; warning-face regexp. ;; ;; Revision 1.2 1997/12/11 19:29:50 mmabry ;; added header to initial version ;; ;(defun generate-face (face foreground &optional font background underline) ; (copy-face 'default face) ; (if foreground (set-face-foreground face foreground)) ; (if font (set-face-font face font)) ; (if background (set-face-background face background)) ; (if underline (set-face-underline-p face t)) ; (eval (list 'setq face (quote face)))) ;(generate-face 'font-lock-brace-face "dimgrey") ;(generate-face 'font-lock-exception-face "brown") (defconst verilog-font-lock-keywords-1 (eval-when-compile (list (list (concat "^[ \t]*" (regexp-opt '("function" "task" "module" "macromodule" "primitive") t) "\\>[ \t]*\\(\\sw+\\)") '(1 font-lock-keyword-face) '(2 font-lock-function-name-face nil t)) (list "\\\\[^ \t]*" 0 font-lock-function-name-face) (list "\\(@\\)\\|\\(#\[ \t\]*\\(\\(\[0-9\]+\\('[hdxbo][0-9_xz]*\\)?\\)\\|\\((\[^)\]*)\\)\\)\\)" 0 font-lock-type-face) (list "\\(`[ \t]*[A-Za-z][A-Za-z0-9_]*\\)" 0 font-lock-type-face) (list (concat "\\<" (regexp-opt '( "integer" "input" "inout" "parameter" "defparam" "output" "supply" "supply0" "supply1" "event" "tri" "tri0" "tri1" "trireg" "triand" "trior" "wire" "wor" "wand" "time" "real" "realtime" "reg") t ) "\\>" ) '(0 font-lock-type-face)) (list (concat "\\(\\$[a-zA-Z][a-zA-Z0-9_\\$]*\\)\\|\\<" (regexp-opt '("case" "casex" "casez" "endcase" "endfunction" "endtask" "endmodule" "endtable" "endprimitive" "endspecify" "assign" "always" "default" "initial" "table" "posedge" "negedge" "else" "for" "forever" "fork" "join" "if" "repeat" "then" "while" "specify") t) "\\>") 0 font-lock-keyword-face) (list "\\<\\(begin\\|end\\)\\>" 0 font-lock-builtin-face) (list "\\s \\|`\\(\\sw+\\)'\\)" 2 font-lock-warning-face prepend) ) ) ) (defvar verilog-font-lock-keywords verilog-font-lock-keywords-1 "Default expressions to highlight in Vlog modes.")