Added samples and prefixes to variables

This commit is contained in:
2023-03-05 18:45:14 +02:00
parent ea0e9ae0cd
commit 323b41b36e
4 changed files with 52 additions and 7 deletions

View File

@ -337,8 +337,15 @@ class ZiffersTransformer(Transformer):
return items[0].value
def variable(self, items):
if len(items)>1:
prefixes = sum_dict(items[0:-1])
text_prefix = prefixes.pop("text")
return Variable(name=items[-1], text=text_prefix+items[-1], local_options=prefixes)
return Variable(name=items[0], text=items[0])
def variable_char(self, items):
"""Return parsed variable name"""
return Variable(name=items[0].value, text=items[0].value)
return items[0].value #Variable(name=items[0].value, text=items[0].value)
def variablelist(self, items):
"""Return list of variables"""