;;; Copyright (C) 2002 Thomas Mailund ;;; This file is not part of GNU Emacs, but it is distributed under the ;;; same conditions. ;;; ==================================================================== ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as ;;; published by the Free Software Foundation; either version 2, or (at ;;; your option) any later version. ;;; This program is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; General Public License for more details. ;;; You should have received a copy of the GNU General Public License ;;; along with this software; see the file COPYING. If not, write to the ;;; Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ;;; ==================================================================== (require 'dprog-constants) (provide 'dprog-font-lock) ;;; Setting up font-lock. (defconst dprog-font-lock-keywords-1 nil "Basic level highlighting for `dprog-mode'.") (defconst dprog-font-lock-keywords-2 nil "Medium level highlighting for `dprog-mode'.") (defconst dprog-font-lock-keywords-3 nil "High level highlighting for `dprog-mode'.") (defvar dprog-font-lock-keywords dprog-font-lock-keywords-1 "Default expressions to highlight in `dprog-mode'.") ;; For the minimal highlighting we just highlight comments and ;; strings, which is taken care of by the syntax table. (setq dprog-font-lock-keywords-0 '()) ;; For the next level we add types, keywords, and some preprocessing (setq dprog-font-lock-keywords-1 (append dprog-font-lock-keywords-0 (list ;; Fontify the basic keywords (cons dprog-keywords-regex 'font-lock-keyword-face) ;(cons "::" 'font-lock-keyword-face) ;; asserts ;(cons dprog-assert-regex 'font-lock-warning-face) ;; Fontify types (cons dprog-basic-types-regex 'font-lock-type-face) ))) ;; For the third level we add processes and variables. (setq dprog-font-lock-keywords-2 (append dprog-font-lock-keywords-1 (list (list (concat "\\(" dprog-name-regex "\\)[ \t]*{") '(1 font-lock-function-name-face)) )))