Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

WIP: Definition reference identifier #407

Closed

Conversation

macovedj
Copy link
Contributor

@macovedj macovedj commented May 10, 2020

Adding ability for ReferenceIdentifiers to have access to the definitions of the functions they reference as described in #395.

@macovedj macovedj force-pushed the definition-reference-identifier branch from 2d4a5c3 to 47a12be Compare May 10, 2020 14:37
@sebmck
Copy link
Contributor

sebmck commented May 10, 2020

This information shouldn't be in the AST. This makes the AST recursive by introducing a pointer to a possible parent node. If we visited the functionDefinition property as visitable then it would infinitely recurse. What if the function gets modified? The ReferenceIdentifier now has an outdated reference.

The resolution should be done in scope tracking. We just need to retain information to resolve bindings to a specific node.

@macovedj
Copy link
Contributor Author

This information shouldn't be in the AST. This makes the AST recursive by introducing a pointer to a possible parent node. If we visited the functionDefinition property as visitable then it would infinitely recurse. What if the function gets modified? The ReferenceIdentifier now has an outdated reference.

The resolution should be done in scope tracking. We just need to retain information to resolve bindings to a specific node.

That makes a lot of sense. I'll give that a shot.

@sebmck
Copy link
Contributor

sebmck commented May 13, 2020

Let me know if you need any help! Happy to assist in the Discord. Closing this since I'm trying to get a handle on open PRs. Feel free to open a new one with any additional changes. Thank you!

@sebmck sebmck closed this May 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants