Class: PryCoolline::ParenMatch::AST::DanglingClose
- Inherits:
-
Struct
- Object
- Struct
- PryCoolline::ParenMatch::AST::DanglingClose
- Defined in:
- lib/pry-coolline/paren_match.rb
Overview
A top-level closing paren — meaning there's no matching opening character.
Instance Attribute Summary collapse
-
#tok ⇒ Object
Returns the value of attribute tok.
Instance Method Summary collapse
-
#pair_at(pos) ⇒ Pair
Finds the opening and closing tokens that should be matched at a certain position in the string.
Instance Attribute Details
#tok ⇒ Object
Returns the value of attribute tok
120 121 122 |
# File 'lib/pry-coolline/paren_match.rb', line 120 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.
122 123 124 125 126 |
# File 'lib/pry-coolline/paren_match.rb', line 122 def pair_at(pos) if pos == tok.pos + tok.str.size Pair.new(nil, tok) end end |