rfcs
rfcs copied to clipboard
Embed string literals in string literals
Moving this from the ponyc repo issues.
We need a RFC that proposes a way to embed string literals inside of string literals. This would allow docstrings to have example code that is full and complete in that the code in the example code have docstrings as would "real" pony code.
You can see an example of the problem as it currently exist here: https://github.com/ponylang/ponyc/pull/615/files
Any solution should maintain LL(1) parsing if at all possible. "Less pretty" solutions that maintain LL(1) are strongly preferred.
We discussed this a bit in Zulip, in which we sort of tentatively decided that the solution here should be to increase the number of quotes to allow embedding other quotes inside.
For example, a six-quote string would work just like a triple-quote, except that it would allow embedding triple-quote literals inside of it.