dfithian / prune-juice

Prune unused Haskell dependencies.
MIT License
48 stars 4 forks source link

Parse error on import {-# SOURCE #-} #2

Closed nxths closed 3 years ago

nxths commented 3 years ago
Using build system Stack
prune-juice.exe: user error (Failed to parse imports due to ParseErrorBundle {bundleErrors = Tri
vialError 7 (Just (Tokens ('{' :| ""))) (fromList [Tokens ('"' :| ""),Tokens ('(' :| ""),Tokens
('q' :| "ualified"),Label ('a' :| "lphanumeric character"),Label ('w' :| "hite space")]) :| [],
bundlePosState = PosState {pstateInput = "import {-# SOURCE #-} Msg.Payload", pstateOffset = 0,
pstateSourcePos = SourcePos {sourceName = "./src/AppEnv/Types.hs", sourceLine = Pos 1, sourceCol
umn = Pos 1}, pstateTabWidth = Pos 8, pstateLinePrefix = ""}})

Seeing the above error running prune-juice.exe on a stack based project in WSL on Windows 10. Looks like it doesn't handle importing .hs-boot files?

dfithian commented 3 years ago

@nxths does this fix your issue? https://github.com/dfithian/prune-juice/pull/3

nxths commented 3 years ago

@dfithian thanks just tested with that commit, there's no longer a parse error

dfithian commented 3 years ago

Woo!