keyval: Fix grammar comment to cover downstream prefix
authorMarkus Armbruster <armbru@redhat.com>
Fri, 18 Feb 2022 14:55:50 +0000 (15:55 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 28 Feb 2022 10:39:35 +0000 (11:39 +0100)
According to the grammar, a key __com.redhat_foo would be parsed as
two key fragments __com and redhat_foo.  It's actually parsed as a
single fragment.  Fix the grammar.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20220218145551.892787-2-armbru@redhat.com>

util/keyval.c

index 904337c8a10e39a1d0fd75df7d037cba1aca6126..0cf2e84dc8d88c74ab3064739959827c4a03c840 100644 (file)
@@ -16,7 +16,9 @@
  *   key-vals     = [ key-val { ',' key-val } [ ',' ] ]
  *   key-val      = key '=' val | help
  *   key          = key-fragment { '.' key-fragment }
- *   key-fragment = / [^=,.]+ /
+ *   key-fragment = qapi-name | index
+ *   qapi-name    = '__' / [a-z0-9.-]+ / '_' / [A-Za-z][A-Za-z0-9_-]* /
+ *   index        = / [0-9]+ /
  *   val          = { / [^,]+ / | ',,' }
  *   help         = 'help' | '?'
  *