class Kalculator::Parser::Environment

code taken from spiff-rb

Public Instance Methods

metadata(first_token = nil, last_token = nil) click to toggle source
# File lib/kalculator/parser.rb, line 6
def metadata(first_token = nil, last_token = nil)
  first_token ||= @positions.first
  last_token  ||= @positions.last
  begins_at = first_token.stream_offset
  ends_at   = last_token.stream_offset + last_token.length - 1
  {
    offset: begins_at..ends_at,
  }
end