Support queries in patterns
Merge pull request #24 from golyshevd/i11

Support queries in patterns