Closed dennwc closed 5 years ago
OK, I see that the comment is confusing. Any ideas on how to make it more clear?
Ready for another review round.
More nitpicking trying to look at it from the perspective or a new, clueless and confused DSL user (because I've been there haha).
Perfection has been reached 👌
Regarding the discussion in https://github.com/bblfsh/sdk/pull/369#discussion_r259029902 - would you be so kind to help me understand the expected behavior of - {Name: "specifiers", Drop: true, Op: Arr()},
is that suppose to match&drop only empty array?
Because from what I can tell - right now this results in check: unused field(s) on node ImportDeclaration: specifiers
😕
Could it be the case that there is a specifiers
field that is not an empty array (so the Drop
wouldn't match) and it's not being handled?
It could, but I wanted to verify the expectations here: {Name: "specifiers", Drop: true, Op: Arr()}
is supposed to match&drop specifiers
only in case it's an empty array - would that be correct?
I think it is but less wait for the DSL guru @dennwc to confirm this.
Yes, it's correct. If it's not an empty array the whole operation will be reverted.
As requested in https://github.com/bblfsh/cpp-driver/pull/26, add an option to drop a field. It will work the same way as
Optional: "x", Op: Any()
, except that it won't create a variable forOptional
.Signed-off-by: Denys Smirnov denys@sourced.tech