def _parsed_document(content, file_path)
      if file_path.nil? && content.nil?
        raise LoadError.new(nil, file_path, "Don't know what to do with nil values for both content and path")
      end

      content = if !file_path.nil? && content.nil?
                  File.read(file_path)
                else
                  content
                end

      parsed_document = parsed_documents[file_path]
      return parsed_document unless parsed_document.nil?

      parser = Parser.new(file_path: file_path)
      document = parser.parse(content)

      parser.dependency_paths.each do |path|
        new_path = _find_file!(path, file_path)
        next if new_path.nil?

        document.sub_documents << _parsed_document(nil, new_path)
      end

      document
    end
def _parsed_document(content, file_path)
      if file_path.nil? && content.nil?
        raise LoadError.new(nil, file_path, "Don't know what to do with nil values for both content and path")
      end

      content = if !file_path.nil? && content.nil?
                  File.read(file_path)
                else
                  content
                end

      parsed_document = parsed_documents[file_path]
      return parsed_document unless parsed_document.nil?

      parser = Parser.new(file_path: file_path)
      document = parser.parse(content)

      parser.dependency_paths.each do |path|
        new_path = _find_file!(path, file_path)
        next if new_path.nil?

        document.sub_documents << _parsed_document(nil, new_path)
      end

      document
    end
@param [String] content  source code of the template
 @param [String] file_path  reference path to template file

 @return [Bade::AST::Document]