(verilog-error-regexp-emacs-alist): Coded custom
representation of verilog error regular expressions to work with Emacs-22's new format. (verilog-error-regexp-xemacs-alist): Coded custom representation of verilog error regular expressions to work with XEmacs format (verilog-error-regexp-add-xemacs): Hook routine to install verilog error recognition into XEmacs. (verilog-error-regexp-add-emacs): Hook routine to install verilog error recognition into Emacs-22.
This commit is contained in:
parent
25c6f63e3a
commit
d88782c37f
2 changed files with 105 additions and 59 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
2009-07-07 Michael McNamara <mac@mail.brushroad.com>
|
||||||
|
|
||||||
|
* verilog-mode.el (verilog-error-regexp-emacs-alist): Coded custom
|
||||||
|
representation of verilog error regular expressions to work with
|
||||||
|
Emacs-22's new format.
|
||||||
|
(verilog-error-regexp-xemacs-alist): Coded custom representation
|
||||||
|
of verilog error regular expressions to work with XEmacs format
|
||||||
|
(verilog-error-regexp-add-xemacs): Hook routine to install verilog
|
||||||
|
error recognition into XEmacs.
|
||||||
|
(verilog-error-regexp-add-emacs): Hook routine to install verilog
|
||||||
|
error recognition into Emacs-22.
|
||||||
|
|
||||||
2009-07-06 Chong Yidong <cyd@stupidchicken.com>
|
2009-07-06 Chong Yidong <cyd@stupidchicken.com>
|
||||||
|
|
||||||
* woman.el: Remove stand-alone closing parentheses.
|
* woman.el: Remove stand-alone closing parentheses.
|
||||||
|
|
|
@ -118,9 +118,9 @@
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
;; This variable will always hold the version number of the mode
|
;; This variable will always hold the version number of the mode
|
||||||
(defconst verilog-mode-version "520"
|
(defconst verilog-mode-version "525"
|
||||||
"Version of this Verilog mode.")
|
"Version of this Verilog mode.")
|
||||||
(defconst verilog-mode-release-date "2009-06-12-GNU"
|
(defconst verilog-mode-release-date "2009-07-02-GNU"
|
||||||
"Release date of this Verilog mode.")
|
"Release date of this Verilog mode.")
|
||||||
(defconst verilog-mode-release-emacs t
|
(defconst verilog-mode-release-emacs t
|
||||||
"If non-nil, this version of Verilog mode was released with Emacs itself.")
|
"If non-nil, this version of Verilog mode was released with Emacs itself.")
|
||||||
|
@ -627,21 +627,52 @@ always be saved."
|
||||||
(defvar verilog-auto-last-file-locals nil
|
(defvar verilog-auto-last-file-locals nil
|
||||||
"Text from file-local-variables during last evaluation.")
|
"Text from file-local-variables during last evaluation.")
|
||||||
|
|
||||||
(defvar verilog-error-regexp-add-didit nil)
|
|
||||||
(defvar verilog-error-regexp nil)
|
|
||||||
;;; Compile support
|
;;; Compile support
|
||||||
(require 'compile)
|
(require 'compile)
|
||||||
(make-variable-buffer-local 'compilation-error-regexp-systems-list)
|
(defvar verilog-error-regexp-added nil)
|
||||||
(defvar compilation-error-regexp-alist) ; in case not
|
|
||||||
(make-variable-buffer-local 'compilation-error-regexp-alist)
|
|
||||||
|
|
||||||
; List of regexps for Verilog compilers, like verilint. See compilation-error-regexp-alist
|
; List of regexps for Verilog compilers, like verilint. See compilation-error-regexp-alist
|
||||||
; for the formatting.
|
; for the formatting.
|
||||||
(defvar verilog-error-regexp-alist
|
; Here is the version for Emacs 22:
|
||||||
|
(defvar verilog-error-regexp-emacs-alist
|
||||||
|
'(
|
||||||
|
(verilog-xl-1
|
||||||
|
"\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 3)
|
||||||
|
(verilog-xl-2
|
||||||
|
"([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\(line[ \t]+\\)?\\([0-9]+\\):.*$" 1 3)
|
||||||
|
(verilog-IES
|
||||||
|
".*\\*[WE],[0-9A-Z]+ (\\([^ \t,]+\\),\\([0-9]+\\)" 1 2)
|
||||||
|
(verilog-surefire-1
|
||||||
|
"[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 1 2)
|
||||||
|
(verilog-surefire-2
|
||||||
|
"\\(WARNING\\|ERROR\\|INFO\\)[^:]*: \\([^,]+\\),\\s-+\\(line \\)?\\([0-9]+\\):" 2 4 )
|
||||||
|
(verilog-verbose
|
||||||
|
"\
|
||||||
|
\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\
|
||||||
|
:\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 2 5)
|
||||||
|
(verilog-xsim
|
||||||
|
"\\(Error\\|Warning\\).*in file (\\([^ \t]+\\) at line *\\([0-9]+\\))" 2 3)
|
||||||
|
(verilog-vcs-1
|
||||||
|
"\\(Error\\|Warning\\):[^(]*(\\([^ \t]+\\) line *\\([0-9]+\\))" 2 3)
|
||||||
|
(verilog-vcs-2
|
||||||
|
"Warning:.*(port.*(\\([^ \t]+\\) line \\([0-9]+\\))" 1 2)
|
||||||
|
(verilog-vcs-3
|
||||||
|
"\\(Error\\|Warning\\):[\n.]*\\([^ \t]+\\) *\\([0-9]+\\):" 2 3)
|
||||||
|
(verilog-vcs-4
|
||||||
|
"syntax error:.*\n\\([^ \t]+\\) *\\([0-9]+\\):" 1 2)
|
||||||
|
(verilog-verilator
|
||||||
|
"%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 4)
|
||||||
|
(verilog-leda
|
||||||
|
"In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):
|
||||||
|
.*
|
||||||
|
.*
|
||||||
|
.*
|
||||||
|
\\(Warning\\|Error\\|Failure\\)" 1 2)
|
||||||
|
))
|
||||||
|
;; And the version for XEmacs:
|
||||||
|
(defvar verilog-error-regexp-xemacs-alist
|
||||||
'(verilog
|
'(verilog
|
||||||
; SureLint
|
|
||||||
("[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 1 2)
|
("[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 1 2)
|
||||||
("\\(WARNING\\|ERROR\\|INFO\\)[^:]*: \\([^,]+\\), \\(line \\|\\)\\([0-9]+\\):" 2 4 )
|
("\\(WARNING\\|ERROR\\|INFO\\)[^:]*: \\([^,]+\\),\\s-+\\(line \\)?\\([0-9]+\\):" 2 4 )
|
||||||
("\
|
("\
|
||||||
\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\
|
\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\
|
||||||
:\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 2 5)
|
:\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 2 5)
|
||||||
|
@ -655,7 +686,6 @@ always be saved."
|
||||||
("syntax error:.*\n\\([^ \t]+\\) *\\([0-9]+\\):" 1 2)
|
("syntax error:.*\n\\([^ \t]+\\) *\\([0-9]+\\):" 1 2)
|
||||||
; Verilator
|
; Verilator
|
||||||
("%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 4)
|
("%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 4)
|
||||||
("%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 4)
|
|
||||||
; verilog-xl
|
; verilog-xl
|
||||||
("\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 3)
|
("\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 3)
|
||||||
("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\([0-9]+\\):.*$" 1 2) ; vxl
|
("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\([0-9]+\\):.*$" 1 2) ; vxl
|
||||||
|
@ -664,7 +694,8 @@ always be saved."
|
||||||
(".*\\*[WE],[0-9A-Z]+ (\\([^ \t,]+\\),\\([0-9]+\\)|" 1 2)
|
(".*\\*[WE],[0-9A-Z]+ (\\([^ \t,]+\\),\\([0-9]+\\)|" 1 2)
|
||||||
; Leda
|
; Leda
|
||||||
("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 1 2)
|
("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 1 2)
|
||||||
))
|
)
|
||||||
|
)
|
||||||
|
|
||||||
(defvar verilog-error-font-lock-keywords
|
(defvar verilog-error-font-lock-keywords
|
||||||
'(
|
'(
|
||||||
|
@ -1424,46 +1455,49 @@ without the directory portion, will be substituted."
|
||||||
t t compile-command))))
|
t t compile-command))))
|
||||||
|
|
||||||
;; Following code only gets called from compilation-mode-hook on XEmacs to add error handling.
|
;; Following code only gets called from compilation-mode-hook on XEmacs to add error handling.
|
||||||
;; There is no way to add this on the fly to Emacs; instead we must update compile.el
|
|
||||||
(if (featurep 'xemacs)
|
|
||||||
(defun verilog-error-regexp-add-xemacs ()
|
(defun verilog-error-regexp-add-xemacs ()
|
||||||
"Teach XEmacs about verilog errors.
|
"Teach XEmacs about verilog errors.
|
||||||
Called by `compilation-mode-hook'. This allows \\[next-error] to
|
Called by `compilation-mode-hook'. This allows \\[next-error] to
|
||||||
find the errors."
|
find the errors."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if 't ; (not verilog-error-regexp-add-didit)
|
(if (boundp 'compilation-error-regexp-systems-alist)
|
||||||
(progn
|
(if (and
|
||||||
(if (or (equal compilation-error-regexp-systems-list 'all)
|
(not (equal compilation-error-regexp-systems-list 'all))
|
||||||
(not (member 'verilog compilation-error-regexp-systems-list)))
|
(not (member compilation-error-regexp-systems-list 'verilog)))
|
||||||
(setq compilation-error-regexp-systems-list
|
(push 'verilog compilation-error-regexp-systems-list)))
|
||||||
(if (listp compilation-error-regexp-systems-list)
|
(if (boundp 'compilation-error-regexp-alist-alist)
|
||||||
(nconc compilation-error-regexp-systems-list 'verilog)
|
|
||||||
'verilog)))
|
|
||||||
(if (not (assoc 'verilog compilation-error-regexp-alist-alist))
|
(if (not (assoc 'verilog compilation-error-regexp-alist-alist))
|
||||||
(setcdr compilation-error-regexp-alist-alist
|
(setcdr compilation-error-regexp-alist-alist
|
||||||
(cons verilog-error-regexp-alist
|
(cons verilog-error-regexp-xemacs-alist
|
||||||
(cdr compilation-error-regexp-alist-alist))))
|
(cdr compilation-error-regexp-alist-alist)))))
|
||||||
|
(if (boundp 'compilation-font-lock-keywords)
|
||||||
|
(progn
|
||||||
|
(make-variable-buffer-local 'compilation-font-lock-keywords)
|
||||||
|
(setq compilation-font-lock-keywords verilog-error-font-lock-keywords)
|
||||||
|
(font-lock-set-defaults)))
|
||||||
;; Need to re-run compilation-error-regexp builder
|
;; Need to re-run compilation-error-regexp builder
|
||||||
(compilation-build-compilation-error-regexp-alist))))
|
(if (fboundp 'compilation-build-compilation-error-regexp-alist)
|
||||||
|
(compilation-build-compilation-error-regexp-alist))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
;; Following code only gets called from compilation-mode-hook on Emacs to add error handling.
|
||||||
(defun verilog-error-regexp-add-emacs ()
|
(defun verilog-error-regexp-add-emacs ()
|
||||||
"Tell Emacs compile that we are Verilog.
|
"Tell Emacs compile that we are Verilog.
|
||||||
Called by `compilation-mode-hook'. This allows \\[next-error] to
|
Called by `compilation-mode-hook'. This allows \\[next-error] to
|
||||||
find the errors."
|
find the errors."
|
||||||
(interactive)
|
(interactive)
|
||||||
;; Turned off because there seems no way to do this outside of compile.el
|
(if (boundp 'compilation-error-regexp-alist-alist)
|
||||||
;;
|
(progn
|
||||||
;; (if (or (equal compilation-error-regexp-alist 'all)
|
(if (not (assoc 'verilog-xl-1 compilation-error-regexp-alist-alist))
|
||||||
;; (not (member 'verilog compilation-error-regexp-alist)))
|
(mapcar
|
||||||
;; (setq compilation-error-regexp-alist
|
(lambda (item)
|
||||||
;; (if (listp compilation-error-regexp-alist)
|
(push (car item) compilation-error-regexp-alist)
|
||||||
;; (append '(verilog) compilation-error-regexp-alist)
|
(push item compilation-error-regexp-alist-alist)
|
||||||
;; '(verilog) )))
|
|
||||||
)
|
)
|
||||||
|
verilog-error-regexp-emacs-alist)))))
|
||||||
|
|
||||||
(if (featurep 'xemacs)
|
(if (featurep 'xemacs) (add-hook 'compilation-mode-hook 'verilog-error-regexp-add-xemacs))
|
||||||
(add-hook 'compilation-mode-hook 'verilog-error-regexp-add-xemacs)
|
(if (featurep 'emacs) (add-hook 'compilation-mode-hook 'verilog-error-regexp-add-emacs))
|
||||||
(add-hook 'compilation-mode-hook 'verilog-error-regexp-add-emacs))
|
|
||||||
|
|
||||||
(defconst verilog-directive-re
|
(defconst verilog-directive-re
|
||||||
;; "`case" "`default" "`define" "`define" "`else" "`endfor" "`endif"
|
;; "`case" "`default" "`define" "`define" "`else" "`endfor" "`endif"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue