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

Feature/symbol table #380

Conversation

markwpearce
Copy link
Collaborator

Adds the SymbolTable class, and builds the symbol table from assignments and function names

Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I have items that need to be addressed.

src/SymbolTable.ts Outdated Show resolved Hide resolved
src/SymbolTable.ts Outdated Show resolved Hide resolved
src/SymbolTable.ts Outdated Show resolved Hide resolved
src/parser/Parser.spec.ts Show resolved Hide resolved
src/parser/Parser.spec.ts Show resolved Hide resolved
src/SymbolTable.ts Outdated Show resolved Hide resolved
@markwpearce
Copy link
Collaborator Author

markwpearce commented Apr 1, 2021

Not sure why the mac build failed? I assume some sort of external issue - I have a Mac, and it builds/lints/runs fine on my machine

@TwitchBronBron
Copy link
Member

Not sure why the mac build failed? I assume some sort of external issue - I have a Mac, and it builds/lints/runs fine on my machine

The GitHub actions mac builds sometimes have issues. I re-ran them and everything is passing now.

@TwitchBronBron
Copy link
Member

This is a great step forward! Per our conversations in slack, we still have a few scope-related changes to make before the target PR can be merged. However, I'm happy with the current progress of this PR so I'm merging it.

@TwitchBronBron TwitchBronBron merged commit 8fe2bf7 into rokucommunity:for-each-var-completions Apr 1, 2021
TwitchBronBron added a commit that referenced this pull request May 3, 2021
* Add `for each` variable to completions

* ForEachStatement's `item` is now VaribleExpression

* Fix ts build issue.

* fix broken tests

* fix broken test.

* Collection function variables in _references

* Removed FunctionScope in favor of func expressions

* lint and interface fixes

* Repopulate `references.localVars` during `findReferences`

* Handle sub with explicit return type

* Fix `findReferences` for local vars

* Normalize line endings for Scope.ts

* Feature/symbol table (#380)

* 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]>

* Feature/scope tracked symbol tables (#395)

* 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]>

* del `references.localVars` in favor of SymbolTable

* Move private _symbolTable below the getter

Co-authored-by: Mark Pearce <[email protected]>
Co-authored-by: Mark Pearce <[email protected]>
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.

2 participants