SIGN IN SIGN UP

topdown/copypropagation: Fix single term expression killing

In 1b82a8ce7debeab16d5f0b24bc27521f6a5184bd we extended copy
propagation to kill single term expressions if they were variables
that appeared in the binding list. The problem was that these checks
were not being added back into the resulting query if the variable was
not in the live set.

This change just removes the special case where we killed single term
expresions. The output from copy propagation is largely unaffected.

As part of these changes, the partial eval test cases can now specify
the expected query ASTs as opposed to query strings that get
parsed. The reason for this is that copy propagation returns
expressions that contain ast.Call terms which are normally flattened
into expressions of type []*ast.Term during parse/compile. It's
arguable that copy propagation should be returning expressions that
contain ast.Call terms, however, refactoring that would be a larger
change and we already assume that the results of partial eval/copy
propagation are compiled so it's not really necessary.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
T
Torin Sandall committed
1cd10f8a1e3e5cedbb48804f22be9487f3696a17
Parent: d30e5be