Skip to content

Search query fixup: Rename syntax.Query to syntax.ParseTree [1/3]

Administrator requested to merge rvt/rename-to-parsetree into master

Created by: rvantonder

This is the base diff of #6115 and #6116.

This is a semantics preserving change.

Summary

Query is overladed in the codebase. There are these two references, and also Zoekt queries:

  1. There's the parse tree, which is typed as syntax.Query in query.go with comment
// A Query contains the parse tree of a query. 
  1. Then the validated Query in searchquery.go with comment
// A Query is the parsed representation of a search query

The comments above do not refer to the same Query. The former is the parse tree, the latter a validated parse tree (we can call that the query). This PR is the first of three changes to migrate the first reference to a ParseTree type, which simplifies everything down the line. Follow-up diffs #6115 and #6116 branch off of this one to simplify things further and they should be easy to review.

I'm pushing for these changes because I need them to implement RFC 48 while avoiding more spaghetti code <3

Test plan: This is a refactor, tests are updated.

Merge request reports

Loading