You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hindent changes the meaning of the formatted code, which would make unattended formatting rather dangerous.
I checked the issue tracker for existing issues about this problem.
I'm using the latest version of hindent.
$ cat test.hs
{-# LANGUAGE CPP #-}
main = print (g && f1)
where
f1 = h
where
h = True
#ifdef C1
g = g1
where
g1 = g2
where
g2 = False
#else
g = True
#endif
#ifndef C1
g = False
#endif
$ runhaskell test.hs
True
$ hindent --version
hindent 5.2.7
$ hindent test.hs
$ runhaskell test.hs
False
Actual output haskell
{-# LANGUAGE CPP #-}
main =print (g && f1)
where
f1 = h
where
h =True#ifdef C1
g = g1
where
g1 = g2
where
g2 =False#else
g =True#endif#ifndef C1
g =False#endif
Perhaps there should be a way to disable parsing of CPP directives to reject this program.
The text was updated successfully, but these errors were encountered:
Problem
hindent
changes the meaning of the formatted code, which would make unattended formatting rather dangerous.Actual output haskell
Perhaps there should be a way to disable parsing of CPP directives to reject this program.
The text was updated successfully, but these errors were encountered: