From 90ba37a1061685a0e084ea3d548156450b57309d Mon Sep 17 00:00:00 2001 From: ross Date: Wed, 29 Oct 2003 17:58:16 +0000 Subject: [PATCH] [project @ 2003-10-29 17:58:16 by ross] don't recognise (| or (# if followed by a symbol character, e.g. (||) good for STABLE, I hope --- ghc/compiler/parser/Lexer.x | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/parser/Lexer.x b/ghc/compiler/parser/Lexer.x index 52fc03e..97dbd77 100644 --- a/ghc/compiler/parser/Lexer.x +++ b/ghc/compiler/parser/Lexer.x @@ -204,7 +204,8 @@ $white_no_nl+ ; } <0,glaexts> { - "(|" / { ifExtension arrowsEnabled } { special IToparenbar } + "(|" / { ifExtension arrowsEnabled `alexAndPred` notFollowedBySymbol } + { special IToparenbar } "|)" / { ifExtension arrowsEnabled } { special ITcparenbar } } @@ -214,7 +215,7 @@ $white_no_nl+ ; } { - "(#" { token IToubxparen } + "(#" / { notFollowedBySymbol } { token IToubxparen } "#)" { token ITcubxparen } "{|" { token ITocurlybar } "|}" { token ITccurlybar } @@ -581,6 +582,9 @@ pop_and act loc end buf len = do popLexState; act loc end buf len notFollowedBy char _ _ _ (_,buf) = atEnd buf || currentChar buf /= char +notFollowedBySymbol _ _ _ (_,buf) + = atEnd buf || currentChar buf `notElem` "!#$%&*+./<=>?@\\^|-~" + ifExtension pred bits _ _ _ = pred bits {- -- 1.7.10.4