emacs-elsa / Elsa

Emacs Lisp Static Analyzer and gradual type system.
GNU General Public License v3.0
644 stars 27 forks source link

(rx (or (and (? "#") "'") "," "`" ",@")) should not be analyzed in the traditional sense #103

Open Fuco1 opened 6 years ago

Fuco1 commented 6 years ago

This presents a lot of "unreachable expression" false warnings.

vermiculus commented 5 years ago

This problem will generalize to all macros, I think. It's too bad a static analyzer can't expand macros – but it could detect them with a declare form.

Fuco1 commented 5 years ago

We can still analyse macros where we know beforehand what the structure is, so things like when are pefrectly easy to analyse with the a priori knowledge. Even when we don't the assumption of "this is just code" holds more often than not.

We had a discussion about macro expansion here: https://github.com/emacs-elsa/Elsa/issues/32

I haven't yet decided if we want to abort and skip or assume it's regular code (iow what is the more common variant). See also #19

DamienCassou commented 5 years ago

Beyond unreachable expression, I got type error with this expression:

(rx line-start
      (group (+? (not (any ?:))))
      ": "
      (group (* not-newline))
      line-end)