-
Notifications
You must be signed in to change notification settings - Fork 47
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
Remove function scope and improve type tracking #401
Merged
TwitchBronBron
merged 28 commits into
v1
from
remove-FunctionScope-and-improve-type-tracking
May 3, 2021
Merged
Remove function scope and improve type tracking #401
TwitchBronBron
merged 28 commits into
v1
from
remove-FunctionScope-and-improve-type-tracking
May 3, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Ran npm audit and fixed vulvnerability * Added symbol table class * Parser adds to a symbol table as it parses code * Revert package changes * Fixed test that was referencing LazyType when it was not supposed to * Better handling of a variable potentially changing type. Added getSymbolType() function and fixed error of a function inheriting symbols from a containing function * Fixed typo * Removed code comment * Fixes from PR comments - and made sure for each loop variables were added to the symbolTable * Changed BscSymbol interface to include a range Co-authored-by: Mark Pearce <[email protected]>
* Adds SymbolTable.hasKey method * Makes CustomType display its actual type * Standardize how a FunctionType is created from an expression * Adds symbol tables to namespaces * Adds a symbol table to scope, and computes merged symbol tables across files * Use the symbolTable on getHover * Working on argument type mismatch validation * Proper type tracking across files in the same scope, including namespaces. Adds validation on argument types * Fixed bad whitespace in tests * Updates from code review * Fixed all circular dependency issues * Hopefully fixed all whitespace issues * Fixes for when scope changes * Fixed lint error and remove symbolTable clear - it was not needed * Clean up getHover code Co-authored-by: Mark Pearce <[email protected]>
…into remove-FunctionScope-and-improve-type-tracking
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Migrated from #258
Notable changes:
FunctionScope
concept in favor of capturing variable declarations for each function at parse-time and storing them inreferences
. This cut down on a lot of after-parse looping.LazyType
to defer deriving the type of certain variable types until after the file has been parsed.SymbolTable
at multiple levels (Scope
,Parser
,NamespaceStatement
,FunctionExpression
) to help track variable assignments and function definitions.This change yielded some fairly impressive performance improvements for the
![image](https://user-images.githubusercontent.com/2544493/104508257-f56dfe00-55b5-11eb-9ce1-f7c341618dd2.png)
validate
cycle: