correct regexp in getSymbolDict
This commit is contained in:
parent
d7adecfa02
commit
19af1cbbbf
1 changed files with 3 additions and 3 deletions
|
@ -63,13 +63,13 @@ def getDocsConfig(lines: list[str]):
|
|||
|
||||
|
||||
def getSymbolDict(lines: list[str]):
|
||||
setRegex = r"^set\s+(?P<variable>\$.+?)\s(?P<value>.+)?"
|
||||
setRegex = r"^(?P<variable>\w+)\=\"(?P<value>[^\"]+)+\" ?"
|
||||
dictionary = {}
|
||||
for line in lines:
|
||||
match = re.match(setRegex, line)
|
||||
if match:
|
||||
if match.group('variable'):
|
||||
dictionary[match.group('variable')] = match.group('value')
|
||||
dictionary['$'+match.group('variable')] = match.group('value')
|
||||
return dict(dictionary)
|
||||
|
||||
|
||||
|
@ -133,4 +133,4 @@ result = []
|
|||
for config in docsList:
|
||||
result = result + [{'category': config.category,
|
||||
'action': config.action, 'keybinding': config.keybinding}]
|
||||
print(json.dumps(result))
|
||||
print(json.dumps(result))
|
Loading…
Add table
Reference in a new issue