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 299 def char_length(offset, end_offset) 300 end_offset - offset 301 end
char_offset(char_offset)
click to toggle source
# File lib/puppet/pops/parser/locator.rb 295 def char_offset(char_offset) 296 char_offset 297 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 305 def extract_text(offset, length) 306 string.slice(offset, length) 307 end
offset_on_line(offset)
click to toggle source
# File lib/puppet/pops/parser/locator.rb 290 def offset_on_line(offset) 291 line_offset = line_index[ line_for_offset(offset)-1 ] 292 offset - line_offset 293 end