Class: Solargraph::Parser::Rubyvm::NodeProcessors::OptArgNode
- Inherits:
-
NodeProcessor::Base
- Object
- NodeProcessor::Base
- Solargraph::Parser::Rubyvm::NodeProcessors::OptArgNode
- Defined in:
- lib/solargraph/parser/rubyvm/node_processors/opt_arg_node.rb
Instance Attribute Summary
Attributes inherited from NodeProcessor::Base
#locals, #node, #pins, #region
Instance Method Summary collapse
Methods inherited from NodeProcessor::Base
Constructor Details
This class inherits a constructor from Solargraph::Parser::NodeProcessor::Base
Instance Method Details
#process ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/solargraph/parser/rubyvm/node_processors/opt_arg_node.rb', line 8 def process locals.push Solargraph::Pin::Parameter.new( location: region.closure.location, closure: region.closure, comments: comments_for(node), name: node.children[0].children[0].to_s, assignment: node.children[0].children[1], asgn_code: node.children[0].children[1] ? region.code_for(node.children[0].children[1]) : nil, presence: region.closure.location.range, decl: :optarg ) region.closure.parameters.push locals.last node.children[1] && NodeProcessor.process(node.children[1], region, pins, locals) end |