-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize node classes into new
AST
namespace
This change introduces a new `RuboCop::AST` namespace, and moves the following classes into it: - `Node` - `Sexp` - `ArrayNode`, `HashNode`, `IfNode`, `ConditionalNode`, `ModifierNode`, `UntilNode`, `WhileNode` It also renames the `ast_node` directory to `ast`, and `ast_node.rb` to `node.rb`.
- Loading branch information
Showing
36 changed files
with
97 additions
and
715 deletions.
There are no files selected for viewing
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
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
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
4 changes: 2 additions & 2 deletions
4
...op/ast_node/node_extensions/array_node.rb → lib/rubocop/ast/node/array_node.rb
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
4 changes: 2 additions & 2 deletions
4
...cop/ast_node/node_extensions/hash_node.rb → lib/rubocop/ast/node/hash_node.rb
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
4 changes: 2 additions & 2 deletions
4
...bocop/ast_node/node_extensions/if_node.rb → lib/rubocop/ast/node/if_node.rb
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
2 changes: 1 addition & 1 deletion
2
..._node/node_extensions/conditional_node.rb → ...ubocop/ast/node/mixin/conditional_node.rb
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
2 changes: 1 addition & 1 deletion
2
...ast_node/node_extensions/modifier_node.rb → lib/rubocop/ast/node/mixin/modifier_node.rb
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
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
8 changes: 6 additions & 2 deletions
8
...op/ast_node/node_extensions/until_node.rb → lib/rubocop/ast/node/until_node.rb~HEAD
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
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
8 changes: 6 additions & 2 deletions
8
...op/ast_node/node_extensions/while_node.rb → lib/rubocop/ast/node/while_node.rb~HEAD
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
module RuboCop | ||
module AST | ||
# This module provides a shorthand method to create a {Node} like | ||
# `Parser::AST::Sexp`. | ||
# | ||
# @see http://rubydoc.info/gems/ast/AST/Sexp | ||
module Sexp | ||
# Creates a {Node} with type `type` and children `children`. | ||
def s(type, *children) | ||
Node.new(type, children) | ||
end | ||
end | ||
end | ||
end |
2 changes: 1 addition & 1 deletion
2
lib/rubocop/ast_node/traversal.rb → lib/rubocop/ast/traversal.rb
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
Oops, something went wrong.