X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fparser%2FLexer.x;h=6651333dc4b709821e6a2163afcfd534ba0c295d;hp=51aa2f397f1f01fa99544604f2a4dd8c7e60fbd7;hb=26f164e5759e9eca73deb0531ddec422d36a6924;hpb=fa306a37eaae1020f4cbd6cbed04847db6c23273 diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 51aa2f3..6651333 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -307,7 +307,7 @@ $tab+ { warn Opt_WarnTabs (text "Tab character") } \$ @varid / { ifExtension thEnabled } { skip_one_varid ITidEscape } "$(" / { ifExtension thEnabled } { token ITparenEscape } - "[$" @varid "|" / { ifExtension qqEnabled } + "[" @varid "|" / { ifExtension qqEnabled } { lex_quasiquote_tok } } @@ -1412,8 +1412,9 @@ getCharOrFail i = do lex_quasiquote_tok :: Action lex_quasiquote_tok span buf len = do - let quoter = reverse $ takeWhile (/= '$') - $ reverse $ lexemeToString buf (len - 1) + let quoter = tail (lexemeToString buf (len - 1)) + -- 'tail' drops the initial '[', + -- while the -1 drops the trailing '|' quoteStart <- getSrcLoc quote <- lex_quasiquote "" end <- getSrcLoc