I would like to add my new language to Haskell using the Quasiquotes, but the language itself uses |] as a keyword.
Is there some way, how to:
a) Escape |], so it is passed to my language
b) Let the parser of my language decide, when the quasiquotation ends itself
Thanks.
Short answer: slightly modify the embedded language.
The User's Guide on QuasiQuoters explains that no escaping can done for the
|]:Your parser can not decide when the quasiquoters ends, because the substring is passed to the quasiquoter that started after the
[quasiquoter|…part and before the…|]part.You thus should slightly alter your language and thus for example work with a pre-processor that translate
|~](which is not considered the end of the quasiquoted string) to|]instead.