Class: Frepl::Subroutine
- Inherits:
-
MultilineStatement
- Object
- Statement
- MultilineStatement
- Frepl::Subroutine
- Defined in:
- lib/frepl/statements/subroutine.rb
Instance Attribute Summary
Attributes inherited from MultilineStatement
Instance Method Summary collapse
Methods inherited from MultilineStatement
#complete?, #incomplete?, #initialize, #output
Methods inherited from Statement
Constructor Details
This class inherits a constructor from Frepl::MultilineStatement
Instance Method Details
#==(other) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/frepl/statements/subroutine.rb', line 15 def ==(other) if other.is_a?(Subroutine) self.name == other.name else super(other) end end |
#accept(visitor) ⇒ Object
7 8 9 |
# File 'lib/frepl/statements/subroutine.rb', line 7 def accept(visitor) visitor.visit_subroutine(self) end |
#name ⇒ Object
11 12 13 |
# File 'lib/frepl/statements/subroutine.rb', line 11 def name @name ||= lines.first.match(Frepl::Classifier::SUBROUTINE_REGEX)[1] end |
#terminal_regex ⇒ Object
3 4 5 |
# File 'lib/frepl/statements/subroutine.rb', line 3 def terminal_regex /end subroutine\s?#{Frepl::Classifier::VARIABLE_NAME_REGEX}/ end |