You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @abitrolly! I'm a bit slow on this one :-) This is a really great idea and I've thought about it a little. The problem comes down to inferring a transformation based on the common and different parts of a tree. This is, in general, a hard thing to do, mostly because there are multiple ways to express a tree difference. For example, if you had:
foo(bar) => foo(bar, baz) it is possible to express the change as:
foo(:[1]) => foo(:[1], baz) OR
:[f](:[1]) => :[f](:[1], baz) OR
:[f](bar) => :[f](bar, baz)
This is just a simple example for the foo(bar) case, and the possibilities only grow the larger the tree gets (i.e., the more code you have). It might seem obvious which one is best above, but in general it's hard to just do right (or it might be expensive to compute).
But, for simple cases (like yours), I think it's very possible to infer one or more plausible transformations. I don't have a good idea for tackling this at the moment, but I'll leave the issue open.
For foo(bar) => foo(bar, baz) the inferred template would be foo(:[f1]), because the whole content of foo node is changed - instead of single bar leaf there is now a subtree with two siblings bar and baz. I omitted comma from the tree, because the comma is a representation of this sibling relationship when the tree is written as code line.
I'm always frustrated when I need to write redundant rules manually.
Describe the solution you'd like
Given two versions of a file, create a minimal rule that extracts changed part.
Additional context
Given.
Then.
Calculate a template that will extract
hole1="2020-07-16T09:06:01.005Z"
andhole2="Jul 16"
for the second file.The text was updated successfully, but these errors were encountered: