Skip to content

Bump syntax_tree from 4.3.0 to 5.0.0 #25

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

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 9, 2022

Bumps syntax_tree from 4.3.0 to 5.0.0.

Changelog

Sourced from syntax_tree's changelog.

[5.0.0] - 2022-11-09

Added

  • Every node now implements the #copy(**) method, which provides a copy of the node with the given attributes replaced.
  • Every node now implements the #===(other) method, which checks if the given node matches the current node for all attributes except for comments and location.
  • There is a new SyntaxTree::Visitor::MutationVisitor and its convenience method SyntaxTree.mutation which can be used to mutate a syntax tree. For details on how to use this visitor, check the README.

Changed

  • Nodes no longer have a comments: keyword on their initializers. By default, they initialize to an empty array. If you were previously passing comments into the initializer, you should now create the node first, then call node.comments.concat to add your comments.
  • A lot of nodes have been folded into other nodes to make it easier to interact with the AST. This means that a lot of visit methods have been removed from the visitor and a lot of class definitions are no longer present. This also means that the nodes that received more function now have additional methods or fields to be able to differentiate them. Note that none of these changes have resulted in different formatting. The changes are listed below:
    • IfMod, UnlessMod, WhileMod, UntilMod have been folded into IfNode, UnlessNode, WhileNode, and UntilNode. Each of the nodes now have a modifier? method to tell if it was originally in the modifier form. Consequently, the visit_if_mod, visit_unless_mod, visit_while_mod, and visit_until_mod methods have been removed from the visitor.
    • VarAlias is no longer a node, and the Alias node has been renamed. They have been folded into the AliasNode node. The AliasNode node now has a var_alias? method to tell you if it is aliasing a global variable. Consequently, the visit_var_alias method has been removed from the visitor interface. If you were previously using this method, you should now use visit_alias instead.
    • Yield0 is no longer a node, and the Yield node has been renamed. They has been folded into the YieldNode node. The YieldNode node can now have its arguments field be nil. Consequently, the visit_yield0 method has been removed from the visitor interface. If you were previously using this method, you should now use visit_yield instead.
    • FCall is no longer a node, and the Call node has been renamed. They have been folded into the CallNode node. The CallNode node can now have its receiver and operator fields be nil. Consequently, the visit_fcall method has been removed from the visitor interface. If you were previously using this method, you should now use visit_call instead.
    • Dot2 and Dot3 are no longer nodes. Instead they have become a single new RangeNode node. This node looks the same as Dot2 and Dot3, except that it additionally has an operator field that contains the operator that created the node. Consequently, the visit_dot2 and visit_dot3 methods have been removed from the visitor interface. If you were previously using these methods, you should now use visit_range instead.
    • Def, DefEndless, and Defs have been folded into the DefNode node. The DefNode node now has the target and operator fields which originally came from Defs which can both be nil. It also now has an endless? method on it to tell if the original node was found in the endless form. Finally the bodystmt field can now either be a BodyStmt as it was or any other kind of node since that was the body of the DefEndless node. The visit_defs and visit_def_endless methods on the visitor have therefore been removed.
    • DoBlock and BraceBlock have now been folded into a BlockNode node. The BlockNode node now has a keywords? method on it that returns true if the block was constructed with the do..end keywords. The visit_do_block and visit_brace_block methods on the visitor have therefore been removed and replaced with the visit_block method.
    • Return0 is no longer a node, and the Return node has been renamed. They have been folded into the ReturnNode node. The ReturnNode node can now have its arguments field be nil. Consequently, the visit_return0 method has been removed from the visitor interface. If you were previously using this method, you should now use visit_return instead.
  • The ArgsForward, Redo, Retry, and ZSuper nodes no longer have value fields associated with them (which were always string literals corresponding to the keyword being used).
  • The Command and CommandCall nodes now has block attributes on them. These attributes are used in the place where you would previously have had a MethodAddBlock structure. Where before the MethodAddBlock would have the command and block as its two children, you now just have one command node with the block attribute set to the Block node.
  • Previously the formatting options were defined on an unfrozen hash called SyntaxTree::Formatter::OPTIONS. It was globally mutable, which made it impossible to reference from within a Ractor. As such, it has now been replaced with SyntaxTree::Formatter::Options.new which creates a new options object instance that can be modified without impacting global state. As a part of this change, formatting can now be performed from within a non-main Ractor. In order to check if the plugin/single_quotes plugin has been loaded, check if SyntaxTree::Formatter::SINGLE_QUOTES is defined. In order to check if the plugin/trailing_comma plugin has been loaded, check if SyntaxTree::Formatter::TRAILING_COMMA is defined.
Commits
  • 64f045b Bump to v5.0.0
  • 6677001 Merge pull request #195 from ruby-syntax-tree/typos
  • a651a4e Fix typos in READMe
  • e5298c9 Merge pull request #194 from ruby-syntax-tree/documentation
  • cdede9b Update documentation in the README
  • 43afc03 Merge pull request #193 from ruby-syntax-tree/silent-tests
  • a1981d7 Document ignoring code
  • 8faf11e Make the test suite silent
  • 09c816c Merge pull request #192 from ruby-syntax-tree/more-naming
  • 8e31ca9 More naming changes
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [syntax_tree](https://github.com/kddnewton/syntax_tree) from 4.3.0 to 5.0.0.
- [Release notes](https://github.com/kddnewton/syntax_tree/releases)
- [Changelog](https://github.com/ruby-syntax-tree/syntax_tree/blob/main/CHANGELOG.md)
- [Commits](ruby-syntax-tree/syntax_tree@v4.3.0...v5.0.0)

---
updated-dependencies:
- dependency-name: syntax_tree
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Nov 9, 2022
@kddnewton kddnewton merged commit 8be7052 into main Nov 9, 2022
@kddnewton kddnewton deleted the dependabot/bundler/syntax_tree-5.0.0 branch November 9, 2022 19:15
@davidwessman davidwessman mentioned this pull request Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant