Investigate addition of macros #6
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Macros are a useful tool for reducing duplication and increasing legibility in code.
Proper Suzu macros would be scoped, likely using an ItemType to store the list of tokens in the macro.
Ideally, macros would also be grammatically incomplete, allowing for integration into broader expressions.
It is likely that macros would require inserting tokens into the parser before reading from the tokenizer.
Additionally, collection of tokens would need to not involve the standard parser.
For single line statements, this could be done by reading tokens until a semicolon is reached; however, this would not work for multi-statement macros such as blocks.
Perhaps the macro expression could track open and close braces, ending in a semicolon once braces are paired.