5.0.0: Rename utility functions breaking API change #30
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.
This introduces breaking changs to the utility API functions
renameBindings
,renameFunctions
, andrenameTypes
and changes their signatures to take the specific scope index, rather than the full scope.This also changes the signature of the
mangle()
function to no longer be passed the AST node in question to be mangled.@shaderfrog/core
used this as a hack to set a property directly on AST nodes (.doNotDescope
) to avoid other functions from touching it.It also exports new individual utility functions
renameBinding
etc, and a helper debug function.These changes are largely in service of
@shaderfrog/core
to support better AST manipulation by allowing for the renameFunctions to modify scope indices. This is to keep the scopes in sync with the manipulated AST, which allows for more utility functions to work on scope, and avoid re-visiting an AST to find variables after an AST manipulation.