ethereum / emacs-solidity

The official solidity-mode for EMACS
GNU General Public License v3.0
205 stars 66 forks source link

Make solidity-match-variable-decls regexp's unhighlited matches shy. #56

Closed coventry closed 4 years ago

coventry commented 4 years ago

This ensures that if the two optional matches in the regexp, \\[ *[0-9]*\\] or (regexp-opt solidity-variable-modifier 'words) have no match, the name of the variable being declared can be still be found via the absolute match index 2. Prior to this change, a simple address foo would match the regexp, but the expected match index for the variable, 4, would have no match, which could lead to font-lock errors in some circumstances.

Reference for shy matches

Fixes #47

LefterisJP commented 4 years ago

Hey @coventry very nice catch. Thank you!

coventry commented 4 years ago

NP, glad I could help.