on master help sign in
Have the REPL parser expose Names rather than Strings
commit06847f67b4dc3da7a6a14acc5d68d7a450f3debb authorEvan Czaplicki <evancz@users.noreply.github.com> dateFri 15 Dec 2017, 18:59 (9 years ago) parenta97552b
1 file changed+7−6
src/Parse/Repl.hs+7−6
src/Parse/Repl.hs+7−6
@@ -12,6 +12,7 @@ import qualified Data.Text as Text
1212import Data.Text (Text)
1313
1414import qualified AST.Source as Src
15+import qualified Elm.Name as N
1516import Parse.Primitives
1617import qualified Parse.Primitives.Keyword as Keyword
1718import qualified Parse.Primitives.Symbol as Symbol
@@ -25,9 +26,9 @@ import qualified Reporting.Annotation as A
2526
2627
2728data Entry
28− = Import String Text
29− | Type String Text
30− | Def (Maybe String) Text
29+ = Import N.Name Text
30+ | Type N.Name Text
31+ | Def (Maybe N.Name) Text
3132 | Other Text
3233 | Annotation
3334 | Port
@@ -57,7 +58,7 @@ entryParser source =
5758 [ do Keyword.import_
5859 spaces
5960 name <- Var.moduleName
60− return (Import (Text.unpack name) source)
61+ return (Import name source)
6162
6263 , do Keyword.port_
6364 return Port
@@ -70,7 +71,7 @@ entryParser source =
7071 , return ()
7172 ]
7273 name <- Var.upper
73− return (Type (Text.unpack name) source)
74+ return (Type name source)
7475
7576 , do root <- Pattern.term
7677 spaces
@@ -80,7 +81,7 @@ entryParser source =
8081 [ do Symbol.hasType
8182 return Annotation
8283 , do chompArgs
83− return (Def (Just (Text.unpack name)) source)
84+ return (Def (Just name) source)
8485 ]
8586
8687 _ ->