From e5ee3da3996549f059e21006accf5e47ae162024 Mon Sep 17 00:00:00 2001 From: Schell Scivally Date: Tue, 12 Nov 2013 16:10:25 -0800 Subject: [PATCH] CPP corrections. --- Language/Haskell/GhcMod/.ErrMsg.hs.swp | Bin 0 -> 12288 bytes Language/Haskell/GhcMod/ErrMsg.hs | 14 ++++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 Language/Haskell/GhcMod/.ErrMsg.hs.swp diff --git a/Language/Haskell/GhcMod/.ErrMsg.hs.swp b/Language/Haskell/GhcMod/.ErrMsg.hs.swp new file mode 100644 index 0000000000000000000000000000000000000000..9ceabbc02decdd51cd75f6d57cccae51eb84e8b9 GIT binary patch literal 12288 zcmeHNOK%)S5bi)A;SsQs6A6NfZ7I9T?${(qK}#I)E4IZtHd#AFvaMx2+p{|`J2RQ? zjcwt86k&0Qa^ZwPL5N2#Z~<{c;u81^yu{-`4u}H>g5Uy(ujjS9jvs*pAz;S(G@j|I z>Z-4*tJ}%U_nsIVr$gF<3|9wZ-IvZDKX+yKmUB-rCX5=lZ8fm*HLe?$BVAF`Y}e4& zS9mrw*fZ!>cu%!vHyChF;}8qq=w+)AfwhjB&gl_Wf~D)oNnnxzo{4V zhhT1s0-BHRTUOnp$MlvmkTQ@mkTQ@mkTQ@mkTQ@mkTQ@mkTQ@mkTUQuWI(Sl_9Xt; z-+D8g$N&GwfB%1VH)CG{?*kWsmw*?5Gr%%%3OE4_0SACiU?;E*_~kCfJ_J^P$AL$H zdx1T`7dsgH9QXiu6}SM*0y97d@Xei!eF|Iv&H_^a0YBcs*!RFC;AP+punas56oB7u zXY4ZY5wHS05A*>)-Nx7z;6317;6>mha1YP{{Jfp9&wz`-Yk&#t1MUNU-NxA0z&pTO zz?;Auz)7G3*baPmD`TGkZv&@+B5*(O!!6(rm;+{kJ-}|@+pUb92UY+b7yxzwm%;ye zUwoRGE!lKBkw|%ro1&nPb zv95toaWnPS$rlB?N_^j}voCO|k8A;l_wR4>cMX-9Ib}p$eKa%2h!$$x=ShrEXGs)6S`eZd<0sE0g$~CbFT#VSY0Lo8+$H zY^EhX5%9gC_*JpBPhKccN&1#krTmfTw`+@kM$G-S@MBgn^U#uW6x0eecRRbvnITZy zbc*G#^Frf_E}zSW?@%|Hmd#apbQU_*O?gH(vb_48;o7aQ_-XE2a%oWaq~$t^S({4| z?PDm75#7_2;nJ!RNG6(rABXegxPBc)BRC!IJ`!kFxh(m{QRS!bnp0(zmpQnVE9c5t zf~uM(6fSwXlL&i0H?2juVft=;Twj_;C2~`5*m5!)>86Ss`LRr{MBOi_`PaJosB@@M zuP+sP@za?oRa{TfgeS{GJ83q)-bku7_}y*@Eh#it%s> zdY)Q<2wgE7nY6{DYpzA;!CVwE(y8p@rg{Ji?Wkh+jesCkSW!ms>z^t_*2SHQWrhUs zMY&cC86JEuH@ql)eatak!gDs%2;B_FOEuS*s?PBkj;c`msK)gQMK+YXBGHd&84m0x zjHq!Hd_ot3g9!RmE3JwSI1Dx-_085`B-UJoT^w}&oslCBWIRX_epNI5(-B)HmCGZ= z{?f?A6XntV(qqHLV!2F5`sh&aA$9}W65<@tt5YueaM2R7nXx{q>mFs2Y{jX}l7<}z zO$ZBBqj{yP6xnJ+n`IZX(r{Qu$nZ?K56p#qGU}0KY#7)6^EPuXB6I zH}?m82Wy#2V-v@@37$>L*oA2Aq8wG1-)lG5nr}p{35_OdT|~O)p+^+mYM@^ZB)}Gx zl|&e9T-Y!PpP#y%5Fcj=ATw96cfwe04Y07V4BY;5!7UV~{y79!bWrP_1AU|jOs>5-jI4X?5cXAq6E(|#p a)BPjEG=LB7kw3|ON91U5a+138XV@QS5Opd5 literal 0 HcmV?d00001 diff --git a/Language/Haskell/GhcMod/ErrMsg.hs b/Language/Haskell/GhcMod/ErrMsg.hs index 0755749..83c626f 100644 --- a/Language/Haskell/GhcMod/ErrMsg.hs +++ b/Language/Haskell/GhcMod/ErrMsg.hs @@ -52,16 +52,22 @@ errBagToStrList dflag ls = map (ppErrMsg dflag ls) . reverse . bagToList ---------------------------------------------------------------- +#if __GLASGOW_HASKELL__ >= 707 ppErrMsg :: DynFlags -> LineSeparator -> ErrMsg -> String ppErrMsg dflag ls err = ppMsg spn SevError dflag ls msg ++ ext where -#if __GLASGOW_HASKELL__ >= 707 spn = errMsgSpan err -#else - spn = head (errMsgSpans err) -#endif msg = errMsgShortDoc err ext = showMsg dflag ls (errMsgExtraInfo err) +#else +ppErrMsg :: DynFlags -> LineSeparator -> ErrMsg -> String +ppErrMsg dflag ls err = ppMsg spn SevError dflag ls msg ++ ext + where + spn = head (errMsgSpans err) + msg = errMsgShortDoc err + ext = showMsg dflag ls (errMsgExtraInfo err) +#endif + ppMsg :: SrcSpan -> Severity-> DynFlags -> LineSeparator -> SDoc -> String ppMsg spn sev dflag ls@(LineSeparator lsep) msg = prefix ++ cts ++ lsep