atom / language-clojure

Clojure package for Atom
Other
49 stars 48 forks source link

Remove capture of "default" and minor sexp regex cleanup #81

Closed tomdl89 closed 2 years ago

tomdl89 commented 5 years ago

Description of the Change

Before, the keyword control pattern match would match all words starting with "def" (if surrounded by certain characters). After, the match behaves the same, except it will not match words starting with "default" (including "defaults" "defaulting" etc.). "Default" and its derivatives are considered the only words staring with "def" that would be commonly used in code which are nearly always not definitions. Also, the sexp regex has been updated to reflect this. While there, I noticed some bad regex (notably, confusion of \w with [a-zA-Z] (which are not the same!) .

Alternate Designs

None

Benefits

"default" and derivatives won't be highlighted as a def-like construct

Possible Drawbacks

Anyone creating a macro to define something starting with "ault" would not see correct handling. This is very unlikely as there are no words in any modern language starting with "ault" except one word ("ault") in a Sursilvan dialect of Romansh, which is an adjective anyway.

Applicable Issues

None