Oh, I see the existing text is already inconsistent with naming conventions. You can ignore the renaming comments if you want -- we can always fix up the names post-commit -- or you can fix up this name (which is the only oddball in the file).
firstLine should be FirstLine and I have a slight preference for StringRef instead of auto (but don't insist because Lines is so nearby and clear).
MaxLength and perhaps this type should be unsigned or size_t rather than int to avoid the unnecessary type conversion?
Comment missing a trailing full stop.
Definitely prefer using StringRef here -- I had no idea drop_while() returned this.
auto -> StringRef
Would it make more sense to have Query with another constructor to hold the remaining content, and then thread that through LetQuery, MatchQuery, etc? Whether there is remaining content or not seems like a pretty important property of the query, so it seems reasonable to let people construct with that information rather than set it after the fact.
If not, these should be auto * rather than deducing the pointer.
Add a full stop to the comment.
Sorry for the late review comment, but I'd really appreciate if you could update the doc comments to explain why MatcherCode is taken by reference, and how it is mutated.