class Puppet::Pops::Parser::Locator::LocatorForChars
Public Instance Methods
char_length(offset, end_offset)
click to toggle source
# File lib/puppet/pops/parser/locator.rb 300 def char_length(offset, end_offset) 301 end_offset - offset 302 end
char_offset(char_offset)
click to toggle source
# File lib/puppet/pops/parser/locator.rb 296 def char_offset(char_offset) 297 char_offset 298 end
extract_text(offset, length)
click to toggle source
Extracts the text from char offset with given byte length @returns String - the extracted text
# File lib/puppet/pops/parser/locator.rb 306 def extract_text(offset, length) 307 string.slice(offset, length) 308 end
offset_on_line(offset)
click to toggle source
# File lib/puppet/pops/parser/locator.rb 291 def offset_on_line(offset) 292 line_offset = line_index[ line_for_offset(offset)-1 ] 293 offset - line_offset 294 end