Class: Solargraph::Parser::NodeMethods

Inherits:
Object
  • Object
show all
Included in:
FlowSensitiveTyping
Defined in:
lib/solargraph/parser/node_methods.rb

Class Method Summary collapse

Class Method Details

.any_splatted_call?(nodes) ⇒ Boolean

This method is abstract.

Parameters:

  • nodes (Enumerable<Parser::AST::Node>)

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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>

This method is abstract.
TODO:

Temporarily here for testing. Move to Solargraph::Parser.

Parameters:

  • node (Parser::AST::Node)

Returns:

  • (Array<Parser::AST::Node>)

Raises:

  • (NotImplementedError)


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>

This method is abstract.

Parameters:

  • node (Parser::AST::Node)

Returns:

  • (Array<Parser::AST::Node>)

Raises:

  • (NotImplementedError)


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}

This method is abstract.

Parameters:

  • node (Parser::AST::Node)

Returns:

Raises:

  • (NotImplementedError)


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?

This method is abstract.

Parameters:

Returns:

  • (Parser::AST::Node, nil)

Raises:

  • (NotImplementedError)


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

This method is abstract.

Parameters:

  • node (Parser::AST::Node)

Returns:

Raises:

  • (NotImplementedError)


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

This method is abstract.

Parameters:

  • node (Parser::AST::Node)

Returns:

Raises:

  • (NotImplementedError)


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 is abstract.

This method returns an undefined value.

Parameters:

  • node (Parser::AST::Node)

Raises:

  • (NotImplementedError)


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>

This method is abstract.

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.

Parameters:

  • node (Parser::AST::Node)

Returns:

  • (Array<Parser::AST::Node>)

Raises:

  • (NotImplementedError)


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

This method is abstract.

Parameters:

  • node (Parser::AST::Node)

Returns:

  • (String)

Raises:

  • (NotImplementedError)


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>

This method is abstract.

Returns low-level value nodes in value position. Does not include explicit return statements.

Parameters:

  • node (Parser::AST::Node)

Returns:

  • (Array<AST::Node>)

    low-level value nodes in value position. Does not include explicit return statements

Raises:

  • (NotImplementedError)


58
59
60
# File 'lib/solargraph/parser/node_methods.rb', line 58

def value_position_nodes_only(node)
  raise NotImplementedError
end