class Cucumber::Ast::Feature

:nodoc:
Represents the root node of a parsed feature.

def accept(visitor)

def accept(visitor)
  return if Cucumber.wants_to_quit
  init
  visitor.visit_comment(@comment) unless @comment.empty?
  visitor.visit_tags(@tags)
  visitor.visit_feature_name(@keyword, indented_name)
  visitor.visit_background(@background) if @background
  @feature_elements.each do |feature_element|
    visitor.visit_feature_element(feature_element)
  end
end

def accept_hook?(hook)

def accept_hook?(hook)
  @tags.accept_hook?(hook)
end

def add_feature_element(feature_element)

def add_feature_element(feature_element)
  @feature_elements << feature_element
end

def backtrace_line(step_name, line)

def backtrace_line(step_name, line)
  "#{file_colon_line(line)}:in `#{step_name}'"
end

def file=(file)

def file=(file)
  file = file.gsub(/\//, '\\') if Cucumber::WINDOWS && file && !ENV['CUCUMBER_FORWARD_SLASH_PATHS']
  @file = file
end

def file_colon_line(line)

def file_colon_line(line)
  "#{@file}:#{line}"
end

def indented_name

def indented_name
  indent = ""
  @name.split("\n").map do |l|
    s = "#{indent}#{l}"
    indent = "  "
    s
  end.join("\n")
end

def init

def init
  @background.feature = self if @background
  @background.init if @background
  @feature_elements.each do |feature_element|
    feature_element.init
    feature_element.feature = self
  end
end

def initialize(background, comment, tags, keyword, name, feature_elements)

def initialize(background, comment, tags, keyword, name, feature_elements)
  @background, @comment, @tags, @keyword, @name, @feature_elements = background, comment, tags, keyword, name.strip, feature_elements
end

def next_feature_element(feature_element, &proc)

def next_feature_element(feature_element, &proc)
  init
  index = @feature_elements.index(feature_element)
  next_one = @feature_elements[index+1]
  proc.call(next_one) if next_one
end

def short_name

def short_name
  first_line = name.split(/\n/)[0]
  if first_line =~ /#{language.keywords('feature', true)}:(.*)/
    $1.strip
  else
    first_line
  end
end

def source_tag_names

def source_tag_names
  @tags.tag_names
end

def tag_locations(tag)

def tag_locations(tag)
  init
  @feature_elements.select{|feature_element| feature_element.tagged_with?(tag)}
end

def to_sexp

def to_sexp
  init
  sexp = [:feature, @file, @name]
  comment = @comment.to_sexp
  sexp += [comment] if comment
  tags = @tags.to_sexp
  sexp += tags if tags.any?
  sexp += [@background.to_sexp] if @background
  sexp += @feature_elements.map{|fe| fe.to_sexp}
  sexp
end