Class: PryCoolline::ParenMatch::AST::Leaf

Inherits:
Struct
  • Object
show all
Defined in:
lib/pry-coolline/paren_match.rb

Overview

A sequence of text on its own, that contains no parts of a pair.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tokStrToken

Returns the current value of tok.

Returns:

  • (StrToken)

    the current value of tok



111
112
113
# File 'lib/pry-coolline/paren_match.rb', line 111

def tok
  @tok
end

Instance Method Details

#pair_at(pos) ⇒ Pair

Finds the opening and closing tokens that should be matched at a certain position in the string.

It is assumed you can be looking for the closing parenthesis when on the opening one, or for the opening one when selecting the character that immediately follows it.

Parameters:

  • pos (Integer)

Returns:

  • (Pair)

    An (open, close) pair. Notice both the opening and closing tokens coud be nil.



113
114
115
# File 'lib/pry-coolline/paren_match.rb', line 113

def pair_at(pos)
  nil
end