Skip to content

Commit

Permalink
Fix bug in `verilog-ext-find-function-task' that hung Emacs
Browse files Browse the repository at this point in the history
- Since the function was being used for fontification,
there was an endless loop while searching on expressions
syntactically incorrect, i.e:
 - task ;
 - function ;
 - extern task ;
 - etc...
  • Loading branch information
gmlarumbe committed May 12, 2023
1 parent ae2aade commit 1227375
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions verilog-ext-nav.el
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,16 @@ the function call."
(setq tf-args-pos-beg (1+ (point)))
(setq tf-args (split-string (buffer-substring-no-properties tf-args-pos-beg tf-args-pos-end) ","))
(setq tf-args (mapcar #'string-trim tf-args)))
(backward-word)
;; Func/task name
(when (looking-at verilog-identifier-re)
(setq tf-name (match-string-no-properties 0))
(verilog-ext-backward-syntactic-ws)
(when (and (looking-back verilog-identifier-sym-re (car (bounds-of-thing-at-point 'symbol)))
(setq tf-name (match-string-no-properties 0))
(not (member tf-name (remove "new" verilog-keywords)))) ; Avoid getting stuck with "task ; "
(setq tf-name-pos-beg (match-beginning 0))
(setq tf-name-pos-end (match-end 0))
(setq found t))
;; Externally defined functions
(backward-word)
(verilog-ext-when-t (eq (preceding-char) ?:)
(skip-chars-backward ":")
(backward-word)
Expand Down

0 comments on commit 1227375

Please sign in to comment.