fix for issue #585
Created by: covercash2
Solution:
the level: u8
variable in the Iterator::next
implementation for the ArgumentSplitter
was being decremented when its value was 0, causing a panic (unsigned ints cannot be less than 0).
Changes introduced by this pull request
i assumed that level
represented the depth of the parentheses, so i consolidated the handling of parentheses and added level +=1
or level -= 1
respectively.
i also refactored the raw bit flags to use the bitflags crate for a few reason:
- the crate was already imported
- it makes the code a lot more readable (to me at least)
- it helped me understand the code
Drawbacks
i just assumed level
was referring to the parenthesis level, but i could be wrong. if that's the case this pull request should be rejected.