aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PursLoader
diff options
context:
space:
mode:
Diffstat (limited to 'src/PursLoader')
-rw-r--r--src/PursLoader/Loader.purs8
-rw-r--r--src/PursLoader/LoaderUtil.purs2
-rw-r--r--src/PursLoader/Options.purs15
3 files changed, 20 insertions, 5 deletions
diff --git a/src/PursLoader/Loader.purs b/src/PursLoader/Loader.purs
index 205d3eb..a91667c 100644
--- a/src/PursLoader/Loader.purs
+++ b/src/PursLoader/Loader.purs
@@ -16,7 +16,7 @@ import Data.Function (Fn2(), mkFn2)
16import Data.Maybe (Maybe(..), fromMaybe, maybe) 16import Data.Maybe (Maybe(..), fromMaybe, maybe)
17import Data.Either (Either(..)) 17import Data.Either (Either(..))
18import Data.String (joinWith) 18import Data.String (joinWith)
19import Data.String.Regex (match, noFlags, regex, test) 19import Data.String.Regex (Regex(), match, noFlags, regex, test)
20import Data.Traversable (sequence) 20import Data.Traversable (sequence)
21import Data.Foreign (F()) 21import Data.Foreign (F())
22import Data.Foreign.Class (read) 22import Data.Foreign.Class (read)
@@ -30,16 +30,22 @@ import PursLoader.Options (loaderFFIOption, loaderSrcOption, pscOptions, Options
30 30
31type Effects eff = (cp :: ChildProcess, fs :: FS, glob :: Glob, loader :: Loader, err :: EXCEPTION | eff) 31type Effects eff = (cp :: ChildProcess, fs :: FS, glob :: Glob, loader :: Loader, err :: EXCEPTION | eff)
32 32
33moduleRegex :: Regex
33moduleRegex = regex "(?:^|\\n)module\\s+([\\w\\.]+)" noFlags { ignoreCase = true } 34moduleRegex = regex "(?:^|\\n)module\\s+([\\w\\.]+)" noFlags { ignoreCase = true }
34 35
36foreignRegex :: Regex
35foreignRegex = regex "(?:^|\\n)\\s*foreign import\\s+" noFlags { ignoreCase = true } 37foreignRegex = regex "(?:^|\\n)\\s*foreign import\\s+" noFlags { ignoreCase = true }
36 38
39pscCommand :: String
37pscCommand = "psc" 40pscCommand = "psc"
38 41
42psciCommand :: String
39psciCommand = "psci" 43psciCommand = "psci"
40 44
45psciFilename :: String
41psciFilename = ".psci" 46psciFilename = ".psci"
42 47
48(!!!) :: forall a. Int -> Array a -> Maybe a
43(!!!) = flip (!!) 49(!!!) = flip (!!)
44 50
45foreign import cwd :: String 51foreign import cwd :: String
diff --git a/src/PursLoader/LoaderUtil.purs b/src/PursLoader/LoaderUtil.purs
index 3e5a7bc..45495c8 100644
--- a/src/PursLoader/LoaderUtil.purs
+++ b/src/PursLoader/LoaderUtil.purs
@@ -4,6 +4,4 @@ module PursLoader.LoaderUtil
4 4
5import Data.Foreign (Foreign()) 5import Data.Foreign (Foreign())
6 6
7import PursLoader.LoaderRef (LoaderRef())
8
9foreign import parseQuery :: String -> Foreign 7foreign import parseQuery :: String -> Foreign
diff --git a/src/PursLoader/Options.purs b/src/PursLoader/Options.purs
index 1650652..3657d1a 100644
--- a/src/PursLoader/Options.purs
+++ b/src/PursLoader/Options.purs
@@ -6,37 +6,48 @@ module PursLoader.Options
6 , output 6 , output
7 ) where 7 ) where
8 8
9import Prelude (Unit(), (<>), (<$>), (<<<), (++), (<*>), ($), const, id) 9import Prelude ((<>), (<$>), (<<<), (++), (<*>), ($), const, id)
10 10
11import Data.Array (concat) 11import Data.Array (concat)
12import Data.Either (either) 12import Data.Either (either)
13 13
14import Data.Foreign (Foreign(), F()) 14import Data.Foreign (Foreign())
15import Data.Foreign.Class (IsForeign, read, readProp) 15import Data.Foreign.Class (IsForeign, read, readProp)
16import Data.Foreign.NullOrUndefined (NullOrUndefined(..), runNullOrUndefined) 16import Data.Foreign.NullOrUndefined (NullOrUndefined(..), runNullOrUndefined)
17 17
18import Data.Maybe (Maybe(..), maybe, fromMaybe) 18import Data.Maybe (Maybe(..), maybe, fromMaybe)
19 19
20noPreludeOpt :: String
20noPreludeOpt = "no-prelude" 21noPreludeOpt = "no-prelude"
21 22
23noOptsOpt :: String
22noOptsOpt = "no-opts" 24noOptsOpt = "no-opts"
23 25
26noMagicDoOpt :: String
24noMagicDoOpt = "no-magic-do" 27noMagicDoOpt = "no-magic-do"
25 28
29noTcoOpt :: String
26noTcoOpt = "no-tco" 30noTcoOpt = "no-tco"
27 31
32verboseErrorsOpt :: String
28verboseErrorsOpt = "verbose-errors" 33verboseErrorsOpt = "verbose-errors"
29 34
35outputOpt :: String
30outputOpt = "output" 36outputOpt = "output"
31 37
38commentsOpt :: String
32commentsOpt = "comments" 39commentsOpt = "comments"
33 40
41noPrefixOpt :: String
34noPrefixOpt = "no-prefix" 42noPrefixOpt = "no-prefix"
35 43
44requirePathOpt :: String
36requirePathOpt = "require-path" 45requirePathOpt = "require-path"
37 46
47srcOpt :: String
38srcOpt = "src" 48srcOpt = "src"
39 49
50ffiOpt :: String
40ffiOpt = "ffi" 51ffiOpt = "ffi"
41 52
42newtype Options 53newtype Options