blynn / nex

Lexer for Go
http://cs.stanford.edu/~blynn/nex/
GNU General Public License v3.0
416 stars 47 forks source link

add test case about broken regex matching #51

Closed purpleidea closed 6 years ago

purpleidea commented 6 years ago

I discovered a situation where the regex does not match correctly. The problem is that a regex like:

/[a-z]([a-z0-9:]*[a-z0-9]+)?/

can match a string (as quoted) with a trailing colon like:

"example42:"

Unfortunately this is wrong. This adds a test case which should pass when this bug is fixed.

Discussion exists in: https://github.com/blynn/nex/issues/50

purpleidea commented 6 years ago

w00t! Awesome! This helps a lot, thanks!