class YARD::Tags::ParseDirective

@since 0.8.0
# }
# rb_define_method(rb_cFoo, “method”, method, 0);
# void Init_Foo() {
# @!parse [c]
@example Parsing C code
def object; @parent.object end
# @!parse attr_reader :foo
# This should really be an attribute
@example Declaring a method as an attribute
end
# @!parse extend UserMixin::ClassMethods
# @!parse include UserMixin
# using the UserMixin.included callback.
# includes “UserMixin” and extends “UserMixin::ClassMethods”
class User
@example Documenting dynamic module inclusion
specification list. By default, the code language is “ruby”.
You can specify the language of the code block using the types
behaviour that cannot be recognized by YARD.
location. This directive is useful if a class has dynamic meta-programmed
Parses a block of code as if it were present in the source file at that

def call

def call
  lang = tag.types ? tag.types.first.to_sym :
    (handler ? handler.parser.parser_type : :ruby)
  if handler && lang == handler.parser.parser_type
    pclass = Parser::SourceParser.parser_types[handler.parser.parser_type]
    pobj = pclass.new(tag.text, handler.parser.file)
    pobj.parse
    handler.parser.process(pobj.enumerator)
  else # initialize a new parse chain
    src_parser = Parser::SourceParser.new(lang, handler ? handler.globals : nil)
    src_parser.file = handler.parser.file if handler
    src_parser.parse(StringIO.new(tag.text))
  end
end