@@ -649,184 +649,9 @@ toParseErrorReport source modul =
649 toSpaceReport source space row col
649 toSpaceReport source space row col
651 ModuleBadEnd row col ->
651 ModuleBadEnd row col ->
652− case Code.whatIsNext source row col of
652+ if col == 1
653− Code.Keyword keyword ->
653+ then toDeclStartReport source row col
654− let
654+ else toWeirdEndReport source row col
655− region = toKeywordRegion row col keyword
657− Report.Report "RESERVED WORD" region [] $
658− Code.toSnippet source region Nothing
661− "I got stuck on this reserved word:"
664− "The name `" ++ keyword ++ "` is reserved, so try using a different name?"
669− region = toKeywordRegion row col op
671− Report.Report "UNEXPECTED SYMBOL" region [] $
672− Code.toSnippet source region Nothing
675− "I ran into an unexpected symbol:"
678− "I was not expecting to see a " ++ op ++ " here. Try deleting it? Maybe\
679− \ I can give a better hint from there?"
682− Code.Close term bracket ->
684− region = toRegion row col
686− Report.Report ("UNEXPECTED " ++ map Char.toUpper term) region [] $
687− Code.toSnippet source region Nothing
690− "I ran into an unexpected " ++ term ++ ":"
693− "This " ++ bracket : " does not match up with an earlier open " ++ term ++ ". Try deleting it?"
698− region = toKeywordRegion row col (c:cs)
700− Report.Report "UNEXPECTED NAME" region [] $
701− Code.toSnippet source region Nothing
704− "I got stuck on this name:"
707− "It is confusing me a lot! Normally I can give fairly specific hints, but\
708− \ something is really tripping me up this time."
713− region = toKeywordRegion row col (c:cs)
715− Report.Report "UNEXPECTED NAME" region [] $
716− Code.toSnippet source region Nothing
719− "I got stuck on this name:"
722− "It is confusing me a lot! Normally I can give fairly specific hints, but\
723− \ something is really tripping me up this time."
726− Code.Other maybeChar ->
728− region = toRegion row col
732− Report.Report "UNEXPECTED SEMICOLON" region [] $
733− Code.toSnippet source region Nothing
736− "I got stuck on this semicolon:"
739− [ D.reflow $ "Try removing it?"
741− "Some languages require semicolons at the end of each statement. These are\
742− \ often called C-like languages, and they usually share a lot of language design\
743− \ choices. (E.g. side-effects, for loops, etc.) Elm manages effects with commands\
744− \ and subscriptions instead, so there is no special syntax for \"statements\" and\
745− \ therefore no need to use semicolons to separate them. I think this will make\
746− \ more sense as you work through <https://guide.elm-lang.org> though!"
751− Report.Report "UNEXPECTED COMMA" region [] $
752− Code.toSnippet source region Nothing
755− "I got stuck on this comma:"
759− "I do not think I am parsing a list or tuple right now. Try deleting the comma?"
761− "If this is supposed to be part of a list, the problem may be a bit earlier.\
762− \ Perhaps the opening [ is missing? Or perhaps some value in the list has an extra\
763− \ closing ] that is making me think the list ended earlier? The same kinds of\
764− \ things could be going wrong if this is supposed to be a tuple."
769− Report.Report "UNEXPECTED CHARACTER" region [] $
770− Code.toSnippet source region Nothing
773− "I got stuck on this character:"
777− "It is not used for anything in Elm syntax. It is used for multi-line strings in\
778− \ some languages though, so if you want a string that spans multiple lines, you\
779− \ can use Elm's multi-line string syntax like this:"
780− , D.dullyellow $ D.indent 4 $ D.vcat $
782− , "# Multi-line Strings"
784− , "- start with triple double quotes"
785− , "- write whatever you want"
786− , "- no need to escape newlines or double quotes"
787− , "- end with triple double quotes"
791− "Otherwise I do not know what is going on! Try removing the character?"
796− Report.Report "UNEXPECTED SYMBOL" region [] $
797− Code.toSnippet source region Nothing
800− "I got stuck on this dollar sign:"
803− "It is not used for anything in Elm syntax. Are you coming from a language where\
804− \ dollar signs can be used in variable names? If so, try a name that (1) starts\
805− \ with a letter and (2) only contains letters, numbers, and underscores."
808− Just c | elem c ['#','@','!','%','~'] ->
809− Report.Report "UNEXPECTED SYMBOL" region [] $
810− Code.toSnippet source region Nothing
813− "I got stuck on this symbol:"
816− "It is not used for anything in Elm syntax. Try removing it?"
820− Report.Report "SYNTAX PROBLEM" region [] $
821− Code.toSnippet source region Nothing
827− "Whatever I am running into is confusing me a lot! Normally I can give fairly\
828− \ specific hints, but something is really tripping me up this time."
831 ModuleProblem row col ->
656 ModuleProblem row col ->
@@ -1010,6 +835,7 @@ toParseErrorReport source modul =
1011 , D.reflow $
836 , D.reflow $
1012 "Notice that the module names all start with capital letters. That is required!"
837 "Notice that the module names all start with capital letters. That is required!"
838+ , D.reflowLink "Read" "imports" "to learn more."
@@ -1036,6 +862,7 @@ toParseErrorReport source modul =
1037 , D.reflow $
863 , D.reflow $
1038 "Notice that the alias always starts with a capital letter. That is required!"
864 "Notice that the alias always starts with a capital letter. That is required!"
865+ , D.reflowLink "Read" "imports" "to learn more."
@@ -1098,6 +925,192 @@ toParseErrorReport source modul =
931+toWeirdEndReport :: Code.Source -> Row -> Col -> Report.Report
932+toWeirdEndReport source row col =
933+ case Code.whatIsNext source row col of
934+ Code.Keyword keyword ->
936+ region = toKeywordRegion row col keyword
938+ Report.Report "RESERVED WORD" region [] $
939+ Code.toSnippet source region Nothing
942+ "I got stuck on this reserved word:"
945+ "The name `" ++ keyword ++ "` is reserved, so try using a different name?"
950+ region = toKeywordRegion row col op
952+ Report.Report "UNEXPECTED SYMBOL" region [] $
953+ Code.toSnippet source region Nothing
956+ "I ran into an unexpected symbol:"
959+ "I was not expecting to see a " ++ op ++ " here. Try deleting it? Maybe\
960+ \ I can give a better hint from there?"
963+ Code.Close term bracket ->
965+ region = toRegion row col
967+ Report.Report ("UNEXPECTED " ++ map Char.toUpper term) region [] $
968+ Code.toSnippet source region Nothing
971+ "I ran into an unexpected " ++ term ++ ":"
974+ "This " ++ bracket : " does not match up with an earlier open " ++ term ++ ". Try deleting it?"
979+ region = toKeywordRegion row col (c:cs)
981+ Report.Report "UNEXPECTED NAME" region [] $
982+ Code.toSnippet source region Nothing
985+ "I got stuck on this name:"
988+ "It is confusing me a lot! Normally I can give fairly specific hints, but\
989+ \ something is really tripping me up this time."
994+ region = toKeywordRegion row col (c:cs)
996+ Report.Report "UNEXPECTED NAME" region [] $
997+ Code.toSnippet source region Nothing
1000+ "I got stuck on this name:"
1003+ "It is confusing me a lot! Normally I can give fairly specific hints, but\
1004+ \ something is really tripping me up this time."
1007+ Code.Other maybeChar ->
1009+ region = toRegion row col
1013+ Report.Report "UNEXPECTED SEMICOLON" region [] $
1014+ Code.toSnippet source region Nothing
1017+ "I got stuck on this semicolon:"
1020+ [ D.reflow $ "Try removing it?"
1022+ "Some languages require semicolons at the end of each statement. These are\
1023+ \ often called C-like languages, and they usually share a lot of language design\
1024+ \ choices. (E.g. side-effects, for loops, etc.) Elm manages effects with commands\
1025+ \ and subscriptions instead, so there is no special syntax for \"statements\" and\
1026+ \ therefore no need to use semicolons to separate them. I think this will make\
1027+ \ more sense as you work through <https://guide.elm-lang.org> though!"
1032+ Report.Report "UNEXPECTED COMMA" region [] $
1033+ Code.toSnippet source region Nothing
1036+ "I got stuck on this comma:"
1040+ "I do not think I am parsing a list or tuple right now. Try deleting the comma?"
1042+ "If this is supposed to be part of a list, the problem may be a bit earlier.\
1043+ \ Perhaps the opening [ is missing? Or perhaps some value in the list has an extra\
1044+ \ closing ] that is making me think the list ended earlier? The same kinds of\
1045+ \ things could be going wrong if this is supposed to be a tuple."
1050+ Report.Report "UNEXPECTED CHARACTER" region [] $
1051+ Code.toSnippet source region Nothing
1054+ "I got stuck on this character:"
1058+ "It is not used for anything in Elm syntax. It is used for multi-line strings in\
1059+ \ some languages though, so if you want a string that spans multiple lines, you\
1060+ \ can use Elm's multi-line string syntax like this:"
1061+ , D.dullyellow $ D.indent 4 $ D.vcat $
1063+ , "# Multi-line Strings"
1065+ , "- start with triple double quotes"
1066+ , "- write whatever you want"
1067+ , "- no need to escape newlines or double quotes"
1068+ , "- end with triple double quotes"
1072+ "Otherwise I do not know what is going on! Try removing the character?"
1077+ Report.Report "UNEXPECTED SYMBOL" region [] $
1078+ Code.toSnippet source region Nothing
1081+ "I got stuck on this dollar sign:"
1084+ "It is not used for anything in Elm syntax. Are you coming from a language where\
1085+ \ dollar signs can be used in variable names? If so, try a name that (1) starts\
1086+ \ with a letter and (2) only contains letters, numbers, and underscores."
1089+ Just c | elem c ['#','@','!','%','~'] ->
1090+ Report.Report "UNEXPECTED SYMBOL" region [] $
1091+ Code.toSnippet source region Nothing
1094+ "I got stuck on this symbol:"
1097+ "It is not used for anything in Elm syntax. Try removing it?"
1101+ Report.Report "SYNTAX PROBLEM" region [] $
1102+ Code.toSnippet source region Nothing
1105+ "I got stuck here:"
1108+ "Whatever I am running into is confusing me a lot! Normally I can give fairly\
1109+ \ specific hints, but something is really tripping me up this time."
1101-- IMPORTS
1114-- IMPORTS
@@ -1123,6 +1136,7 @@ toImportReport source row col =
1124 , D.reflow $
1137 , D.reflow $
1125 "You are probably trying to import a different module, but try to make it look like one of these examples!"
1138 "You are probably trying to import a different module, but try to make it look like one of these examples!"
1139+ , D.reflowLink "Read" "imports" "to learn more."
@@ -1429,189 +1443,194 @@ toDeclarationsReport :: Code.Source -> Decl -> Report.Report
1429toDeclarationsReport source decl =
1443toDeclarationsReport source decl =
1430 case decl of
1444 case decl of
1431 DeclStart row col ->
1445 DeclStart row col ->
1432− case Code.whatIsNext source row col of
1446+ toDeclStartReport source row col
1433− Code.Close term bracket ->
1435− region = toRegion row col
1437− Report.Report ("STRAY " ++ map Char.toUpper term) region [] $
1438− Code.toSnippet source region Nothing
1441− "I was not expecting to see a " ++ term ++ " here:"
1443− "This " ++ bracket : " does not match up with an earlier open " ++ term ++ ". Try deleting it?"
1446− Code.Keyword keyword ->
1448+ DeclSpace space row col ->
1447− let
1449+ toSpaceReport source space row col
1448− region = toKeywordRegion row col keyword
1450− Report.Report "RESERVED WORD" region [] $
1451− Code.toSnippet source region Nothing
1454− "I was not expecting to run into the `" ++ keyword ++ "` keyword here:"
1459− "It is reserved for declaring imports at the top of your module. If you want\
1460− \ another import, try moving it up top with the other imports. If you want to\
1461− \ define a value or function, try changing the name to something else!"
1466− "It is reserved for writing `case` expressions. Try using a different name?"
1468− "If you are trying to write a `case` expression, it needs to be part of a\
1469− \ definition. So you could write something like this instead:"
1470− , D.indent 4 $ D.vcat $
1471− [ D.indent 0 $ D.fillSep ["getWidth","maybeWidth","="]
1472− , D.indent 2 $ D.fillSep [D.cyan "case","maybeWidth",D.cyan "of"]
1473− , D.indent 4 $ D.fillSep [D.blue "Just","width","->"]
1474− , D.indent 6 $ D.fillSep ["width","+",D.dullyellow "200"]
1476− , D.indent 4 $ D.fillSep [D.blue "Nothing","->"]
1477− , D.indent 6 $ D.fillSep [D.dullyellow "400"]
1480− "This defines a `getWidth` function that you can use elsewhere in your program."
1483− "if" ->
1451+ Port port_ row col ->
1484− D.stack
1452+ toPortReport source port_ row col
1486− "It is reserved for writing `if` expressions. Try using a different name?"
1488− "If you are trying to write an `if` expression, it needs to be part of a\
1489− \ definition. So you could write something like this instead:"
1490− , D.indent 4 $ D.vcat $
1494− ,D.cyan "if","name","==",D.dullyellow "\"Abraham Lincoln\""
1495− ,D.cyan "then",D.dullyellow "\"Greetings Mr. President.\""
1496− ,D.cyan "else",D.dullyellow "\"Hey!\""
1500− "This defines a `reviewPowerLevel` function that you can use elsewhere in your program."
1503− _ ->
1454+ DeclType declType row col ->
1504− D.reflow $
1455+ toDeclTypeReport source declType row col
1505− "It is a reserved word. Try changing the name to something else?"
1508− Code.Upper c cs ->
1457+ DeclDef name declDef row col ->
1509− let
1458+ toDeclDefReport source name declDef row col
1510− region = toRegion row col
1512− Report.Report "UNEXPECTED CAPITAL LETTER" region [] $
1513− Code.toSnippet source region Nothing
1516− "Declarations always start with a lower-case letter, so I am getting stuck here:"
1520− ["Try","a","name","like"
1521− ,D.green (D.fromChars (Char.toLower c : cs))
1525− "Here are a couple valid declarations for reference:"
1526− , D.indent 4 $ D.vcat $
1527− [ "greet : String -> String"
1529− , " " <> D.dullyellow "\"Hello \"" <> " ++ name ++ " <> D.dullyellow "\"!\""
1531− , D.cyan "type" <> " User = Anonymous | LoggedIn String"
1534− "Notice that they always start with a lower-case letter. Capitalization matters!"
1538− Code.Other (Just char) | elem char ['(', '{', '[', '+', '-', '*', '/', '^', '&', '|', '"', '\'', '!', '@', '#', '$', '%'] ->
1460+ DeclFreshLineAfterDocComment row col ->
1462+ region = toRegion row col
1464+ Report.Report "EXPECTING DECLARATION" region [] $
1465+ Code.toSnippet source region Nothing
1468+ "I just saw a doc comment, but then I got stuck here:"
1471+ "I was expecting to see the corresponding declaration next, starting on a fresh\
1472+ \ line with no indentation."
1476+toDeclStartReport :: Code.Source -> Row -> Col -> Report.Report
1477+toDeclStartReport source row col =
1478+ case Code.whatIsNext source row col of
1479+ Code.Close term bracket ->
1481+ region = toRegion row col
1483+ Report.Report ("STRAY " ++ map Char.toUpper term) region [] $
1484+ Code.toSnippet source region Nothing
1487+ "I was not expecting to see a " ++ term ++ " here:"
1489+ "This " ++ bracket : " does not match up with an earlier open " ++ term ++ ". Try deleting it?"
1492+ Code.Keyword keyword ->
1540− region = toRegion row col
1494+ region = toKeywordRegion row col keyword
1542− Report.Report "UNEXPECTED SYMBOL" region [] $
1496+ Report.Report "RESERVED WORD" region [] $
1543− Code.toSnippet source region Nothing
1497+ Code.toSnippet source region Nothing
1500+ "I was not expecting to run into the `" ++ keyword ++ "` keyword here:"
1545 D.reflow $
1504 D.reflow $
1546− "I am getting stuck because this line starts with the " ++ [char] ++ " symbol:"
1505+ "It is reserved for declaring imports at the top of your module. If you want\
1547− ,
1506+ \ another import, try moving it up top with the other imports. If you want to\
1507+ \ define a value or function, try changing the name to something else!"
1549 [ D.reflow $
1511 [ D.reflow $
1550− "When a line has no spaces at the beginning, I expect it to be a declaration like one of these:"
1512+ "It is reserved for writing `case` expressions. Try using a different name?"
1514+ "If you are trying to write a `case` expression, it needs to be part of a\
1515+ \ definition. So you could write something like this instead:"
1551 , D.indent 4 $ D.vcat $
1516 , D.indent 4 $ D.vcat $
1552− [ "greet : String -> String"
1517+ [ D.indent 0 $ D.fillSep ["getWidth","maybeWidth","="]
1553− , "greet name ="
1518+ , D.indent 2 $ D.fillSep [D.cyan "case","maybeWidth",D.cyan "of"]
1554− , " " <> D.dullyellow "\"Hello \"" <> " ++ name ++ " <> D.dullyellow "\"!\""
1519+ , D.indent 4 $ D.fillSep [D.blue "Just","width","->"]
1520+ , D.indent 6 $ D.fillSep ["width","+",D.dullyellow "200"]
1556− , D.cyan "type" <> " User = Anonymous | LoggedIn String"
1522+ , D.indent 4 $ D.fillSep [D.blue "Nothing","->"]
1523+ , D.indent 6 $ D.fillSep [D.dullyellow "400"]
1558 , D.reflow $
1525 , D.reflow $
1559− "If this is not supposed to be a declaration, try adding some spaces before it?"
1526+ "This defines a `getWidth` function that you can use elsewhere in your program."
1565− region = toRegion row col
1567− Report.Report "WEIRD DECLARATION" region [] $
1568− Code.toSnippet source region Nothing
1571− "I am trying to parse a declaration, but I am getting stuck here:"
1574 [ D.reflow $
1531 [ D.reflow $
1575− "I am not sure what is going wrong, so here are a couple valid declarations for reference:"
1532+ "It is reserved for writing `if` expressions. Try using a different name?"
1534+ "If you are trying to write an `if` expression, it needs to be part of a\
1535+ \ definition. So you could write something like this instead:"
1576 , D.indent 4 $ D.vcat $
1536 , D.indent 4 $ D.vcat $
1577− [ "greet : String -> String"
1537+ [ "greet name ="
1578− , "greet name ="
1538+ , D.fillSep $
1540+ ,D.cyan "if","name","==",D.dullyellow "\"Abraham Lincoln\""
1541+ ,D.cyan "then",D.dullyellow "\"Greetings Mr. President.\""
1579− , " " <> D.dullyellow "\"Hello \"" <> " ++ name ++ " <> D.dullyellow "\"!\""
1542+ ,D.cyan "else",D.dullyellow "\"Hey!\""
1581− , D.cyan "type" <> " User = Anonymous | LoggedIn String"
1583 , D.reflow $
1545 , D.reflow $
1584− "Try to make your declaration look like one of those?"
1546+ "This defines a `reviewPowerLevel` function that you can use elsewhere in your program."
1588− DeclSpace space row col ->
1589− toSpaceReport source space row col
1591− Port port_ row col ->
1592− toPortReport source port_ row col
1594− DeclType declType row col ->
1595− toDeclTypeReport source declType row col
1597− DeclDef name declDef row col ->
1549+ _ ->
1598− toDeclDefReport source name declDef row col
1550+ D.reflow $
1551+ "It is a reserved word. Try changing the name to something else?"
1600− DeclFreshLineAfterDocComment row col ->
1554+ Code.Upper c cs ->
1602 region = toRegion row col
1556 region = toRegion row col
1604− Report.Report "EXPECTING DECLARATION" region [] $
1558+ Report.Report "UNEXPECTED CAPITAL LETTER" region [] $
1605 Code.toSnippet source region Nothing
1559 Code.toSnippet source region Nothing
1607 D.reflow $
1561 D.reflow $
1608− "I just saw a doc comment, but then I got stuck here:"
1562+ "Declarations always start with a lower-case letter, so I am getting stuck here:"
1566+ ["Try","a","name","like"
1567+ ,D.green (D.fromChars (Char.toLower c : cs))
1571+ "Here are a couple valid declarations for reference:"
1572+ , D.indent 4 $ D.vcat $
1573+ [ "greet : String -> String"
1575+ , " " <> D.dullyellow "\"Hello \"" <> " ++ name ++ " <> D.dullyellow "\"!\""
1577+ , D.cyan "type" <> " User = Anonymous | LoggedIn String"
1580+ "Notice that they always start with a lower-case letter. Capitalization matters!"
1584+ Code.Other (Just char) | elem char ['(', '{', '[', '+', '-', '*', '/', '^', '&', '|', '"', '\'', '!', '@', '#', '$', '%'] ->
1586+ region = toRegion row col
1588+ Report.Report "UNEXPECTED SYMBOL" region [] $
1589+ Code.toSnippet source region Nothing
1610 D.reflow $
1591 D.reflow $
1611− "I was expecting to see the corresponding declaration next, starting on a fresh\
1592+ "I am getting stuck because this line starts with the " ++ [char] ++ " symbol:"
1612− \ line with no indentation."
1593+ ,
1596+ "When a line has no spaces at the beginning, I expect it to be a declaration like one of these:"
1597+ , D.indent 4 $ D.vcat $
1598+ [ "greet : String -> String"
1600+ , " " <> D.dullyellow "\"Hello \"" <> " ++ name ++ " <> D.dullyellow "\"!\""
1602+ , D.cyan "type" <> " User = Anonymous | LoggedIn String"
1605+ "If this is not supposed to be a declaration, try adding some spaces before it?"
1611+ region = toRegion row col
1613+ Report.Report "WEIRD DECLARATION" region [] $
1614+ Code.toSnippet source region Nothing
1617+ "I am trying to parse a declaration, but I am getting stuck here:"
1621+ "When a line has no spaces at the beginning, I expect it to be a declaration like one of these:"
1622+ , D.indent 4 $ D.vcat $
1623+ [ "greet : String -> String"
1625+ , " " <> D.dullyellow "\"Hello \"" <> " ++ name ++ " <> D.dullyellow "\"!\""
1627+ , D.cyan "type" <> " User = Anonymous | LoggedIn String"
1630+ "Try to make your declaration look like one of those? Or if this is not\
1631+ \ supposed to be a declaration, try adding some spaces before it?"
@@ -2572,7 +2591,7 @@ toExprReport source context expr startRow startCol =
2572 ,"give","a","more","specific","hint!"
2591 ,"give","a","more","specific","hint!"
2574 , D.toSimpleNote $
2593 , D.toSimpleNote $
2575− "This can also happen if run into reserved words like `let` or `as` unexpectedly.\
2594+ "This can also happen if I run into reserved words like `let` or `as` unexpectedly.\
2576 \ Or if I run into operators in unexpected spots. Point is, there are a\
2595 \ Or if I run into operators in unexpected spots. Point is, there are a\
2577 \ couple ways I can get confused and give sort of weird advice!"
2596 \ couple ways I can get confused and give sort of weird advice!"
@@ -4127,11 +4146,13 @@ toRecordReport source context record startRow startCol =
4127 D.reflow $
4146 D.reflow $
4128 "I just saw the opening curly brace of a record, but then I got stuck here:"
4147 "I just saw the opening curly brace of a record, but then I got stuck here:"
4130− addNoteForRecordIndentError $
4149+ D.stack
4131− D.fillSep $
4150+ [ D.fillSep $
4132− ["I","am","expecting","a","record","like",D.dullyellow "{ x = 3, y = 4 }","here."
4151+ ["I","am","expecting","a","record","like",D.dullyellow "{ x = 3, y = 4 }","here."
4133− ,"Try","defining","some","fields","of","your","own?"
4152+ ,"Try","defining","some","fields","of","your","own?"
4154+ , noteForRecordIndentError
4137 RecordIndentEnd row col ->
4158 RecordIndentEnd row col ->
@@ -4165,11 +4186,13 @@ toRecordReport source context record startRow startCol =
4165 D.reflow $
4186 D.reflow $
4166 "I was partway through parsing a record, but I got stuck here:"
4187 "I was partway through parsing a record, but I got stuck here:"
4168− addNoteForRecordIndentError $
4189+ D.stack
4169− D.fillSep $
4190+ [ D.fillSep $
4170− ["I","was","expecting","to","see","a","closing","curly","brace","next."
4191+ ["I","was","expecting","to","see","a","closing","curly","brace","next."
4171− ,"Try","putting","a",D.green "}","next","and","see","if","that","helps?"
4192+ ,"Try","putting","a",D.green "}","next","and","see","if","that","helps?"
4194+ , noteForRecordIndentError
4175 RecordIndentField row col ->
4198 RecordIndentField row col ->
@@ -4204,10 +4227,12 @@ toRecordReport source context record startRow startCol =
4204 "I am partway through parsing a record. I just saw a record\
4227 "I am partway through parsing a record. I just saw a record\
4205 \ field, so I was expecting to see an equals sign next:"
4228 \ field, so I was expecting to see an equals sign next:"
4207− addNoteForRecordIndentError $
4230+ D.stack
4208− D.fillSep $
4231+ [ D.fillSep $
4209− ["Try","putting","an",D.green "=","followed","by","an","expression?"
4232+ ["Try","putting","an",D.green "=","followed","by","an","expression?"
4234+ , noteForRecordIndentError
4213 RecordIndentExpr row col ->
4238 RecordIndentExpr row col ->
@@ -4221,11 +4246,13 @@ toRecordReport source context record startRow startCol =
4221 D.reflow $
4246 D.reflow $
4222 "I am partway through parsing a record, and I was expecting to run into an expression next:"
4247 "I am partway through parsing a record, and I was expecting to run into an expression next:"
4224− addNoteForRecordIndentError $
4249+ D.stack
4225− D.fillSep $
4250+ [ D.fillSep $
4226− ["Try","putting","something","like"
4251+ ["Try","putting","something","like"
4227− ,D.dullyellow "42","or",D.dullyellow"\"hello\"","for","now?"
4252+ ,D.dullyellow "42","or",D.dullyellow"\"hello\"","for","now?"
4254+ , noteForRecordIndentError
@@ -4246,11 +4273,9 @@ noteForRecordError =
4249−addNoteForRecordIndentError :: D.Doc -> D.Doc
4276+noteForRecordIndentError :: D.Doc
4250−addNoteForRecordIndentError normalRecommendation =
4277+noteForRecordIndentError =
4251− D.stack $
4278+ D.stack
4252− normalRecommendation
4254 [ D.toSimpleNote
4279 [ D.toSimpleNote
4255 "I may be confused by indentation. For example, if you are trying to define\
4280 "I may be confused by indentation. For example, if you are trying to define\
4256 \ a record across multiple lines, I recommend using this format:"
4281 \ a record across multiple lines, I recommend using this format:"