File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -105,12 +105,12 @@ optSkipToNextLine i = do
105
105
peekChar >>= \ case
106
106
Just c
107
107
| isEndOfLine c ->
108
- endOfLine * > indent i $> ()
108
+ endOfLine > > indent i $> ()
109
109
_ -> pure ()
110
110
111
111
-- | Comma or space separated list, with optional new lines.
112
112
parseList :: Indent -> Parser [Text ]
113
- parseList i = sepBy parseString (optSkipToNextLine i *> skipMany (char ' ,' ) *> optSkipToNextLine i)
113
+ parseList i = sepBy parseString (optSkipToNextLine i >> skipMany (char ' ,' ) >> optSkipToNextLine i) <|> pure []
114
114
115
115
pathMain :: Indent -> [Text ] -> Text -> [Text ] -> [Text ] -> Parser [Text ]
116
116
pathMain i p m o a =
Original file line number Diff line number Diff line change @@ -116,6 +116,14 @@ spec = do
116
116
Comp Exe " gen-hie" " app/Hie/Executable/Helper.hs" ,
117
117
Comp Exe " gen-hie" " app/Hie/Executable/Utils.hs"
118
118
]
119
+ describe " Should Succeed" $
120
+ it " succesfully parses single other-modules" $
121
+ (" other-modules: test\n default-language: Haskell2011" :: Text ) ~?> field 0 " other-modules" parseList
122
+ `leavesUnconsumed` " default-language: Haskell2011"
123
+ describe " Should Succeed" $
124
+ it " succesfully parses empty other-modules" $
125
+ (" other-modules: test\n default-language: Haskell2011" :: Text ) ~?> field 0 " other-modules" parseList
126
+ `leavesUnconsumed` " default-language: Haskell2011"
119
127
120
128
exeSection :: Text
121
129
exeSection =
You can’t perform that action at this time.
0 commit comments