Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/70c7eb8e3c10f0841521e164507a52aecda1bd03 >--------------------------------------------------------------- commit 70c7eb8e3c10f0841521e164507a52aecda1bd03 Author: Simon Peyton Jones <[email protected]> Date: Wed Aug 3 16:16:50 2011 +0100 Remove all escape handling from quasiquotes; fixes Trac #5348 There is a long discussion in the ticket. >--------------------------------------------------------------- compiler/parser/Lexer.x | 16 ++++++---------- 1 files changed, 6 insertions(+), 10 deletions(-) diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index fd1e1af..3f762aa 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -1427,17 +1427,13 @@ lex_quasiquote s = do case alexGetChar' i of Nothing -> lit_error i - Just ('\\',i) - | Just ('|',i) <- next -> do - setInput i; lex_quasiquote ('|' : s) - | Just (']',i) <- next -> do - setInput i; lex_quasiquote (']' : s) - where next = alexGetChar' i - + -- NB: The string "|]" terminates the quasiquote, + -- with absolutely no escaping. See the extensive + -- discussion on Trac #5348 for why there is no + -- escape handling. Just ('|',i) - | Just (']',i) <- next -> do - setInput i; return s - where next = alexGetChar' i + | Just (']',i) <- alexGetChar' i + -> do { setInput i; return s } Just (c, i) -> do setInput i; lex_quasiquote (c : s) _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
