diff --git a/Main.elm b/Main.elm index 488f77d..ee267e4 100644 --- a/Main.elm +++ b/Main.elm @@ -1,14 +1,13 @@ port module Main exposing (..) import Dict exposing (Dict) -import Html.App import Html import Import exposing (Import) import Module exposing (Module) main = - Html.App.programWithFlags + Html.programWithFlags { init = init , update = update , subscriptions = subscriptions diff --git a/elm-package.json b/elm-package.json index 481c78b..4190cdb 100644 --- a/elm-package.json +++ b/elm-package.json @@ -9,8 +9,8 @@ ], "exposed-modules": [], "dependencies": { - "elm-lang/core": "4.0.5 <= v < 5.0.0", - "elm-lang/html": "1.1.0 <= v < 2.0.0" + "elm-lang/core": "5.0.0 <= v < 6.0.0", + "elm-lang/html": "2.0.0 <= v < 3.0.0" }, - "elm-version": "0.17.1 <= v < 0.18.0" + "elm-version": "0.18.0 <= v < 0.19.0" } diff --git a/src/Declaration.elm b/src/Declaration.elm index ba48981..19eee8a 100644 --- a/src/Declaration.elm +++ b/src/Declaration.elm @@ -37,9 +37,9 @@ parse source = process match = case match of - name :: exports :: exports' :: comment :: [] -> + name :: exports :: exports_ :: comment :: [] -> ( Maybe.withDefault "" name - , Export.parse (Maybe.withDefault "" (Maybe.map2 (++) exports exports')) + , Export.parse (Maybe.withDefault "" (Maybe.map2 (++) exports exports_)) , Maybe.withDefault "" comment ) diff --git a/src/Export.elm b/src/Export.elm index 9fcbc9a..2c4fa99 100644 --- a/src/Export.elm +++ b/src/Export.elm @@ -71,31 +71,31 @@ parse source = AllExport else let - match source' = - List.map .submatches (find All pattern source') + match source_ = + List.map .submatches (find All pattern source_) process exports = case exports of name :: types :: binop :: [] -> let - name' = + name_ = Maybe.withDefault "" name - types' = + types_ = Maybe.withDefault [] (split types) - binop' = + binop_ = Maybe.map FunctionExport binop in case binop of - Just binop' -> - FunctionExport binop' + Just binop_ -> + FunctionExport binop_ Nothing -> - if isUpcase name' then - TypeExport name' (toCase types') + if isUpcase name_ then + TypeExport name_ (toCase types_) else - FunctionExport name' + FunctionExport name_ _ -> Debug.crash "Shouldn't have gotten here processing exports." diff --git a/src/Import.elm b/src/Import.elm index 1484e0a..522a73a 100644 --- a/src/Import.elm +++ b/src/Import.elm @@ -45,10 +45,10 @@ defaultImports = database : List Import -> Dict String Import database imports = let - imports' = - List.map (\import' -> ( import'.name, import' )) imports + imports_ = + List.map (\import_ -> ( import_.name, import_ )) imports in - Dict.union (Dict.fromList imports') defaultImports + Dict.union (Dict.fromList imports_) defaultImports pattern : Regex @@ -66,11 +66,11 @@ parse source = process match = case match of - name :: alias :: exports :: exports' :: [] -> + name :: alias :: exports :: exports_ :: [] -> Import (Maybe.withDefault "" name) alias - (Export.parse (Maybe.withDefault "" (Maybe.map2 (++) exports exports'))) + (Export.parse (Maybe.withDefault "" (Maybe.map2 (++) exports exports_))) _ -> Debug.crash "Shouldn't have gotten here processing imports." diff --git a/tests/Declarations.elm b/tests/Declarations.elm index 6b3e0bb..e00f73f 100644 --- a/tests/Declarations.elm +++ b/tests/Declarations.elm @@ -134,21 +134,21 @@ effectExposingOne = effectExposingMany : Test effectExposingMany = - testEq "plain exposing many" + testEq "effect exposing many" (Declaration.parse "effect module Test where { command = MyCmd } exposing (a, b)") (Declaration "Test" (SubsetExport [ FunctionExport "a", FunctionExport "b" ]) "") effectExposingManyMultiline : Test effectExposingManyMultiline = - testEq "plain exposing many multiline" + testEq "effect exposing many multiline" (Declaration.parse "port module Test where { command = MyCmd } exposing\n ( a\n , b\n )\n") (Declaration "Test" (SubsetExport [ FunctionExport "a", FunctionExport "b" ]) "") all : Test all = - describe "Declarations" + describe "Declarations tests" [ plain , plainExposingAll , plainExposingBinop diff --git a/tests/Helper.elm b/tests/Helper.elm index 01b8c0a..742a300 100644 --- a/tests/Helper.elm +++ b/tests/Helper.elm @@ -5,6 +5,6 @@ import Expect testEq : String -> a -> a -> Test -testEq name a a' = +testEq name a a_ = test name <| - \() -> Expect.equal a a' + \() -> Expect.equal a a_ diff --git a/tests/Imports.elm b/tests/Imports.elm index 57a7122..8db5bf8 100644 --- a/tests/Imports.elm +++ b/tests/Imports.elm @@ -43,7 +43,7 @@ plainExposingTypeAll = plainExposingTypeOne : Test plainExposingTypeOne = - testEq "plain exposing type all" + testEq "plain exposing type one" (Import.parse "import Test exposing (A(B))") ([ Import "Test" Nothing (SubsetExport [ TypeExport "A" (SomeCase [ "B" ]) ]) ]) @@ -120,7 +120,7 @@ asExposingManyMultiline = all : Test all = - describe "Imports" + describe "Imports tests" [ plain , plainExposingAll , plainExposingBinop diff --git a/tests/Main.elm b/tests/Main.elm index bdd3183..18353d8 100644 --- a/tests/Main.elm +++ b/tests/Main.elm @@ -1,23 +1,16 @@ port module Main exposing (..) import Test exposing (..) -import Test.Runner.Node exposing (run) import Json.Encode exposing (Value) import Declarations import Imports -main : Program Value -main = - run emit all - - -all : Test all = - describe "Test Suite" + describe "Test suite" [ Declarations.all , Imports.all ] - + port emit : ( String, Value ) -> Cmd msg diff --git a/tests/elm-package.json b/tests/elm-package.json index 27e7878..2098665 100644 --- a/tests/elm-package.json +++ b/tests/elm-package.json @@ -9,9 +9,8 @@ ], "exposed-modules": [], "dependencies": { - "elm-lang/core": "4.0.0 <= v < 5.0.0", - "elm-community/elm-test": "2.0.0 <= v < 3.0.0", - "rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0" + "elm-community/elm-test": "4.0.0 <= v < 5.0.0", + "elm-lang/core": "5.0.0 <= v < 6.0.0" }, - "elm-version": "0.17.0 <= v < 0.18.0" + "elm-version": "0.18.0 <= v < 0.19.0" }