From 2e2da2be94720a739c595ec179a7ed49480ce753 Mon Sep 17 00:00:00 2001 From: eric thul Date: Sun, 20 Dec 2015 22:11:16 -0500 Subject: [PATCH] Fixing compiler warnings --- package.json | 10 +++++----- src/PursLoader/Loader.purs | 8 +++++++- src/PursLoader/LoaderUtil.purs | 2 -- src/PursLoader/Options.purs | 15 +++++++++++++-- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index b1ae011..0080d32 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,11 @@ }, "scripts": { "build": "npm run-script build:compile && npm run-script build:docs && npm run-script build:package", - "build:compile": "./node_modules/.bin/pulp build -o build", - "build:docs": "./node_modules/.bin/pulp docs", - "build:package": "./node_modules/.bin/webpack --progress --colors --profile --bail", - "build:watch": "./node_modules/.bin/pulp -w build -o build", - "build:json": "./node_modules/.bin/webpack --progress --colors --profile --bail --json > index.json", + "build:compile": "pulp build -o build", + "build:docs": "pulp docs", + "build:package": "webpack --progress --colors --profile --bail", + "build:watch": "pulp -w build -o build", + "build:json": "webpack --progress --colors --profile --bail --json > index.json", "prepublish": "npm run-script build" }, "files": [ 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) import Data.Maybe (Maybe(..), fromMaybe, maybe) import Data.Either (Either(..)) import Data.String (joinWith) -import Data.String.Regex (match, noFlags, regex, test) +import Data.String.Regex (Regex(), match, noFlags, regex, test) import Data.Traversable (sequence) import Data.Foreign (F()) import Data.Foreign.Class (read) @@ -30,16 +30,22 @@ import PursLoader.Options (loaderFFIOption, loaderSrcOption, pscOptions, Options type Effects eff = (cp :: ChildProcess, fs :: FS, glob :: Glob, loader :: Loader, err :: EXCEPTION | eff) +moduleRegex :: Regex moduleRegex = regex "(?:^|\\n)module\\s+([\\w\\.]+)" noFlags { ignoreCase = true } +foreignRegex :: Regex foreignRegex = regex "(?:^|\\n)\\s*foreign import\\s+" noFlags { ignoreCase = true } +pscCommand :: String pscCommand = "psc" +psciCommand :: String psciCommand = "psci" +psciFilename :: String psciFilename = ".psci" +(!!!) :: forall a. Int -> Array a -> Maybe a (!!!) = flip (!!) foreign 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 import Data.Foreign (Foreign()) -import PursLoader.LoaderRef (LoaderRef()) - foreign 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 , output ) where -import Prelude (Unit(), (<>), (<$>), (<<<), (++), (<*>), ($), const, id) +import Prelude ((<>), (<$>), (<<<), (++), (<*>), ($), const, id) import Data.Array (concat) import Data.Either (either) -import Data.Foreign (Foreign(), F()) +import Data.Foreign (Foreign()) import Data.Foreign.Class (IsForeign, read, readProp) import Data.Foreign.NullOrUndefined (NullOrUndefined(..), runNullOrUndefined) import Data.Maybe (Maybe(..), maybe, fromMaybe) +noPreludeOpt :: String noPreludeOpt = "no-prelude" +noOptsOpt :: String noOptsOpt = "no-opts" +noMagicDoOpt :: String noMagicDoOpt = "no-magic-do" +noTcoOpt :: String noTcoOpt = "no-tco" +verboseErrorsOpt :: String verboseErrorsOpt = "verbose-errors" +outputOpt :: String outputOpt = "output" +commentsOpt :: String commentsOpt = "comments" +noPrefixOpt :: String noPrefixOpt = "no-prefix" +requirePathOpt :: String requirePathOpt = "require-path" +srcOpt :: String srcOpt = "src" +ffiOpt :: String ffiOpt = "ffi" newtype Options -- 2.41.0