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

Refactor SymbolTable and AST parent logic #732

Merged
merged 9 commits into from
Nov 1, 2022

Conversation

TwitchBronBron
Copy link
Member

@TwitchBronBron TwitchBronBron commented Oct 28, 2022

  • set AstNode.parent on every walk operation (no more need to wait for the validate lifecycle hooks)

  • remove direct SymbolTable parent linking. Now they are passed a parentProvider function which will return a parent symbol table if one exists. This allows us to link the AstNode parent/child relationship and the SymbolTable parent/child relationship.

  • SymbolTable now supports sibling symbol tables (for use in namespaces spread across multiple files, etc...) which will be checked first before walking up the parent SymbolTable chain.

  • restores a few deleted AstNode properties on some classes that shouldn't have been removed until v1 (.parentFunction, containingFunction, .parentNamespace, etc...) that should all make ropm more happy. :D

Here are the performance changes as a result of this change. As you can see, it hasn't caused any significant changes.
image

@TwitchBronBron TwitchBronBron merged commit 1feb2e8 into master Nov 1, 2022
@TwitchBronBron TwitchBronBron deleted the ast-parenting-on-walk branch November 1, 2022 16:44
xgouchet added a commit to DataDog/dd-sdk-roku that referenced this pull request Nov 22, 2022
[0.60.6](rokucommunity/brighterscript@v0.60.5...0.60.6)
- 2022-11-08
 - double `super` call transpile in subclasses
([#740](rokucommunity/brighterscript#740))
 - issues with Roku doc scraper and adds missing components
([#736](rokucommunity/brighterscript#736))

[0.60.5](rokucommunity/brighterscript@v0.60.4...0.60.5)
- 2022-11-03
 - Refactor SymbolTable and AST parent logic so that SymbolTables get
their parent symbol table from its own (AstNode)
([#732](rokucommunity/brighterscript#732))
 - Significant performance boost in `validate()` by caching
`getCallableByName`
([#739](rokucommunity/brighterscript#739))
 - Add diagnostic when using namespaces as variables
([#738](rokucommunity/brighterscript#738))
 - Fix crash in `getDefinition`
([#734](rokucommunity/brighterscript#734))

[0.60.4](rokucommunity/brighterscript@v0.60.3...0.60.4)
- 2022-10-28
 - Add `name` to symbol table
([#728](rokucommunity/brighterscript#728))
 - Allow `continue` as local var
([#730](rokucommunity/brighterscript#730))
 - language server semanticToken request now waits until validate
finishes
([#727](rokucommunity/brighterscript#727))

[0.60.3](rokucommunity/brighterscript@v0.60.2...0.60.3)
- 2022-10-20
 - better parse recovery for unknown function parameter types
([#722](rokucommunity/brighterscript#722))

[0.60.2](rokucommunity/brighterscript@v0.60.1...0.60.2)
- 2022-10-18
 - if statement block var bug
([#698](rokucommunity/brighterscript#698))

[0.60.1](rokucommunity/brighterscript@v0.60.0...0.60.1)
- 2022-10-18
 - Beter location for bs1042
([#719](rokucommunity/brighterscript#719))

[0.60.0](rokucommunity/brighterscript@v0.59.0...0.60.0)
- 2022-10-10
 - goto definition for enum statements and enum members
([#715](rokucommunity/brighterscript#715))
 - nested namespace support
([#708](rokucommunity/brighterscript#708))
 - upgrade to
[[email protected]](https://github.com/rokucommunity/roku-deploy/blob/master/CHANGELOG.md#392---2022-10-03).
Notable changes since 3.9.1:
     - Replace minimatch with picomatch
([roku-deploy#101](rokucommunity/roku-deploy#101))
 - fixes signature help resolution for callexpressions
([#707](rokucommunity/brighterscript#707))
 - Fix transpilation of simple else block with leading comment
([#712](rokucommunity/brighterscript#712))
xgouchet added a commit to DataDog/dd-sdk-roku that referenced this pull request Nov 23, 2022
[0.60.6](rokucommunity/brighterscript@v0.60.5...0.60.6)
- 2022-11-08
 - double `super` call transpile in subclasses
([#740](rokucommunity/brighterscript#740))
 - issues with Roku doc scraper and adds missing components
([#736](rokucommunity/brighterscript#736))

[0.60.5](rokucommunity/brighterscript@v0.60.4...0.60.5)
- 2022-11-03
 - Refactor SymbolTable and AST parent logic so that SymbolTables get
their parent symbol table from its own (AstNode)
([#732](rokucommunity/brighterscript#732))
 - Significant performance boost in `validate()` by caching
`getCallableByName`
([#739](rokucommunity/brighterscript#739))
 - Add diagnostic when using namespaces as variables
([#738](rokucommunity/brighterscript#738))
 - Fix crash in `getDefinition`
([#734](rokucommunity/brighterscript#734))

[0.60.4](rokucommunity/brighterscript@v0.60.3...0.60.4)
- 2022-10-28
 - Add `name` to symbol table
([#728](rokucommunity/brighterscript#728))
 - Allow `continue` as local var
([#730](rokucommunity/brighterscript#730))
 - language server semanticToken request now waits until validate
finishes
([#727](rokucommunity/brighterscript#727))

[0.60.3](rokucommunity/brighterscript@v0.60.2...0.60.3)
- 2022-10-20
 - better parse recovery for unknown function parameter types
([#722](rokucommunity/brighterscript#722))

[0.60.2](rokucommunity/brighterscript@v0.60.1...0.60.2)
- 2022-10-18
 - if statement block var bug
([#698](rokucommunity/brighterscript#698))

[0.60.1](rokucommunity/brighterscript@v0.60.0...0.60.1)
- 2022-10-18
 - Beter location for bs1042
([#719](rokucommunity/brighterscript#719))

[0.60.0](rokucommunity/brighterscript@v0.59.0...0.60.0)
- 2022-10-10
 - goto definition for enum statements and enum members
([#715](rokucommunity/brighterscript#715))
 - nested namespace support
([#708](rokucommunity/brighterscript#708))
 - upgrade to
[[email protected]](https://github.com/rokucommunity/roku-deploy/blob/master/CHANGELOG.md#392---2022-10-03).
Notable changes since 3.9.1:
     - Replace minimatch with picomatch
([roku-deploy#101](rokucommunity/roku-deploy#101))
 - fixes signature help resolution for callexpressions
([#707](rokucommunity/brighterscript#707))
 - Fix transpilation of simple else block with leading comment
([#712](rokucommunity/brighterscript#712))
xgouchet added a commit to DataDog/dd-sdk-roku that referenced this pull request Nov 23, 2022
[0.60.6](rokucommunity/brighterscript@v0.60.5...0.60.6)
- 2022-11-08
 - double `super` call transpile in subclasses
([#740](rokucommunity/brighterscript#740))
 - issues with Roku doc scraper and adds missing components
([#736](rokucommunity/brighterscript#736))

[0.60.5](rokucommunity/brighterscript@v0.60.4...0.60.5)
- 2022-11-03
 - Refactor SymbolTable and AST parent logic so that SymbolTables get
their parent symbol table from its own (AstNode)
([#732](rokucommunity/brighterscript#732))
 - Significant performance boost in `validate()` by caching
`getCallableByName`
([#739](rokucommunity/brighterscript#739))
 - Add diagnostic when using namespaces as variables
([#738](rokucommunity/brighterscript#738))
 - Fix crash in `getDefinition`
([#734](rokucommunity/brighterscript#734))

[0.60.4](rokucommunity/brighterscript@v0.60.3...0.60.4)
- 2022-10-28
 - Add `name` to symbol table
([#728](rokucommunity/brighterscript#728))
 - Allow `continue` as local var
([#730](rokucommunity/brighterscript#730))
 - language server semanticToken request now waits until validate
finishes
([#727](rokucommunity/brighterscript#727))

[0.60.3](rokucommunity/brighterscript@v0.60.2...0.60.3)
- 2022-10-20
 - better parse recovery for unknown function parameter types
([#722](rokucommunity/brighterscript#722))

[0.60.2](rokucommunity/brighterscript@v0.60.1...0.60.2)
- 2022-10-18
 - if statement block var bug
([#698](rokucommunity/brighterscript#698))

[0.60.1](rokucommunity/brighterscript@v0.60.0...0.60.1)
- 2022-10-18
 - Beter location for bs1042
([#719](rokucommunity/brighterscript#719))

[0.60.0](rokucommunity/brighterscript@v0.59.0...0.60.0)
- 2022-10-10
 - goto definition for enum statements and enum members
([#715](rokucommunity/brighterscript#715))
 - nested namespace support
([#708](rokucommunity/brighterscript#708))
 - upgrade to
[[email protected]](https://github.com/rokucommunity/roku-deploy/blob/master/CHANGELOG.md#392---2022-10-03).
Notable changes since 3.9.1:
     - Replace minimatch with picomatch
([roku-deploy#101](rokucommunity/roku-deploy#101))
 - fixes signature help resolution for callexpressions
([#707](rokucommunity/brighterscript#707))
 - Fix transpilation of simple else block with leading comment
([#712](rokucommunity/brighterscript#712))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant