Class: PryCoolline::ParenMatch::Token

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

Overview

A Token is a short chunk of code. This tokenizer only distinguishes three kinds of token:

  1. Tokens that open a pair (OpenToken)
  2. Tokens that close a pair (CloseToken)
  3. The rest of the code (StrToken)

Instance Attribute Summary collapse

Instance Attribute Details

#code_posInteger

Position in the initial code, character-wise, including ANSI codes.

Returns:

  • (Integer)

    the current value of code_pos



24
25
26
# File 'lib/pry-coolline/paren_match.rb', line 24

def code_pos
  @code_pos
end

#posInteger

Position in the initial code, character-wise, disregarding ANSI codes.

Returns:

  • (Integer)

    the current value of pos



24
25
26
# File 'lib/pry-coolline/paren_match.rb', line 24

def pos
  @pos
end

#strString

String covered by the token

Returns:

  • (String)

    the current value of str



24
25
26
# File 'lib/pry-coolline/paren_match.rb', line 24

def str
  @str
end