@return [Boolean] whether the handler handles this statement
# File lib/yard/handlers/c/base.rb, line 9 def self.handles?(statement, processor) processor.globals.cruby_processed_files ||= {} processor.globals.cruby_processed_files[processor.file] = true if statement.respond_to? :declaration src = statement.declaration else src = statement.source end handlers.any? do |a_handler| statement_class >= statement.class && case a_handler when String src == a_handler when Regexp src =~ a_handler end end end
# File lib/yard/handlers/c/base.rb, line 62 def namespace_for_variable(var) return namespaces[var] if namespaces[var] var = remove_var_prefix(var) var.empty? ? nil : P(var) end
# File lib/yard/handlers/c/base.rb, line 68 def namespaces globals.cruby_namespaces ||= {} end
# File lib/yard/handlers/c/base.rb, line 58 def override_comments globals.cruby_override_comments ||= [] end
@group Parsing an Inner Block
# File lib/yard/handlers/c/base.rb, line 78 def parse_block(opts = {}) return if !statement.block || statement.block.empty? push_state(opts) do parser.process(statement.block) end end
@group Processing other files
# File lib/yard/handlers/c/base.rb, line 87 def process_file(file, object) file = File.cleanpath(File.relative_path(statement.file, file)) return if processed_files[file] processed_files[file] = file begin log.debug "Processing embedded call to C source #{file}..." globals.ordered_parser.files.delete(file) if globals.ordered_parser parser.process(Parser::C::CParser.new(File.read(file), file).parse) rescue Errno::ENOENT log.warn "Missing source file `#{file}' when parsing #{object}" end end
# File lib/yard/handlers/c/base.rb, line 72 def processed_files globals.cruby_processed_files ||= {} end
@group Registering objects
# File lib/yard/handlers/c/base.rb, line 36 def register_docstring(object, docstring = nil, stmt = nil) super(object, docstring, stmt) if docstring end
# File lib/yard/handlers/c/base.rb, line 40 def register_file_info(object, file = nil, line = nil, comments = nil) super(object, file, line, comments) if file end
# File lib/yard/handlers/c/base.rb, line 44 def register_source(object, source = nil, type = nil) super(object, source, type) if source end
Generated with the Darkfish Rdoc Generator 2.