nvda-voicemeeter/src/nvda_voicemeeter/parser.py
onyx-and-iris 10e99c5f78 adds a single menu to restart audio engine
keep track of focus, fixes bug when exiting contex menu
2023-08-26 19:46:39 +01:00

16 lines
617 B
Python

from pyparsing import Group, OneOrMore, Optional, Suppress, Word, alphanums, restOfLine
class Parser:
def __init__(self):
self.widget = Group(OneOrMore(Word(alphanums)))
self.widget_token = Suppress("||")
self.identifier = Group(OneOrMore(Word(alphanums)))
self.event = Group(OneOrMore(Word(alphanums)))
self.menu_token = Suppress("::")
self.match = (
self.widget + self.widget_token + self.identifier + Optional(self.widget_token) + Optional(self.event)
| self.identifier + self.menu_token + self.event
| restOfLine
)