Class: Solargraph::Parser::NodeProcessor::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/solargraph/parser/node_processor/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node, region, pins, locals) ⇒ Base

Returns a new instance of Base.

Parameters:



23
24
25
26
27
28
29
# File 'lib/solargraph/parser/node_processor/base.rb', line 23

def initialize node, region, pins, locals
  @node = node
  @region = region
  @pins = pins
  @locals = locals
  @processed_children = false
end

Instance Attribute Details

#localsArray<Pin::LocalVariable> (readonly)

Returns:



17
18
19
# File 'lib/solargraph/parser/node_processor/base.rb', line 17

def locals
  @locals
end

#nodeParser::AST::Node (readonly)

Returns:

  • (Parser::AST::Node)


8
9
10
# File 'lib/solargraph/parser/node_processor/base.rb', line 8

def node
  @node
end

#pinsArray<Pin::Base> (readonly)

Returns:



14
15
16
# File 'lib/solargraph/parser/node_processor/base.rb', line 14

def pins
  @pins
end

#regionRegion (readonly)

Returns:



11
12
13
# File 'lib/solargraph/parser/node_processor/base.rb', line 11

def region
  @region
end

Instance Method Details

#processBoolean, void

Subclasses should override this method to generate new pins.

Returns:

  • (Boolean)

    continue processing the next processor of the same node type.

  • (void)

    In case there is only one processor registered for the node type, it can be void.



35
36
37
38
39
# File 'lib/solargraph/parser/node_processor/base.rb', line 35

def process
  process_children

  true
end