// Copyright (C) 2022 KeyBoxen Authors
// SPDX-License-Identifier: GPL-3.0-or-later
// Parsing grammar for assuan replies from pinentry
Response = {Ok | Error | Data | Comment | Status | Enquiry}
msg = !{ (!EOI ~ ANY)+ }
tail = _{" " ~ msg }
numcode = !{ ASCII_DIGIT+ }
keyword = !{ ASCII_ALPHANUMERIC+ }
Ok = { "OK" ~ tail? }
Error = { "ERR " ~ numcode ~ tail? }
Data = { "D" ~ tail }
Comment = { "#" ~ tail? }
Status = { "S " ~ keyword ~ tail? }
Enquiry = { "INQUIRE " ~ keyword ~ tail? }