qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

decodetree: Drop check for less than 2 patterns in a group

While it makes little sense for the end product to have a group
containing only a single pattern, avoiding this case within an
incremental patch set is troublesome.

Because this is expected to be a transient condition, do not
bother "optimizing" this case, e.g. by folding away the group.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

+13 -2
-2
scripts/decodetree.py
··· 1024 1024 if name == '}' or name == ']': 1025 1025 if len(toks) != 0: 1026 1026 error(start_lineno, 'extra tokens after close brace') 1027 - if len(parent_pat.pats) < 2: 1028 - error(lineno, 'less than two patterns within braces') 1029 1027 1030 1028 # Make sure { } and [ ] nest properly. 1031 1029 if (name == '}') != isinstance(parent_pat, IncMultiPattern):
+13
tests/decode/succ_pattern_group_nest4.decode
··· 1 + # This work is licensed under the terms of the GNU LGPL, version 2 or later. 2 + # See the COPYING.LIB file in the top-level directory. 3 + 4 + # Verify deeper nesting, and a single element in the groups. 5 + { 6 + [ 7 + { 8 + [ 9 + sub1 00000000 a:8 b:8 c:8 10 + ] 11 + } 12 + ] 13 + }