# File lib/parslet/atoms/str.rb, line 20
  def try(source, context, consume_all)
    return succ(source.consume(@len)) if source.matches?(str)
    
    # Input ending early:
    return context.err(self, source, @error_msgs[:premature]) \
      if source.chars_left<@len
    
    # Expected something, but got something else instead:  
    error_pos = source.pos  
    return context.err_at(
      self, source, 
      [@error_msgs[:failed], source.consume(@len)], error_pos) 
  end