Class: Solargraph::Parser::NodeMethods
- Inherits:
-
Object
- Object
- Solargraph::Parser::NodeMethods
- Included in:
- FlowSensitiveTyping
- Defined in:
- lib/solargraph/parser/node_methods.rb
Class Method Summary collapse
- .any_splatted_call?(nodes) ⇒ Boolean abstract
- .call_nodes_from(node) ⇒ Array<Parser::AST::Node> abstract
- .const_nodes_from(node) ⇒ Array<Parser::AST::Node> abstract
- .convert_hash(node) ⇒ Hash{Parser::AST::Node => Source::Chain} abstract
- .find_recipient_node(cursor) ⇒ Parser::AST::Node? abstract
- .get_node_end_position(node) ⇒ Position abstract
- .get_node_start_position(node) ⇒ Position abstract
- .process(node) ⇒ void abstract
-
.returns_from_method_body(node) ⇒ Array<Parser::AST::Node>
abstract
Find all the nodes within the provided node that potentially return a value.
- .unpack_name(node) ⇒ String abstract
-
.value_position_nodes_only(node) ⇒ Array<AST::Node>
abstract
Low-level value nodes in value position.
Class Method Details
.any_splatted_call?(nodes) ⇒ Boolean
64 65 66 |
# File 'lib/solargraph/parser/node_methods.rb', line 64 def any_splatted_call?(nodes) raise NotImplementedError end |
.call_nodes_from(node) ⇒ Array<Parser::AST::Node>
Temporarily here for testing. Move to Solargraph::Parser.
17 18 19 |
# File 'lib/solargraph/parser/node_methods.rb', line 17 def call_nodes_from node raise NotImplementedError end |
.const_nodes_from(node) ⇒ Array<Parser::AST::Node>
42 43 44 |
# File 'lib/solargraph/parser/node_methods.rb', line 42 def const_nodes_from node raise NotImplementedError end |
.convert_hash(node) ⇒ Hash{Parser::AST::Node => Source::Chain}
78 79 80 |
# File 'lib/solargraph/parser/node_methods.rb', line 78 def convert_hash node raise NotImplementedError end |
.find_recipient_node(cursor) ⇒ Parser::AST::Node?
49 50 51 |
# File 'lib/solargraph/parser/node_methods.rb', line 49 def find_recipient_node cursor raise NotImplementedError end |
.get_node_end_position(node) ⇒ Position
92 93 94 |
# File 'lib/solargraph/parser/node_methods.rb', line 92 def get_node_end_position(node) raise NotImplementedError end |
.get_node_start_position(node) ⇒ Position
85 86 87 |
# File 'lib/solargraph/parser/node_methods.rb', line 85 def get_node_start_position(node) raise NotImplementedError end |
.process(node) ⇒ void
This method returns an undefined value.
71 72 73 |
# File 'lib/solargraph/parser/node_methods.rb', line 71 def process node raise NotImplementedError end |
.returns_from_method_body(node) ⇒ Array<Parser::AST::Node>
Find all the nodes within the provided node that potentially return a value.
The node parameter typically represents a method’s logic, e.g., the second child (after the :args node) of a :def node. A simple one-line method would typically return itself, while a node with conditions would return the resulting node from each conditional branch. Nodes that follow a :return node are assumed to be unreachable. Nil values are converted to nil node types.
34 35 36 |
# File 'lib/solargraph/parser/node_methods.rb', line 34 def returns_from_method_body node raise NotImplementedError end |
.unpack_name(node) ⇒ String
9 10 11 |
# File 'lib/solargraph/parser/node_methods.rb', line 9 def unpack_name node raise NotImplementedError end |
.value_position_nodes_only(node) ⇒ Array<AST::Node>
Returns low-level value nodes in value position. Does not include explicit return statements.
58 59 60 |
# File 'lib/solargraph/parser/node_methods.rb', line 58 def value_position_nodes_only(node) raise NotImplementedError end |