scrabsha / expandable

What if we could check declarative macros before using them?
MIT License
45 stars 4 forks source link

fix: propagate "no repetitions" when checking 0-n repetitions #59

Closed scrabsha closed 3 months ago

scrabsha commented 3 months ago

Obligatory meme:

megamind peeking meme "no repetitions?"

It occurred to me that the counterexample generated in the cex_with_repetition test could be shorter. While investigating, I found out this was because we forgot to propagate the states that correspond to "no repetitions" when checking for zero or more repetitions. This PR fixes this.

I also discovered that I wrote incorrect macro tests. Most notably, $( :: $ident )* is NOT a valid expression as far as expandable is concerned (0 repetitions means empty expansion, which is not a valid expression).