diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-11-27 06:00:11 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-11-27 06:02:44 +0900 |
commit | 315a3c9ff42afe8326ea34af3b2e8c720acc6658 (patch) | |
tree | ca19c98ec4c1bbcdf649c5147a6981048ff76b87 | |
parent | e77fed207a41a77f88853a89a8408fbfa9a17ddd (diff) | |
download | systemd-315a3c9ff42afe8326ea34af3b2e8c720acc6658.tar.gz |
hwdb: add missing Group()
This fixes the following warning:
```
parse_hwdb.py:120: UserWarning: warn_ungrouped_named_tokens_in_collection: setting results name 'SETTINGS*' on And expression collides with 'HZ' on contained expression
dpi_setting = (Optional('*')('DEFAULT') + INTEGER('DPI') + Suppress('@') + INTEGER('HZ'))('SETTINGS*')
```
Not sure about for the mount_matrix, but LGTM.com warns in that line,
and, adding Group() does not change the parse result.
-rwxr-xr-x | hwdb.d/parse_hwdb.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hwdb.d/parse_hwdb.py b/hwdb.d/parse_hwdb.py index 52f881623c..d1ff4470de 100755 --- a/hwdb.d/parse_hwdb.py +++ b/hwdb.d/parse_hwdb.py @@ -117,9 +117,9 @@ def hwdb_grammar(): def property_grammar(): ParserElement.setDefaultWhitespaceChars(' ') - dpi_setting = (Optional('*')('DEFAULT') + INTEGER('DPI') + Suppress('@') + INTEGER('HZ'))('SETTINGS*') + dpi_setting = Group(Optional('*')('DEFAULT') + INTEGER('DPI') + Suppress('@') + INTEGER('HZ'))('SETTINGS*') mount_matrix_row = SIGNED_REAL + ',' + SIGNED_REAL + ',' + SIGNED_REAL - mount_matrix = (mount_matrix_row + ';' + mount_matrix_row + ';' + mount_matrix_row)('MOUNT_MATRIX') + mount_matrix = Group(mount_matrix_row + ';' + mount_matrix_row + ';' + mount_matrix_row)('MOUNT_MATRIX') xkb_setting = Optional(Word(alphanums + '+-/@._')) props = (('MOUSE_DPI', Group(OneOrMore(dpi_setting))), |