joemalle / limn

A tiny parser designed to compile quickly
Boost Software License 1.0
2 stars 1 forks source link

bug: endless loop happens #4

Closed asmwarrior closed 1 year ago

asmwarrior commented 1 year ago

Hi, when I try to run such code:

parse("xyz uvw abc def", *((*alnum_) >> *space_) >> end_);

I got endless loop.

I think this is a bug.

It still goes endless if I remove the end_.

asmwarrior commented 1 year ago
parse("xyz uvw ", ((*alnum_) >> *space_) >> ((*alnum_) >> *space_));

This works OK.

So, I think in some place, we have to check whether the string is empty, which should exit the endless loop.

asmwarrior commented 1 year ago

OK, I think I have found the reason, and the fix is committed to my pull request https://github.com/joemalle/limn/pull/5.