Here's a complete sketch.
Text, regex, and path queries work, and test_basic passes.
Make file-oriented searches not show lines of the files they find.
Sketch an ExistsLikeFilter that should make the function filter work.

But it's short on flexibility for multi-table filters like function-ref. Committing before I expand it.
Move filters to their own module.

I'm tired of opening query.py in 3 separate windows to see the filters list, the filter classes, and results() at once. This is also a remarkably clean split, import-wise.
ExistsLikeFilter *should* (untested) now support multi-table filters like function-ref (which serves here as an example).

Also...
* Switch alias_count to return entire aliases, not just numbers, so we don't have to repeat the concatenation all over the place.
* Introduce LocalNamer to support multi-tableness in ExistsLikeFilter. It's like hygienic macros but with SQL!
Sketch a UnionFilter that support positive (so far) subfilters.
Sketch a UnionFilter that supports negated terms.
Turn the whole query system right-side-out.

* DXR's query machinery has been inside out from the moment it was born. Rather than looping through all existing filters and asking each to take its bite out of the query, we now loop over query terms and dispatch to each filter based on the filter name the parser detects. This enables us to write a UnionFilter without going crazy. So `filters` becomes a dict, the `param` moves into the dict key, filters deal with only a term at a time, and filter() returns one tuple rather than yielding several.
* Have QueryVisitor spit out a list of term dicts rather than nesting them all into a bigger dict by filter type.
* Break TrigramSearchFilter into 2 classes: one for text and one for regexes.
* Teach results() about join clauses.
Remove extraneous whitespace around equal signs so I'll have less to type in a moment.

Also, this conforms better to PEP 8.
Rewrite the rest of the filters to conform to the new query machinery. Filter out None extents.
Fix a vestigial indent.
Get ext: filters working again.

This just needed a few tweaks to the revised query parser.
Linebreaks are in fact *not* in the DB anymore.
Rewrite LocalNamer to be a string.Formatter.

None of __getitem__, get, __getattr__, nor __getattribute__ are called on a map-like object passed into format(), so this is necessary. Factor out alias_counter() so we can use it from tests.

This makes function:main work in test_basic.
[squash] with "Rewrite the rest of the filters..."
Compensate for clang extents being 1-based.
Fix a user-facing error message.
Tolerate the None extents that come out of left joins.
Make UnionFilter work with multi-table subfilters.

Also...
* Add join_arguments param to keep params in order: join clauses come before WHERE conditions.
* Some params from RegexpFilter weren't embedded in a list like they should have been.