Lines Matching refs:entries
206 local function column(entries, get_width_before, colname)
214 for _, entry in ipairs(entries) do
241 -- The entries are nicely aligned, therefore there is no need to change
243 local entries = {
247 assert_equals(entries[2].category_col, 8)
248 assert_equals(width_before_category(entries[2]), 7)
249 assert_equals(column(entries, width_before_category, "category_col"), 8)
251 -- The entries are currently not aligned, therefore they are aligned
253 entries = {
257 assert_equals(entries[2].category_col, 24)
258 assert_equals(column(entries, width_before_category, "category_col"), 24)
260 -- The entries are already aligned, therefore the current alignment is
263 entries = {
267 assert_equals(column(entries, width_before_category, "category_col"), 24)
271 entries = {
276 assert_equals(column(entries, width_before_flags, "flags_col"), 32)
281 -- Amend the entries by the tabs used for alignment.
282 local function add_tabs(entries)
294 column(entries, width_before_category, "category_col")
295 local flags_col = column(entries, width_before_flags, "flags_col")
304 for _, entry in ipairs(entries) do
320 local entries = {
325 add_tabs(entries)
326 assert_equals(entries[1].category_tabs, "\t\t\t\t\t\t\t")
327 assert_equals(entries[2].category_tabs, "\t\t\t\t\t\t\t")
328 assert_equals(entries[3].category_tabs, "\t\t\t\t\t\t\t")
329 assert_equals(entries[1].flags_tabs, "\t\t")
330 assert_equals(entries[2].flags_tabs, "\t\t")
331 assert_equals(entries[3].flags_tabs, "\t\t")
335 -- Normalize the alignment of the fields of the entries.
336 local function normalize(entries)
354 table.sort(entries, less)
359 foreach_group(entries, by_dirname, add_tabs)
367 local entries = {}
377 table.insert(entries, entry)
388 return head, entries, errors
396 local function write_list(fname, head, entries)
404 for _, entry in ipairs(entries) do
427 local head, entries, errors = read_list(fname)
435 normalize(entries)
438 write_list(fname, head, entries)