(if (match-beginning num)
(if string
(let ((result
- (substring string (match-beginning num) (match-end num))))
+ (substring string
+ (match-beginning num) (match-end num))))
(set-text-properties 0 (length result) nil result)
result)
(buffer-substring-no-properties (match-beginning num)
;; We have the old custom-library, hack around it!
(defmacro defgroup (&rest args) nil)
(defmacro customize (&rest args)
- (message "Sorry, Customize is not available with this version of emacs"))
+ (message
+ "Sorry, Customize is not available with this version of emacs"))
(defmacro defcustom (var value doc &rest args)
`(defvar ,var ,value ,doc))
)
(defun verilog-error-regexp-add ()
"Add the messages to the `compilation-error-regexp-alist'.
-Called by `compilation-mode-hook'. This allows \\[next-error] to find the errors."
+Called by `compilation-mode-hook'. This allows \\[next-error] to
+find the errors."
(if (not verilog-error-regexp-add-didit)
(progn
(setq verilog-error-regexp-add-didit t)
(append verilog-error-regexp
(default-value 'compilation-error-regexp-alist)))
;; Could be buffer local at this point; maybe also in let; change all three
- (setq compilation-error-regexp-alist (default-value 'compilation-error-regexp-alist))
+ (setq compilation-error-regexp-alist
+ (default-value 'compilation-error-regexp-alist))
(set (make-local-variable 'compilation-error-regexp-alist)
(default-value 'compilation-error-regexp-alist))
)))
(when verilog-highlight-translate-off
(list
;; Fontify things in translate off regions
- '(verilog-match-translate-off (0 'verilog-font-lock-translate-off-face prepend))
- )))
- )
- )
+ '(verilog-match-translate-off
+ (0 'verilog-font-lock-translate-off-face prepend))
+ )))))
(let ((st-point (point)) hitbeg)
(or (search-backward "//" (verilog-get-beg-of-line) t)
(if (progn
- ;; This is for tricky case //*, we keep searching if /* is proceeded by // on same line
- (while (and (setq hitbeg (search-backward "/*" nil t))
- (progn (forward-char 1) (search-backward "//" (verilog-get-beg-of-line) t))))
+ ;; This is for tricky case //*, we keep searching if /* is
+ ;; proceeded by // on same line.
+ (while
+ (and (setq hitbeg (search-backward "/*" nil t))
+ (progn
+ (forward-char 1)
+ (search-backward "//" (verilog-get-beg-of-line) t))))
hitbeg)
(not (search-forward "*/" st-point t)))))))
(cond
((looking-at "\\<randcase\\>")
(setq str "randcase")
- (setq err nil)
- )
+ (setq err nil))
((match-end 0)
(goto-char (match-end 1))
(if nil
(verilog-kill-existing-comment))
(delete-horizontal-space)
(insert (concat " // " str ))
- (if err (ding 't))
- ))
+ (if err (ding 't))))
(;- This is a begin..end block
(match-end 2) ;; of verilog-end-block-ordered-re
(let ((signal-string (buffer-substring (point)
(progn
(end-of-line) (point)))))
- (if (string-match (concat "\\(.*\\)"
- (regexp-quote bra)
- "\\([0-9]*\\)\\(:[0-9]*\\|\\)\\(::[0-9---]*\\|\\)"
+ (if (string-match
+ (concat "\\(.*\\)"
+ (regexp-quote bra)
+ "\\([0-9]*\\)\\(:[0-9]*\\|\\)\\(::[0-9---]*\\|\\)"
(regexp-quote ket)
"\\(.*\\)$") signal-string)
(let* ((sig-head (match-string 1 signal-string))
(vec-start (string-to-number (match-string 2 signal-string)))
(vec-end (if (= (match-beginning 3) (match-end 3))
vec-start
- (string-to-number (substring signal-string (1+ (match-beginning 3)) (match-end 3)))))
- (vec-range (if (= (match-beginning 4) (match-end 4))
- 1
- (string-to-number (substring signal-string (+ 2 (match-beginning 4)) (match-end 4)))))
+ (string-to-number
+ (substring signal-string (1+ (match-beginning 3))
+ (match-end 3)))))
+ (vec-range
+ (if (= (match-beginning 4) (match-end 4))
+ 1
+ (string-to-number
+ (substring signal-string (+ 2 (match-beginning 4))
+ (match-end 4)))))
(sig-tail (match-string 5 signal-string))
vec)
;; Decode vectors
;;
;; Expand vector
(while vec
- (insert (concat sig-head bra (int-to-string (car vec)) ket sig-tail "\n"))
+ (insert (concat sig-head bra
+ (int-to-string (car vec)) ket sig-tail "\n"))
(setq vec (cdr vec)))
(delete-char -1)
;;
(when (buffer-file-name buf)
(save-excursion
(if (not (file-exists-p (buffer-file-name buf)))
- (error (concat "File not found: " (buffer-file-name buf))))
+ (error
+ (concat "File not found: " (buffer-file-name buf))))
(message (concat "Processing " (buffer-file-name buf)))
(set-buffer buf)
(funcall funref)
(save-excursion
(verilog-beg-of-statement)
(if (= (point) here)
- (throw 'nesting 'block))
- )))
+ (throw 'nesting 'block)))))
(t (throw 'nesting 'block))))
((looking-at verilog-end-block-re)
(throw 'nesting 'cpp))
((bobp)
- (throw 'nesting 'cpp))
- ))
- (throw 'nesting 'cpp)
- )
- )
+ (throw 'nesting 'cpp))))
+ (throw 'nesting 'cpp)))
(defun verilog-calculate-indent-directive ()
"Return indentation level for directive.
((verilog-continued-line)
(let ((sp1 (point)))
(if (verilog-continued-line)
- (progn (goto-char sp)
- (setq indent-str (list 'statement (verilog-current-indent-level))))
+ (progn
+ (goto-char sp)
+ (setq
+ indent-str (list 'statement (verilog-current-indent-level))))
(goto-char sp1)
(setq indent-str (list 'block (verilog-current-indent-level)))))
(goto-char sp))
(setq e (point)) ;Might be on last line
(verilog-forward-syntactic-ws)
(beginning-of-line)
- (while (and (not(looking-at (concat "^\\s-*" verilog-complete-reg)))
+ (while (and (not (looking-at
+ (concat "^\\s-*" verilog-complete-reg)))
(looking-at myre))
(end-of-line)
(setq e (point))
(val)
(m1 (make-marker))
)
- (setq val (+ baseind (eval (cdr (assoc 'declaration verilog-indent-alist)))))
+ (setq val
+ (+ baseind (eval (cdr (assoc 'declaration verilog-indent-alist)))))
(indent-line-to val)
;; Use previous declaration (in this module) as template.
(skip-chars-forward " \t")
(setq ind (current-column))
(goto-char pos)
- (setq val (+ baseind (eval (cdr (assoc 'declaration verilog-indent-alist)))))
+ (setq val
+ (+ baseind
+ (eval (cdr (assoc 'declaration verilog-indent-alist)))))
(indent-line-to val)
(if (and verilog-indent-declaration-macros
(looking-at verilog-declaration-re-2-macro))
(if (/= (current-column) ind)
(progn
(just-one-space)
- (indent-to ind))
- )))
- )))
- )
- )
- (goto-char pos)
- )
- )
+ (indent-to ind))))))))))
+ (goto-char pos)))
(defun verilog-get-lineup-indent (b edpos)
"Return the indent level that will line up several lines within the region.
(progn
(save-excursion
(goto-char (point-min))
- (setq pt (re-search-forward (verilog-build-defun-re label t) nil t)))
+ (setq pt
+ (re-search-forward (verilog-build-defun-re label t) nil t)))
(when pt
(goto-char pt)
(beginning-of-line))
(cond ((and bus
(or (and (string-match "\\[\\([0-9]+\\):\\([0-9]+\\)\\]" bus)
(setq highbit (string-to-number (match-string 1 bus))
- lowbit (string-to-number (match-string 2 bus))))
+ lowbit (string-to-number
+ (match-string 2 bus))))
(and (string-match "\\[\\([0-9]+\\)\\]" bus)
(setq highbit (string-to-number (match-string 1 bus))
lowbit highbit))))
(setq sig (car in-list))
(cond ((and sig (equal sv-name (verilog-sig-name sig)))
;; Combine with this signal
- (when (and sv-busstring (not (equal sv-busstring (verilog-sig-bits sig))))
+ (when (and sv-busstring
+ (not (equal sv-busstring (verilog-sig-bits sig))))
(when nil ;; Debugging
(message (concat "Warning, can't merge into single bus "
sv-name bus
;; Note sig may also be nil for the last signal in the list
(t
(setq out-list
- (cons (list sv-name
- (or sv-busstring
- (if sv-highbit
- (concat "[" (int-to-string sv-highbit) ":" (int-to-string sv-lowbit) "]")))
+ (cons
+ (list sv-name
+ (or sv-busstring
+ (if sv-highbit
+ (concat "[" (int-to-string sv-highbit) ":"
+ (int-to-string sv-lowbit) "]")))
(concat sv-comment combo buswarn)
sv-memory sv-enum sv-signed sv-type sv-multidim)
out-list)
(setq range-exp (match-string 1 range-exp)))
(cond ((not range-exp)
"1")
- ((string-match "^\\s *\\([0-9]+\\)\\s *:\\s *\\([0-9]+\\)\\s *$" range-exp)
- (int-to-string (1+ (abs (- (string-to-number (match-string 1 range-exp))
- (string-to-number (match-string 2 range-exp)))))))
+ ((string-match "^\\s *\\([0-9]+\\)\\s *:\\s *\\([0-9]+\\)\\s *$"
+ range-exp)
+ (int-to-string
+ (1+ (abs (- (string-to-number (match-string 1 range-exp))
+ (string-to-number (match-string 2 range-exp)))))))
((string-match "^\\(.*\\)\\s *:\\s *\\(.*\\)\\s *$" range-exp)
- (concat "(1+(" (match-string 1 range-exp)
- ")"
- (if (equal "0" (match-string 2 range-exp)) ;; Don't bother with -(0)
+ (concat "(1+(" (match-string 1 range-exp) ")"
+ (if (equal "0" (match-string 2 range-exp))
+ ;; Don't bother with -(0)
""
(concat "-(" (match-string 2 range-exp) ")"))
")"))
(goto-char (point-min))
(while (search-forward "AUTO_TEMPLATE" nil t)
(setq templateno (1+ templateno))
- (setq template-line (cons (count-lines (point-min) (point)) template-line)))
+ (setq template-line
+ (cons (count-lines (point-min) (point)) template-line)))
(setq template-line (nreverse template-line))
;; Replace T# L# with absolute line number
(goto-char (point-min))
(while (re-search-forward " Templated T\\([0-9]+\\) L\\([0-9]+\\)" nil t)
- (replace-match (concat " Templated "
- (int-to-string (+ (nth (string-to-number (match-string 1))
- template-line)
- (string-to-number (match-string 2)))))
- t t))))
+ (replace-match
+ (concat " Templated "
+ (int-to-string (+ (nth (string-to-number (match-string 1))
+ template-line)
+ (string-to-number (match-string 2)))))
+ t t))))
\f
;;