Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] The generated Tree misses information #126

Open
martinezmatias opened this issue May 25, 2020 · 0 comments
Open

[bug] The generated Tree misses information #126

martinezmatias opened this issue May 25, 2020 · 0 comments
Labels

Comments

@martinezmatias
Copy link
Contributor

Summary of the problem

The generated tree of a Method invocation (target.call(p1)) misses information: the children of the Invocation are both: the target's node and the parameters (if any).
For example, from the previous example, there is a node of type invocation labeled with call with two children: target and p1, both of type var access.

Details:

We can produce incorrect outputs when both target and parameters nodes are modified (updates, insert, etc).

##Real Example (a bit simplified to ease the explanation):

- extension.startsWith(".")
+ startsWith(extension,".")

There, there is not any differences: both trees are equivalent: a node startsWith with two children: first extension, second ".".

Proposed Solution:

As we have done in other situations (e.g., method modifiers), we can consider to add new Virtual nodes.
In this case, we can add a new virtual node as new parent of target node, and a second one as parent of all the parameters.
Thus, a method invocation would have always only two virtual children.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant