CJex / regulex

:construction: Regular Expression Excited!
https://jex.im/regulex/
MIT License
5.71k stars 756 forks source link

No looping path for repeat with at most one repeat #8

Closed mathbruyen closed 9 years ago

mathbruyen commented 9 years ago

Repeat used to display a looping path under the block regardless of the maximum number of times it can be used. When this maximum is one like with c? this looping path is actually useless.

current

Add a condition for the maximum and do not display the looping path is maximum is one. If minimum is 0, it already display a short circuit path on top of the block so both {0, 1} and {1, 1} will display properly.

proposed

mathbruyen commented 9 years ago

To be honest the change looks a bit ugly and I did not run tests, I mostly wanted to start with something working. Feel free to tell me if you prefer it done another way.

CJex commented 9 years ago

Thanks very much. I tuned it and simply remove the label text for repeat 0 to 1, and for NonGreedy repeat I use a green path to indicate. download