opscode/chef_index — pull request #16 by seancribbs (2014-01-27 05:43:26+00:00)
Title: Refactor Lucene grammar

I set out to just inline the transformations that were in separate modules, but I discovered a lot more that could be refactored here:

I updated neotoma to the latest (and also bumped it upstream when dialyzer found some type bugs in it).

I removed a lot of the macro'd `iolist_to_binary` calls from the transformations. These are expensive when called repeatedly, as they cause lots of garbage to be created as new binaries are allocated to contain ones that already exist. I left the top-level one, assuming you wanted a straight binary from the parse result. See if you can remove that, as it shouldn't be needed if you are just sending the binary to a port later.

I cleaned up the `field_range` transformation so that it uses more minimal patterns. My eyes hurt the first time I read that transformation but the logic was simple. No more FIXME!

A bunch of the transformations just did a bunch of work to reinstate the original input string, these were changed to identity transformations. I assume this was from the previous dual-life of this grammar where it also produced data structures.

There are no more dialyzer bugs from neotoma! This allowed me to restore the original dialyzer target in `concrete.mk`.

The only part I'm unsure about is whether the presence of `src/chef_lucene.peg` will cause non-dev versions to blow up. I'm happy to fix that if so, given a little guidance.