TableRowBuilder.swift.gyb 918 B

1234567891011121314151617181920212223242526272829
  1. // This file was generated using gyb. Do not edit it directly. Edit
  2. // TableRowBuilder.swift.gyb instead.
  3. // swiftformat:options --allow-partial-wrapping true
  4. %{
  5. maximum_column_count = 20
  6. }%
  7. /// A result builder for constructing a collection of table columns.
  8. @resultBuilder
  9. public struct TableRowBuilder<RowValue> {
  10. public static func buildBlock() -> EmptyTableRowContent<RowValue> {
  11. EmptyTableRowContent<RowValue>()
  12. }
  13. %for i in range(1, maximum_column_count + 1):
  14. public static func buildBlock<
  15. ${", ".join("Content%d: View" % j for j in range(i))}
  16. >(
  17. ${", ".join("_ column%d: TableColumn<RowValue, Content%d>" % (j, j) for j in range(i))}
  18. ) -> TupleTableRowContent${i}<
  19. RowValue, ${", ".join("Content%d" % j for j in range(i))}
  20. > {
  21. TupleTableRowContent${i}(
  22. ${", ".join("column%d" % j for j in range(i))}
  23. )
  24. }
  25. %end
  26. }