# SPDX-FileCopyrightText: Chris Pressey, the creator of this work, has dedicated it to the public domain.
# For more information, please refer to <https://unlicense.org/>
# SPDX-License-Identifier: Unlicense
main = line & {"\n" & line} & 'ok'.
line = field → F & {"," & field → G & F ← fields(G, F)} & F.
field = strings | bare.
strings = string → T & {string → S & T ← T + '"' + S} & T.
string = "\"" & T ← '' & {!"\"" & any → S & T ← T + S} & "\"" & T.
bare = T ← '' & {!(","|"\n") & any → S & T ← T + S} & T.