I'm developing a templating language, and now I'm trying to decide on what I should do with quotes. I'm thinking about having 3 different types of quotes which are all handled differently:
backtick ` double quote " single quote ' expand variables ? yes no escape sequences no yes ? escape html no yes yes
$var) so I'm thinking that might mess with jQuery pretty bad... but if I disable variable expansion w/ backticks then, I'm not sure how would insert a variable into a JS code block?
Not sure if escape sequences like
\n should be treated as literals or converted. I find it pretty rare that I want to disable escape sequences, but if you do, you could use backticks. So I'm leaning towards "yes" for this one, but that would be contrary to how PHP does it.
Pretty certain I want everything enabled for this one.
I'm also thinking about adding modifiers like
r in front of the string that would change some of these options to enable a few more combinations. I would need 9 different quotes or 3 quotes and 2 modifiers to get every combination wouldn't I?
My language also supports "filters" which can be applied against any "term" (number, variable, string) so you could always write something like
"blah blah $var blah"|expandvars
Thoughts? What would you prefer? What would be least confusing/most intuitive?