@@ -616,20 +616,112 @@ toParseErrorReport source modul =
616 "This " ++ bracket : " does not match up with an earlier open " ++ term ++ ". Try deleting it?"
616 "This " ++ bracket : " does not match up with an earlier open " ++ term ++ ". Try deleting it?"
619− Code.Other ->
619+ Code.Other maybeChar ->
621 region = toRegion row col
621 region = toRegion row col
625+ Report.Report "UNEXPECTED SEMICOLON" region [] $
626+ Code.toSnippet source region Nothing
629+ "I got stuck on this semicolon:"
632+ [ D.reflow $ "Try removing it?"
634+ "Some languages require semicolons at the end of each statement. These are\
635+ \ often called C-like languages, and they usually share a lot of language design\
636+ \ choices. (E.g. side-effects, for loops, etc.) Elm manages effects with commands\
637+ \ and subscriptions instead, so there is no special syntax for \"statements\" and\
638+ \ therefore no need to use semicolons to separate them. I think this will make\
639+ \ more sense as you work through https://guide.elm-lang.org though!"
644+ Report.Report "UNEXPECTED COMMA" region [] $
645+ Code.toSnippet source region Nothing
648+ "I got stuck on this comma:"
652+ "I do not think I am parsing a list or tuple right now. Try deleting the comma?"
654+ "If this is supposed to be part of a list, the problem may be a bit earlier.\
655+ \ Perhaps the opening [ is missing? Or perhaps some value in the list has an extra\
656+ \ closing ] that is making me think the list ended earlier? The same kinds of\
657+ \ things could be going wrong if this is supposed to be a tuple."
662+ Report.Report "UNEXPECTED CHARACTER" region [] $
663+ Code.toSnippet source region Nothing
666+ "I got stuck on this character:"
670+ "It is not used for anything in Elm syntax. It is used for multi-line strings in\
671+ \ some languages though, so if you want a string that spans multiple lines, you\
672+ \ can use Elm's multi-line string syntax like this:"
674+ [ D.fillSep [D.green "markdown","=",D.dullyellow "\"\"\""]
676+ , D.dullyellow "# Multi-line Strings"
678+ , D.dullyellow "- start with triple double quotes"
679+ , D.dullyellow "- write whatever you want"
680+ , D.dullyellow "- no need to escape newlines or double quotes"
681+ , D.dullyellow "- end with triple double quotes"
683+ , D.dullyellow "\"\"\""
686+ "Otherwise I do not know what is going on! Try removing the character?"
691+ Report.Report "UNEXPECTED SYMBOL" region [] $
692+ Code.toSnippet source region Nothing
695+ "I got stuck on this dollar sign:"
698+ "It is not used for anything in Elm syntax. Are you coming from a language where\
699+ \ dollar signs can be used in variable names? If so, try a name that (1) starts\
700+ \ with a letter and (2) only contains letters, numbers, and underscores."
703+ Just c | elem c ['#','@','!','%','~'] ->
704+ Report.Report "UNEXPECTED SYMBOL" region [] $
705+ Code.toSnippet source region Nothing
708+ "I got stuck on this symbol:"
711+ "It is not used for anything in Elm syntax. Try removing it?"
623− Report.Report "SYNTAX PROBLEM" region [] $
715+ Report.Report "SYNTAX PROBLEM" region [] $
624− Code.toSnippet source region Nothing
716+ Code.toSnippet source region Nothing
626− D.reflow $
718+ D.reflow $
627− "I got stuck here:"
719+ "I got stuck here:"
629− D.reflow $
721+ D.reflow $
630− "Whatever I am running into is confusing me a lot! Normally I can give fairly\
722+ "Whatever I am running into is confusing me a lot! Normally I can give fairly\
631− \ specific hints, but something is really tripping me up this time."
723+ \ specific hints, but something is really tripping me up this time."
634 ModuleProblem row col ->
726 ModuleProblem row col ->
@@ -823,7 +915,7 @@ toParseErrorReport source modul =
824 region = toRegion row col
916 region = toRegion row col
826− Report.Report "EXECTING IMPORT ALIAS" region [] $
918+ Report.Report "EXPECTING IMPORT ALIAS" region [] $
827 Code.toSnippet source region Nothing
919 Code.toSnippet source region Nothing
829 D.reflow $
921 D.reflow $
@@ -1329,7 +1421,7 @@ toDeclarationsReport source decl =
1329 , D.fillSep [D.cyan "type",D.green "User","=","Anonymous","|","LoggedIn String"]
1421 , D.fillSep [D.cyan "type",D.green "User","=","Anonymous","|","LoggedIn String"]
1330 , D.reflow $
1422 , D.reflow $
1331 "Note that all declarations start with lower-case letters in Elm. Capitalization\
1423 "Note that all declarations start with lower-case letters in Elm. Capitalization\
1332− \ makes a difference, so be consious of that if you are working from examples!"
1424+ \ makes a difference, so be conscious of that if you are working from examples!"
@@ -5226,7 +5318,7 @@ toTTupleReport source context tuple startRow startCol =
5226 Code.toSnippet source surroundings (Just region)
5318 Code.toSnippet source surroundings (Just region)
5228 D.reflow $
5320 D.reflow $
5229− "I was expecting to see a closing parentheses next, but I got stuck here:"
5321+ "I was expecting to see a closing parenthesis next, but I got stuck here:"
5232 [ D.fillSep ["Try","adding","a",D.dullyellow ")","to","see","if","that","helps?"]
5324 [ D.fillSep ["Try","adding","a",D.dullyellow ")","to","see","if","that","helps?"]