Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #739: descriptor.py: fix parsing tr() desc with single leaf TREE
4e8559b descriptor.py: fix parsing tr() desc with single leaf TREE (SomberNight) Pull request description: `tr()` descriptors with a single leaf TREE expression cannot be parsed currently: ```py >>> from hwilib.descriptor import parse_descriptor >>> b = parse_descriptor("tr(a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd,pk(669b8afcec803a0d323e9a17f3ea8e68e8abe5a278020a929adbec52421adbd0))") Traceback (most recent call last): File "/home/user/wspace/HWI/hwilib/descriptor.py", line 437, in _get_func_expr end = s.rindex(")") ValueError: substring not found During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/user/wspace/HWI/hwilib/descriptor.py", line 637, in parse_descriptor return _parse_descriptor(desc, _ParseDescriptorContext.TOP) File "/home/user/wspace/HWI/hwilib/descriptor.py", line 600, in _parse_descriptor subscripts.append(_parse_descriptor(sarg, _ParseDescriptorContext.P2TR)) File "/home/user/wspace/HWI/hwilib/descriptor.py", line 527, in _parse_descriptor func, expr = _get_func_expr(desc) File "/home/user/wspace/HWI/hwilib/descriptor.py", line 440, in _get_func_expr raise ValueError("A matching pair of parentheses cannot be found") ValueError: A matching pair of parentheses cannot be found ``` ACKs for top commit: achow101: ACK 4e8559b Tree-SHA512: cafc92d4c95b89dc209522a735f37edbc4f91c9abe62668d28c97306e36cf48d1c6d059ead1788462ddf657e0eb9e594d3478cb6f0e170f79b1928fc04523dd2
- Loading branch information