Class: Solargraph::Parser::Legacy::NodeProcessors::ResbodyNode
- Inherits:
-
NodeProcessor::Base
- Object
- NodeProcessor::Base
- Solargraph::Parser::Legacy::NodeProcessors::ResbodyNode
- Includes:
- Solargraph::Parser::Legacy::NodeMethods
- Defined in:
- lib/solargraph/parser/legacy/node_processors/resbody_node.rb
Constant Summary
Constants included from Solargraph::Parser::Legacy::NodeMethods
Solargraph::Parser::Legacy::NodeMethods::NIL_NODE
Instance Attribute Summary
Attributes inherited from NodeProcessor::Base
#locals, #node, #pins, #region
Instance Method Summary collapse
Methods included from Solargraph::Parser::Legacy::NodeMethods
call_nodes_from, const_nodes_from, convert_hash, drill_signature, find_recipient_node, get_node_end_position, get_node_start_position, infer_literal_node_type, pack_name, returns_from, splatted_call?, splatted_hash?, unpack_name
Methods inherited from NodeProcessor::Base
Constructor Details
This class inherits a constructor from Solargraph::Parser::NodeProcessor::Base
Instance Method Details
#process ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/solargraph/parser/legacy/node_processors/resbody_node.rb', line 10 def process if node.children[1] here = get_node_start_position(node.children[1]) presence = Range.new(here, region.closure.location.range.ending) loc = get_node_location(node.children[1]) types = if node.children[0].nil? ['Exception'] else node.children[0].children.map do |child| unpack_name(child) end end locals.push Solargraph::Pin::LocalVariable.new( location: loc, closure: region.closure, name: node.children[1].children[0].to_s, comments: "@type [#{types.join(',')}]", presence: presence ) end NodeProcessor.process(node.children[2], region, pins, locals) end |