on master help sign in
Use backticks instead of single quotes when reporting code terms to end users.
commit4ffd70ad322300a3a01316af0cabc675b37a05a4 authorRichard Feldman <richard.t.feldman@gmail.com> dateTue 2 Jun 2015, 22:04 (11 years ago) parent73d3c1b
13 files changed+41−41
src/CommandLineRouter.hs+2−2 src/Elm/Utils.hs+1−1 src/Generate/Cases.hs+2−2 src/Generate/JavaScript/Port.hs+1−1 src/Parse/Helpers.hs+1−1 src/Parse/Module.hs+1−1 src/Reporting/Error/Canonicalize.hs+7−7 src/Reporting/Error/Syntax.hs+14−14 src/Reporting/Error/Type.hs+4−4 src/Reporting/Warning.hs+2−2 src/Type/Environment.hs+3−3 src/Type/Solve.hs+1−1 src/Type/Unify.hs+2−2
src/CommandLineRouter.hs+2−2
@@ -26,10 +26,10 @@ attemptToRun command args =
2626 case found of
2727 Nothing ->
2828 hPutStrLn stderr $
29− "Could not find command '" ++ command ++ "'. Maybe there is a typo?\n\n\
29+ "Could not find command `" ++ command ++ "`. Maybe there is a typo?\n\n\
3030 \Default commands include:\n\n"
3131 ++ availableCommands ++
32− "\nWhen you try to run the command '" ++ command ++ "' we actually search for an\n\
32+ "\nWhen you try to run the command `" ++ command ++ "` we actually search for an\n\
3333 \ executable named elm-" ++ command ++ ". Are you able to run elm-" ++ command ++ "?\n\
3434 \ Is it on your PATH?"
3535
src/Elm/Utils.hs+1−1
@@ -87,7 +87,7 @@ unwrappedRun command args =
8787missingExe :: String -> CommandError
8888missingExe command =
8989 MissingExe $
90− "Could not find command '" ++ command ++ "'. Do you have it installed?\n\
90+ "Could not find command `" ++ command ++ "`. Do you have it installed?\n\
9191 \ Can it be run from anywhere? Is it on your PATH?"
9292
9393
src/Generate/Cases.hs+2−2
@@ -258,5 +258,5 @@ matchMix vs branches def =
258258
259259noMatch :: String -> a
260260noMatch name =
261− error $ "unexpected pattern in '" ++ name ++
262− "' function. Report a compiler issue to <https://github.com/elm-lang/Elm>."
261+ error $ "unexpected pattern in `" ++ name ++
262+ "` function. Report a compiler issue to <https://github.com/elm-lang/Elm>."
src/Generate/JavaScript/Port.hs+1−1
@@ -41,7 +41,7 @@ typeToString tipe =
4141 JSString -> "a string"
4242 JSArray -> "an array"
4343 JSObject fields ->
44− "an object with fields '" ++ List.intercalate "', '" fields ++ "'"
44+ "an object with fields `" ++ List.intercalate "`, `" fields ++ "`"
4545
4646
4747_Array :: String -> Expression ()
src/Parse/Helpers.hs+1−1
@@ -101,7 +101,7 @@ makeVar firstChar =
101101
102102reserved :: String -> IParser String
103103reserved word =
104− expecting ("reserved word '" ++ word ++ "'") $
104+ expecting ("reserved word `" ++ word ++ "`") $
105105 do string word
106106 notFollowedBy innerVarChar
107107 return word
src/Parse/Module.hs+1−1
@@ -67,7 +67,7 @@ import' =
6767 as' moduleName =
6868 do try (whitespace >> reserved "as")
6969 whitespace
70− capVar <?> ("an alias for module '" ++ moduleName ++ "'")
70+ capVar <?> ("an alias for module `" ++ moduleName ++ "`")
7171
7272 exposing :: IParser (Var.Listing Var.Value)
7373 exposing =
src/Reporting/Error/Canonicalize.hs+7−7
@@ -139,7 +139,7 @@ toReport :: P.Dealiaser -> Error -> Report.Report
139139toReport dealiaser err =
140140 case err of
141141 Var (VarError kind name problem suggestions) ->
142− let var = kind ++ " '" ++ name ++ "'"
142+ let var = kind ++ " `" ++ name ++ "`"
143143 in
144144 case problem of
145145 Ambiguous ->
@@ -149,12 +149,12 @@ toReport dealiaser err =
149149
150150 UnknownQualifier qualifier ->
151151 namingError
152− ("Cannot find " ++ var ++ ", qualifier '" ++ qualifier ++ "' is not in scope.")
152+ ("Cannot find " ++ var ++ ", qualifier `" ++ qualifier ++ "` is not in scope.")
153153 (maybeYouWant suggestions)
154154
155155 QualifiedUnknown qualifier ->
156156 namingError
157− ("Cannot find " ++ var ++ ", module '" ++ qualifier ++ "' does not expose that value.")
157+ ("Cannot find " ++ var ++ ", module `" ++ qualifier ++ "` does not expose that value.")
158158 (maybeYouWant suggestions)
159159
160160 ExposedUnknown ->
@@ -200,17 +200,17 @@ toReport dealiaser err =
200200 case importError of
201201 ModuleNotFound suggestions ->
202202 namingError
203− ("Could not find a module named '" ++ moduleName ++ "'")
203+ ("Could not find a module named `" ++ moduleName ++ "`")
204204 (maybeYouWant (map Module.nameToString suggestions))
205205
206206 ValueNotFound value suggestions ->
207207 namingError
208− ("Module '" ++ moduleName ++ "' does not expose '" ++ value ++ "'")
208+ ("Module `" ++ moduleName ++ "` does not expose `" ++ value ++ "`")
209209 (maybeYouWant suggestions)
210210
211211 Export name suggestions ->
212212 namingError
213− ("Could not export '" ++ name ++ "' which is not defined in this module.")
213+ ("Could not export `" ++ name ++ "` which is not defined in this module.")
214214 (maybeYouWant suggestions)
215215
216216 Port (PortError name isInbound _rootType localType maybeMessage) ->
@@ -220,7 +220,7 @@ toReport dealiaser err =
220220
221221 preHint =
222222 "Trying to send " ++ maybe "an unsupported type" id maybeMessage
223− ++ " through " ++ boundPort ++ " '" ++ name ++ "'"
223+ ++ " through " ++ boundPort ++ " `" ++ name ++ "`"
224224
225225 postHint =
226226 "The specific unsupported type is:\n\n"
src/Reporting/Error/Syntax.hs+14−14
@@ -50,7 +50,7 @@ toReport dealiaser err =
5050 TypeWithoutDefinition valueName ->
5151 Report.simple
5252 "MISSING DEFINITION"
53− ("There is a type annotation for '" ++ valueName ++ "' but there"
53+ ("There is a type annotation for `" ++ valueName ++ "` but there"
5454 ++ "is no corresponding definition!"
5555 )
5656 ("Directly below the type annotation, put a definition like:\n\n"
@@ -60,7 +60,7 @@ toReport dealiaser err =
6060 PortWithoutAnnotation portName ->
6161 Report.simple
6262 "PORT ERROR"
63− ("Port '" ++ portName ++ "' does not have a type annotation!")
63+ ("Port `" ++ portName ++ "` does not have a type annotation!")
6464 ("Directly above the port definition, I need something like this:\n\n"
6565 ++ " port " ++ portName ++ " : Signal Int"
6666 )
@@ -78,30 +78,30 @@ toReport dealiaser err =
7878 DuplicateValueDeclaration name ->
7979 Report.simple
8080 "DUPLICATE DEFINITION"
81− ("Naming multiple top-level values '" ++ name ++ "' makes things\n"
82− ++ "ambiguous. When you say '" ++ name ++ "' which one do you want?"
81+ ("Naming multiple top-level values `" ++ name ++ "` makes things\n"
82+ ++ "ambiguous. When you say `" ++ name ++ "` which one do you want?"
8383 )
84− ("Find all the top-level values named '" ++ name ++ "' and\n"
84+ ("Find all the top-level values named `" ++ name ++ "` and\n"
8585 ++ "do some renaming. Make sure the names are distinct!"
8686 )
8787
8888 DuplicateTypeDeclaration name ->
8989 Report.simple
9090 "DUPLICATE DEFINITION"
91− ("Naming multiple types '" ++ name ++ "' makes things ambiguous\n"
92− ++ "When you say '" ++ name ++ "' which one do you want?"
91+ ("Naming multiple types `" ++ name ++ "` makes things ambiguous\n"
92+ ++ "When you say `" ++ name ++ "` which one do you want?"
9393 )
94− ("Find all the types named '" ++ name ++ "' and\n"
94+ ("Find all the types named `" ++ name ++ "` and\n"
9595 ++ "do some renaming. Make sure the names are distinct!"
9696 )
9797
9898 DuplicateDefinition name ->
9999 Report.simple
100100 "DUPLICATE DEFINITION"
101− ("Naming multiple values '" ++ name ++ "' in a single let-expression makes\n"
102− ++ "things ambiguous. When you say '" ++ name ++ "' which one do you want?"
101+ ("Naming multiple values `" ++ name ++ "` in a single let-expression makes\n"
102+ ++ "things ambiguous. When you say `" ++ name ++ "` which one do you want?"
103103 )
104− ("Find all the values named '" ++ name ++ "' in this let-expression and\n"
104+ ("Find all the values named `" ++ name ++ "` in this let-expression and\n"
105105 ++ "do some renaming. Make sure the names are distinct!"
106106 )
107107
@@ -135,13 +135,13 @@ unboundTypeVars :: String -> String -> [String] -> String -> Report.Report
135135unboundTypeVars typeName tvar tvars revisedDeclaration =
136136 Report.simple
137137 "UNBOUND TYPE VARS"
138− ( "Not all type variables in '" ++ typeName ++ "' are listed, making sneaky\n"
138+ ( "Not all type variables in `" ++ typeName ++ "` are listed, making sneaky\n"
139139 ++ "type errors possible. Unbound type variables include: "
140140 ++ List.intercalate ", " (tvar:tvars)
141141 )
142142 ( "You probably want this definition instead:\n"
143143 ++ concatMap ("\n "++) (lines revisedDeclaration) ++ "\n\n"
144− ++ "Here's why. Imagine one '" ++ typeName ++ "' where '" ++ tvar ++ "' is an Int and\n"
144+ ++ "Here's why. Imagine one `" ++ typeName ++ "` where `" ++ tvar ++ "` is an Int and\n"
145145 ++ "another where it is a Bool. When we explicitly list the type variables, type\n"
146146 ++ "checker can see that they are actually different types."
147147 )
@@ -202,7 +202,7 @@ parseErrorReport messages =
202202 [msg] ->
203203 case unkeyword msg of
204204 Just kwd ->
205− "It looks like the keyword '" ++ kwd ++ "' is being used as a variable.\n"
205+ "It looks like the keyword `" ++ kwd ++ "` is being used as a variable.\n"
206206 ++ "Try renaming it to something else."
207207 Nothing ->
208208 msg
src/Reporting/Error/Type.hs+4−4
@@ -90,14 +90,14 @@ toReport dealiaser err =
9090 P.pretty dealiaser False tipe
9191 in
9292 Report.simple "INFINITE TYPE"
93− ( "I am inferring weird self-referential type for '" ++ name ++ "'"
93+ ( "I am inferring weird self-referential type for `" ++ name ++ "`"
9494 )
9595 ( "The bit of the type that is self-referential looks like this:\n\n"
9696 ++ P.render (P.nest 4 (prettyVar <+> P.equals <+> prettyType))
97− ++ "\n\nThe cause is often that the usage of '" ++ name ++ "' is flipped around.\n\n"
97+ ++ "\n\nThe cause is often that the usage of `" ++ name ++ "` is flipped around.\n\n"
9898 ++ "Maybe you are inserting a data structure into an element? Maybe you are giving\n"
9999 ++ "a function to an argument? Either way, something is probably backwards!\n\n"
100− ++ "Try breaking the code related to '" ++ name ++ "' into smaller pieces.\n"
100+ ++ "Try breaking the code related to `" ++ name ++ "` into smaller pieces.\n"
101101 ++ "Give each piece a name and try to write down its type."
102102 )
103103
@@ -190,7 +190,7 @@ hintToString hint =
190190
191191 BadTypeAnnotation name ->
192192 ( Nothing
193− , "The type annotation for '" ++ name ++ "' does not match its definition."
193+ , "The type annotation for `" ++ name ++ "` does not match its definition."
194194 )
195195
196196
src/Reporting/Warning.hs+2−2
@@ -39,13 +39,13 @@ toReport dealiaser warning =
3939 UnusedImport moduleName ->
4040 Report.simple
4141 "unused import"
42− ("Module '" ++ Module.nameToString moduleName ++ "' is unused.")
42+ ("Module `" ++ Module.nameToString moduleName ++ "` is unused.")
4343 ""
4444
4545 MissingTypeAnnotation name inferredType ->
4646 Report.simple
4747 "missing type annotation"
48− ("Top-level value '" ++ name ++ "' does not have a type annotation.")
48+ ("Top-level value `" ++ name ++ "` does not have a type annotation.")
4949 ( "The type annotation you want looks something like this:\n\n"
5050 ++ P.render (P.nest 4 typeDoc)
5151 )
src/Type/Environment.hs+3−3
@@ -117,7 +117,7 @@ get :: Environment -> (Environment -> Map.Map String a) -> String -> a
117117get env subDict key =
118118 Map.findWithDefault (error msg) key (subDict env)
119119 where
120− msg = "Could not find type constructor '" ++ key ++ "' while checking types."
120+ msg = "Could not find type constructor `" ++ key ++ "` while checking types."
121121
122122
123123freshDataScheme
@@ -210,8 +210,8 @@ instantiatorHelp env aliasVars sourceType =
210210 Just t -> return t
211211 Nothing ->
212212 error $
213− "Could not find type constructor '" ++
214− V.toString name ++ "' while checking types."
213+ "Could not find type constructor `" ++
214+ V.toString name ++ "` while checking types."
215215
216216 T.App t ts ->
217217 do t' <- go t
src/Type/Solve.hs+1−1
@@ -167,7 +167,7 @@ actuallySolve constraint =
167167 Nothing ->
168168 if List.isPrefixOf "Native." name
169169 then liftIO (variable Flexible)
170− else error ("Could not find '" ++ name ++ "' when solving type constraints.")
170+ else error ("Could not find `" ++ name ++ "` when solving type constraints.")
171171
172172 t <- TS.flatten term
173173 unify Error.None region freshCopy t
src/Type/Unify.hs+2−2
@@ -167,7 +167,7 @@ actuallyUnify variable1 variable2 = do
167167 let v = render (pretty Never var)
168168 in
169169 typeError variable1 variable2 $ Error.PreNote $
170− "Could not unify rigid type variable '" ++ v ++ "'. The problem probably\n"
170+ "Could not unify rigid type variable `" ++ v ++ "`. The problem probably\n"
171171 ++ "relates to the type variable being shared between two type annotations.\n"
172172 ++ "Try commenting out some type annotations and see what happens."
173173
@@ -356,7 +356,7 @@ fieldMismatchError missingFields =
356356 case Map.keys missingFields of
357357 [] -> ""
358358 [key] ->
359− "Looks like a record is missing the field '" ++ key ++ "'"
359+ "Looks like a record is missing the field `" ++ key ++ "`"
360360 keys ->
361361 "Looks like a record is missing fields "
362362 ++ List.intercalate ", " (init keys) ++ ", and " ++ last keys