ziglang / zig-mode

Zig mode for Emacs
GNU General Public License v3.0
166 stars 55 forks source link

Fix font-lock of parameters with pointer or array types #58

Closed eric-p-hutchins closed 3 years ago

eric-p-hutchins commented 3 years ago

I've been playing with zig for a bit and this has been driving me crazy:

zig-mode-fix

Uses the special Elisp "shy group" construct that I found out (also called "non-capturing" or "unnumbered group")

This changes the regex from:

(identifier) (possible whitespace) (colon) (possible whitespace) (identifier)

to:

(identifier) (possible whitespace) (colon) (possible whitespace) (0 or more * characters) (possible whitespace) (possible [] expression with anything inside) (possible whitespace) (identifier)

joachimschmidt557 commented 3 years ago

Related: https://github.com/ziglang/zig-mode/issues/4 and https://github.com/ziglang/zig-mode/pull/33 (failed attempt because of missing rx support in previous versions of emacs)

eric-p-hutchins commented 3 years ago

Replaced by https://github.com/ziglang/zig-mode/pull/59