overpy icon indicating copy to clipboard operation
overpy copied to clipboard

Allow f strings

Open TheBlueMoonEclipse opened this issue 1 year ago • 2 comments

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

TheBlueMoonEclipse avatar Jan 30 '24 11:01 TheBlueMoonEclipse

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.

CactusPuppy avatar Feb 04 '24 23:02 CactusPuppy

Maybe using some libraries like Antlr (a bit slow) or GNU Bison (faster), but writing grammars/parsers are painful 💀💀

nathan130200 avatar Feb 26 '24 21:02 nathan130200