lpsmith/postgresql-simple — pull request #20 by joeyadams (2012-06-04 11:15:20+00:00)
Title: Drop pcre-light dependency by implementing formatMany's parser by hand

I tried installing the pcre C library on Windows, but couldn't get it to work. To spare myself and others of the major hassle of installing pcre on Windows, I implemented formatMany's parser by hand.

It's not an exact translation, though. For example, the character allowed to appear before "VALUES" is not locale- and Unicode-dependent, but is based on PostgreSQL's lexical specification for identifiers. I doubt any real-life query templates will be affected, though.

I also added a very trivial test case for executeMany. It doesn't cover any interesting edge cases for parsing, but I have done a little testing of the parseTemplate function in GHCi.