From 48aec295a856476aa24b3a6f8c18caa77c5fbe37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 16 Oct 2025 14:45:20 +0200 Subject: [PATCH] test/parse_hwdb: wrap Or inside an And in a Group I now get a warning like this with python3-pyparsing-3.1.2-8.fc42: hwdb.d/parse_hwdb.py:208: UserWarning: warn_multiple_tokens_in_named_alternation: setting results name 'VALUE' on Or expression will return a list of all parsed tokens in an And alternative, in prior versions only the first token was returned; enclose contained argument in Group ('!' ^ (Optional('!') - Word(alphanums + '_')))('VALUE') --- hwdb.d/parse_hwdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwdb.d/parse_hwdb.py b/hwdb.d/parse_hwdb.py index 9a599e735c3..768bd064d03 100755 --- a/hwdb.d/parse_hwdb.py +++ b/hwdb.d/parse_hwdb.py @@ -205,7 +205,7 @@ def property_grammar(): for name, val in props] kbd_props = [Regex(r'KEYBOARD_KEY_[0-9a-f]+')('NAME') - Suppress('=') - - ('!' ^ (Optional('!') - Word(alphanums + '_')))('VALUE') + Group('!' ^ (Optional('!') - Word(alphanums + '_')))('VALUE') ] abs_props = [Regex(r'EVDEV_ABS_[0-9a-f]{2}')('NAME') - Suppress('=') - -- 2.47.3