def self.parse_col_specs(records)
specs = []
if m = records.match(REGEXP[:digits])
1.upto(m[0].to_i) {
specs << {'width' => 1}
}
return specs
end
records.split(',').each {|record|
if m = record.match(REGEXP[:table_colspec])
spec = {}
if m[2]
colspec, rowspec = m[2].split '.'
if !colspec.to_s.empty? && Table::ALIGNMENTS[:h].has_key?(colspec)
spec['halign'] = Table::ALIGNMENTS[:h][colspec]
end
if !rowspec.to_s.empty? && Table::ALIGNMENTS[:v].has_key?(rowspec)
spec['valign'] = Table::ALIGNMENTS[:v][rowspec]
end
end
spec['width'] = !m[3].nil? ? m[3].to_i : 1
if m[4] && Table::TEXT_STYLES.has_key?(m[4])
spec['style'] = Table::TEXT_STYLES[m[4]]
end
repeat = !m[1].nil? ? m[1].to_i : 1
1.upto(repeat) {
specs << spec.dup
}
end
}
specs
end