overpy
overpy copied to clipboard
Allow f strings
Add f strings so we can make code easier like so:
(mind you the 'print' action is the macro)
rule 'pizza': print('hello {}'}.format('world')
^ hard
rule 'pizza': print(f'hello {'world'}')
^ easy
Zezombye has commented on Discord that it would be difficult to tokenize format strings. As of right now I lack the bandwidth to tackle this issue, but I agree it would be very nice to have.
Maybe using some libraries like Antlr (a bit slow) or GNU Bison (faster), but writing grammars/parsers are painful 💀💀