Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed string literals in string literals #52

Open
SeanTAllen opened this issue Oct 22, 2016 · 1 comment
Open

Embed string literals in string literals #52

SeanTAllen opened this issue Oct 22, 2016 · 1 comment

Comments

@SeanTAllen
Copy link
Member

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.

@jemc
Copy link
Member

jemc commented Apr 2, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants