def build_print_args(taginfo, attr_info, append_exprs)
return [] if taginfo.tagname.nil?
unless attr_info || append_exprs
return [taginfo.tag_text]
end
args = []
t = taginfo
sb = "#{t.head_space}<#{t.is_etag ? '/' : ''}#{t.tagname}"
attr_info.each do |space, aname, avalue|
sb << "#{space}#{aname}=\""
if avalue.is_a?(NativeExpression)
native_expr = expand_attr_vars_in_native_expr(avalue, attr_info)
args << sb
args << native_expr
sb = ''
else
sb << avalue
end
sb << '"'
end if attr_info
if append_exprs && !append_exprs.empty?
unless sb.empty?
args << sb
sb = ''
end
append_exprs.each do |append_expr|
native_expr = expand_attr_vars_in_native_expr(append_expr, attr_info)
args << native_expr
end
end
sb << "#{t.extra_space}#{t.is_empty ? '/' : ''}>#{t.tail_space}"
args << sb
return args
end