So, the other day, someone was asking in chat about how to use multi-line strings in ASH, and I noted yet again that it just can't be done. I can see this being potentially useful to relay scripts that generate large amounts of HTML (think CHIT, Guide).
I got around to looking at what sort of changes I'd need to make, and it dawned upon me that I don't actually know what syntax to use, so I thought I'd .
Some examples of what's done in various languages:
Perl:
(Python is nearly identical but uses the special delimiter """ for this context.)
C:
(second option also shows up in Javascript)
Alternately, a really fancy thing that we could do is extend ASH to have template literals, like in Perl / Ruby / (ES6) Javascript:
but that's a more involved change than I want to make for now.
The easiest options to implement would be the Perl example and the second C example, as those would both be localized changes to Parser.parseString. Thoughts?
I got around to looking at what sort of changes I'd need to make, and it dawned upon me that I don't actually know what syntax to use, so I thought I'd .
Some examples of what's done in various languages:
Perl:
Code:
"this
is
a
multiline string"
C:
Code:
"first"
"multiline string";
"second\
multiline string";
Alternately, a really fancy thing that we could do is extend ASH to have template literals, like in Perl / Ruby / (ES6) Javascript:
Code:
`The ${i+1}th element of the list is:
${arr[i]}`
The easiest options to implement would be the Perl example and the second C example, as those would both be localized changes to Parser.parseString. Thoughts?