Skip to content

Instantly share code, notes, and snippets.

@tompng
Created August 30, 2025 05:16
Show Gist options
  • Save tompng/372a2d476c97cb6c20c1ca6d137ab8a4 to your computer and use it in GitHub Desktop.
Save tompng/372a2d476c97cb6c20c1ca6d137ab8a4 to your computer and use it in GitHub Desktop.
module YARD
class Parser; end
class TagHandler; end
class ParseResult; end
def self.process(comment, code_object)
result = Parser.parse(comment)
tag_handler = TagHandler.new(code_object)
result.tags.each do |name, arg|
tag_handler.handle(name, arg)
end
result.text
end
end
module YARD
def self.process(comment, code_object)
tags, tag_removed_text = Parser.parse(comment)
if result.tags[:api]
process_api_tag(result.tags[:api], code_object)
end
if result.tags[:private]
process_private_tag(result.tags[:private], code_object)
end
if result.tags[:yield]
process_yield(result.tags[:yield], code_object)
end
tag_removed_text
end
def self.parse(comment)
end
def self.process_api_tag(arg, code_object)
end
def self.process_private_tag(arg, code_object)
end
def self.process_yield(arg, code_object)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment