New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stringCI broken in 0.12.1.5 ? #99

Closed
gzh opened this Issue Apr 5, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@gzh

gzh commented Apr 5, 2015

Small test:

Prelude Data.Attoparsec.ByteString.Char8> parse (stringCI "FooBar") "foobar"
Done "" "foobar"
Prelude Data.Attoparsec.ByteString.Char8> parse (stringCI "FooBar") "FooBar"
Fail "FooBar" [] "string"
Prelude Data.Attoparsec.ByteString.Char8> parse (stringCI "foobar") "FooBar"
Fail "FooBar" [] "string"
Prelude Data.Attoparsec.ByteString.Char8> parse (stringCI "foobar") "foobar"
Done "" "foobar"

Feels like stringCI "internally lowers" the case of pattern string (ie its argument) but "does not" lower case of input before matching.

Reproduced this on ghc-7.10.1 with attoparsec-0.12.1.5 and attoparsec-0.12.1.4. Previously this worked as expected (all 4 of above examples result in Done _ _) with attoparsec-0.11.x (tested with attoparsec-0.11.3.4) and attoparsec-0.12.1.3. Could it be that the problem was introduced by commit dcc5e1f ?

@bos

This comment has been minimized.

Owner

bos commented Apr 5, 2015

Thanks, @gzh, this is definitely a bug and you've correctly identified the commit that introduces it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment