X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fparser%2FLexer.x;h=c6457a4e5f604d9ca108b693e84edb507371b8b2;hp=43ddf7c4c55e9f483c66733d80795a7a86cc916d;hb=fc5cd848af22c97dfde1953b9efcfc60e6ccf2bb;hpb=d8b99b7e9b2ce9fd8ba97fa10657082ceac09c59 diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 43ddf7c..c6457a4 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -2002,9 +2002,9 @@ alternativeLayoutRuleToken t return (L thisLoc ITocurly) | otherwise -> do setAlrExpectingOCurly Nothing - setPendingImplicitTokens [L thisLoc ITccurly] + setPendingImplicitTokens [L lastLoc ITccurly] setNextToken t - return (L thisLoc ITocurly) + return (L lastLoc ITocurly) (_, _, Just expectingOCurly) -> do setAlrExpectingOCurly Nothing setALRContext (ALRLayout expectingOCurly thisCol : context) @@ -2100,6 +2100,10 @@ isNonDecreasingIntentation _ = False containsCommas :: Token -> Bool containsCommas IToparen = True containsCommas ITobrack = True +-- John doesn't have {} as containing commas, but records contain them, +-- which caused a problem parsing Cabal's Distribution.Simple.InstallDirs +-- (defaultInstallDirs). +containsCommas ITocurly = True -- GHC Extensions: containsCommas IToubxparen = True containsCommas _ = False