veripool / verilog-mode

Verilog-Mode for Emacs with Indentation, Hightlighting and AUTOs. Master repository for pushing to GNU, verilog.com and veripool.org.
http://veripool.org/verilog-mode
GNU General Public License v3.0
247 stars 90 forks source link

Add precedence to paren expressions for sexp funcs navigation. #1788

Closed gmlarumbe closed 1 year ago

gmlarumbe commented 1 year ago

Hi,

This PR fixes a bug when using verilog-backward-sexp. Considering the following snippet:

    constraint addr_range {
        (atype == low ) -> addr inside { [0 : 15] };  //  line 1 comment
        (atype == mid ) -> addr inside { [16 : 127]}; //  line 2 comment
        (atype == high) -> addr inside {[128 : 255]}; //  line 3 comment
    }

If point is after } and verilog-backward-sexp is executed, the cursor will move to the beginning of line 3 comment instead of to its corresponding opening brace. With this fix parenthetical expressions have higher precedence in verilog-backward-sexp cond block and it works as expected.

Thanks!