TableGroup tablegroup_name { table1 table2 table3 }
(s, loc, tok)
| 35 | |
| 36 | |
| 37 | def parse_table_group(s, loc, tok): |
| 38 | ''' |
| 39 | TableGroup tablegroup_name { |
| 40 | table1 |
| 41 | table2 |
| 42 | table3 |
| 43 | } |
| 44 | ''' |
| 45 | init_dict = { |
| 46 | 'name': tok['name'], |
| 47 | 'items': list(tok.get('items', [])) |
| 48 | } |
| 49 | if 'comment_before' in tok: |
| 50 | comment = '\n'.join(c[0] for c in tok['comment_before']) |
| 51 | init_dict['comment'] = comment |
| 52 | if 'note' in tok: |
| 53 | note = tok['note'] |
| 54 | init_dict['note'] = note if isinstance(note, NoteBlueprint) else note[0] |
| 55 | if 'color' in tok: |
| 56 | init_dict['color'] = tok['color'] |
| 57 | return TableGroupBlueprint(**init_dict) |
| 58 | |
| 59 | |
| 60 | table_group.set_parse_action(parse_table_group) |
nothing calls this directly
no test coverage detected