Class: Rley::Lexical::Position

Inherits:
Struct
  • Object
show all
Defined in:
lib/rley/lexical/token.rb

Overview

A Position is the location of a lexeme within a source file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#columnObject

Returns the value of attribute column

Returns:

  • (Object)

    the current value of column



8
9
10
# File 'lib/rley/lexical/token.rb', line 8

def column
  @column
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



8
9
10
# File 'lib/rley/lexical/token.rb', line 8

def line
  @line
end

Instance Method Details

#to_sObject



9
10
11
# File 'lib/rley/lexical/token.rb', line 9

def to_s
  "line #{line}, column #{column}"
end