on master help sign in
Merge pull request #2674 from jfdm/fix-ipkg-parsing-mistake
8e8fd65Jan de Muijnck-Hughes
idris.cabal+7−2
@@ -140,7 +140,7 @@ Extra-source-files:
140 libs/effects/Makefile
140 libs/effects/Makefile
141 libs/effects/effects.ipkg
141 libs/effects/effects.ipkg
142 libs/effects/Effect/*.idr
142 libs/effects/Effect/*.idr
143− libs/effects/Effect/Logging/*.idr
143+ libs/effects/Effect/Logging/*.idr
144 libs/effects/*.idr
144 libs/effects/*.idr
145
145
146 libs/pruviloj/Makefile
146 libs/pruviloj/Makefile
@@ -567,6 +567,11 @@ Extra-source-files:
567 test/primitives003/*.idr
567 test/primitives003/*.idr
568 test/primitives003/expected
568 test/primitives003/expected
569
569
570+ test/pkg001/run
571+ test/pkg001/test.ipkg
572+ test/pkg001/*.idr
573+ test/pkg001/expected
574+
570 test/proof001/run
575 test/proof001/run
571 test/proof001/*.idr
576 test/proof001/*.idr
572 test/proof001/expected
577 test/proof001/expected
@@ -598,7 +603,7 @@ Extra-source-files:
598 test/proof010/run
603 test/proof010/run
599 test/proof010/*.idr
604 test/proof010/*.idr
600 test/proof010/expected
605 test/proof010/expected
601−
606+
602 test/proofsearch001/run
607 test/proofsearch001/run
603 test/proofsearch001/*.idr
608 test/proofsearch001/*.idr
604 test/proofsearch001/expected
609 test/proofsearch001/expected
src/Pkg/PParser.hs+3−3
@@ -79,12 +79,12 @@ pClause = do reserved "executable"; lchar '=';
79 opts <- stringLiteral
79 opts <- stringLiteral
80 st <- get
80 st <- get
81 let args = pureArgParser (words opts)
81 let args = pureArgParser (words opts)
82− put (st { idris_opts = args })
82+ put (st { idris_opts = args ++ idris_opts st })
83 <|> do reserved "pkgs"; lchar '=';
83 <|> do reserved "pkgs"; lchar '=';
84 ps <- sepBy1 (fst <$> identifier) (lchar ',')
84 ps <- sepBy1 (fst <$> identifier) (lchar ',')
85 st <- get
85 st <- get
86− let pkgs = pureArgParser $ map (\x -> unwords ["-p", x]) ps
86+ let pkgs = pureArgParser $ concatMap (\x -> ["-p", x]) ps
87− put (st {idris_opts = idris_opts st ++ pkgs})
87+ put (st {idris_opts = pkgs ++ idris_opts st})
88 <|> do reserved "modules"; lchar '=';
88 <|> do reserved "modules"; lchar '=';
89 ms <- sepBy1 (fst <$> iName []) (lchar ',')
89 ms <- sepBy1 (fst <$> iName []) (lchar ',')
90 st <- get
90 st <- get
test/pkg001/Main.idrnew file+8
@@ -0,0 +1,8 @@
1+module Main
2+
3+import Effects
4+import Effect.State
5+
6+
7+main : IO ()
8+main = putStrLn "CouCou!"
test/pkg001/expectednew file+1
@@ -0,0 +1 @@
1+Type checking ./Main.idr
test/pkg001/runnew file+3
@@ -0,0 +1,3 @@
1+#!/usr/bin/env bash
2+idris $@ --build test.ipkg
3+rm -f *.ibc
test/pkg001/test.ipkgnew file+7
@@ -0,0 +1,7 @@
1+package test
2+
3+pkgs = effects
4+
5+opts = "--warnpartial --warnreach"
6+
7+modules = Main