- ASTNode =
Parser::AST::Node
- AST =
ROM::Types.Constructor(ASTNode) do |doc|
case doc
when ASTNode
doc
when String
Parser::CurrentRuby.parse(doc)
when Pathname
Parser::CurrentRuby.parse(doc.read)
else
raise ArgumentError, "Cannot convert #{doc.inspect} to Ruby AST"
end
end
Types::Array.of(Parser::Source::Comment)
ROM::Types.Constructor(Array) do |doc|
case doc
when Array
doc
when String
Parser::CurrentRuby.(doc)
when Pathname
Parser::CurrentRuby.(doc.to_s)
else
raise ArgumentError, "Cannot convert #{doc.inspect} to Ruby AST"
end
end