|
1 | 1 | {-# LANGUAGE ConstraintKinds #-}
|
2 | 2 | {-# LANGUAGE DataKinds #-}
|
3 | 3 | {-# LANGUAGE DeriveGeneric #-}
|
4 |
| -{-# LANGUAGE MultiWayIf #-} |
5 | 4 | {-# LANGUAGE NamedFieldPuns #-}
|
6 | 5 | {-# LANGUAGE RecordWildCards #-}
|
7 | 6 | {-# LANGUAGE ScopedTypeVariables #-}
|
@@ -322,19 +321,18 @@ parseProjectSkeleton cacheDir httpTransport verbosity importsBy dupesMap project
|
322 | 321 | mapM_ (debug verbosity) seenImports
|
323 | 322 | debug verbosity "\n"
|
324 | 323 |
|
325 |
| - if |
326 |
| - | isCyclicConfigPath normLocPath -> |
327 |
| - pure . projectParseFail Nothing (Just normSource) $ ParseUtils.FromString (render $ cyclicalImportMsg normLocPath) Nothing |
328 |
| - | otherwise -> do |
329 |
| - when |
330 |
| - (isUntrimmedUriConfigPath importLocPath) |
331 |
| - (noticeDoc verbosity $ untrimmedUriImportMsg (Disp.text "Warning:") importLocPath) |
332 |
| - let fs = (\z -> CondNode z [normLocPath] mempty) <$> fieldsToConfig normSource (reverse acc) |
333 |
| - let uniqueFields = if uniqueImport `elem` seenImports then [] else xs |
334 |
| - atomicModifyIORef' dupesMap $ \dm -> (Map.insertWith (++) uniqueImport [Dupes uniqueImport normLocPath seenImportsBy] dm, ()) |
335 |
| - res <- parseProjectSkeleton cacheDir httpTransport verbosity importsBy dupesMap projectDir importLocPath . ProjectConfigToParse =<< fetchImportConfig normLocPath |
336 |
| - rest <- go [] uniqueFields |
337 |
| - pure . fmap mconcat . sequence $ [projectParse Nothing normSource fs, res, rest] |
| 324 | + if isCyclicConfigPath normLocPath |
| 325 | + then pure . projectParseFail Nothing (Just normSource) $ ParseUtils.FromString (render $ cyclicalImportMsg normLocPath) Nothing |
| 326 | + else do |
| 327 | + when |
| 328 | + (isUntrimmedUriConfigPath importLocPath) |
| 329 | + (noticeDoc verbosity $ untrimmedUriImportMsg (Disp.text "Warning:") importLocPath) |
| 330 | + let fs = (\z -> CondNode z [normLocPath] mempty) <$> fieldsToConfig normSource (reverse acc) |
| 331 | + let uniqueFields = if uniqueImport `elem` seenImports then [] else xs |
| 332 | + atomicModifyIORef' dupesMap $ \dm -> (Map.insertWith (++) uniqueImport [Dupes uniqueImport normLocPath seenImportsBy] dm, ()) |
| 333 | + res <- parseProjectSkeleton cacheDir httpTransport verbosity importsBy dupesMap projectDir importLocPath . ProjectConfigToParse =<< fetchImportConfig normLocPath |
| 334 | + rest <- go [] uniqueFields |
| 335 | + pure . fmap mconcat . sequence $ [projectParse Nothing normSource fs, res, rest] |
338 | 336 | (ParseUtils.Section l "if" p xs') -> do
|
339 | 337 | normSource <- canonicalizeConfigPath projectDir source
|
340 | 338 | subpcs <- go [] xs'
|
|
0 commit comments