on master help sign in
Merge pull request #2674 from jfdm/fix-ipkg-parsing-mistake

Fixed parsing error in ipkg files

commit8e8fd659a0c59a392367ddca72925e8c69baf29a authorJan de Muijnck-Hughes <jfdm@users.noreply.github.com> dateMon 28 Sep 2015, 16:21 (11 years ago) parentb8a8c79ae7bdd1
6 files changed+29−5
idris.cabal+7−2 src/Pkg/PParser.hs+3−3 test/pkg001/Main.idr+8 test/pkg001/expected+1 test/pkg001/run+3 test/pkg001/test.ipkg+7
idris.cabal+7−2
@@ -140,7 +140,7 @@ Extra-source-files:
140140 libs/effects/Makefile
141141 libs/effects/effects.ipkg
142142 libs/effects/Effect/*.idr
143− libs/effects/Effect/Logging/*.idr
143+ libs/effects/Effect/Logging/*.idr
144144 libs/effects/*.idr
145145
146146 libs/pruviloj/Makefile
@@ -567,6 +567,11 @@ Extra-source-files:
567567 test/primitives003/*.idr
568568 test/primitives003/expected
569569
570+ test/pkg001/run
571+ test/pkg001/test.ipkg
572+ test/pkg001/*.idr
573+ test/pkg001/expected
574+
570575 test/proof001/run
571576 test/proof001/*.idr
572577 test/proof001/expected
@@ -598,7 +603,7 @@ Extra-source-files:
598603 test/proof010/run
599604 test/proof010/*.idr
600605 test/proof010/expected
601−
606+
602607 test/proofsearch001/run
603608 test/proofsearch001/*.idr
604609 test/proofsearch001/expected
src/Pkg/PParser.hs+3−3
@@ -79,12 +79,12 @@ pClause = do reserved "executable"; lchar '=';
7979 opts <- stringLiteral
8080 st <- get
8181 let args = pureArgParser (words opts)
82− put (st { idris_opts = args })
82+ put (st { idris_opts = args ++ idris_opts st })
8383 <|> do reserved "pkgs"; lchar '=';
8484 ps <- sepBy1 (fst <$> identifier) (lchar ',')
8585 st <- get
86− let pkgs = pureArgParser $ map (\x -> unwords ["-p", x]) ps
87− put (st {idris_opts = idris_opts st ++ pkgs})
86+ let pkgs = pureArgParser $ concatMap (\x -> ["-p", x]) ps
87+ put (st {idris_opts = pkgs ++ idris_opts st})
8888 <|> do reserved "modules"; lchar '=';
8989 ms <- sepBy1 (fst <$> iName []) (lchar ',')
9090 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