#5348: Template Haskell quasiquote escapes
---------------------------------+------------------------------------------
Reporter: simonpj | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.0.3
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by simonpj):
Replying to [comment:2 YitzGale]:
> Another alternative: support no escapes, ''without'' asking
> `myparser` to determine where the quotation ends. Just use the
> current closing oxford bracket, without a hard-wired way to
> escape it.
I don't think this is feasible. Suppose we want to support random language
X inside quasiquotes, and X includes string literals. Then we might want
to say
{{{
[xlang| f x = "abc|]def" |]
}}}
With my proposal you'd say
{{{
[xlang| f x = "abc\|]def" |]
}}}
With yours you can't say this at all. You may say that you simply have to
adjust the xlang parser so that X never requires you to have the character
sequence "|]" in the code. So you'd have to say something like
{{{
[xlang| f x = "abc\Cdef" |]
}}}
(Notice that we have to avoid the character sequence "|]") which seems a
little strange. On the other hand, if "|]" isn't relevant in language X,
my proposal has no effect. (Oh, except for backslash itself... that's
true... Maybe "`\\`" should not be an escape sequence... instead "`\\|]`"
should produce a single trailing backslash and close the quote. That'd do
it.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5348#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs