on master help sign in
switch from addNoteFor_ to noteFor_ style
95527ebEvan Czaplicki
compiler/src/Reporting/Error/Syntax.hs+30−24
@@ -4127,11 +4127,13 @@ toRecordReport source context record startRow startCol =
4127 D.reflow $
4127 D.reflow $
4128 "I just saw the opening curly brace of a record, but then I got stuck here:"
4128 "I just saw the opening curly brace of a record, but then I got stuck here:"
4129 ,
4129 ,
4130− addNoteForRecordIndentError $
4130+ D.stack
4131− D.fillSep $
4131+ [ D.fillSep $
4132− ["I","am","expecting","a","record","like",D.dullyellow "{ x = 3, y = 4 }","here."
4132+ ["I","am","expecting","a","record","like",D.dullyellow "{ x = 3, y = 4 }","here."
4133− ,"Try","defining","some","fields","of","your","own?"
4133+ ,"Try","defining","some","fields","of","your","own?"
4134+ ]
4135+ , noteForRecordIndentError
4134− ]
4136+ ]
4135 )
4137 )
4136
4138
4137 RecordIndentEnd row col ->
4139 RecordIndentEnd row col ->
@@ -4165,11 +4167,13 @@ toRecordReport source context record startRow startCol =
4165 D.reflow $
4167 D.reflow $
4166 "I was partway through parsing a record, but I got stuck here:"
4168 "I was partway through parsing a record, but I got stuck here:"
4167 ,
4169 ,
4168− addNoteForRecordIndentError $
4170+ D.stack
4169− D.fillSep $
4171+ [ D.fillSep $
4170− ["I","was","expecting","to","see","a","closing","curly","brace","next."
4172+ ["I","was","expecting","to","see","a","closing","curly","brace","next."
4171− ,"Try","putting","a",D.green "}","next","and","see","if","that","helps?"
4173+ ,"Try","putting","a",D.green "}","next","and","see","if","that","helps?"
4174+ ]
4175+ , noteForRecordIndentError
4172− ]
4176+ ]
4173 )
4177 )
4174
4178
4175 RecordIndentField row col ->
4179 RecordIndentField row col ->
@@ -4204,10 +4208,12 @@ toRecordReport source context record startRow startCol =
4204 "I am partway through parsing a record. I just saw a record\
4208 "I am partway through parsing a record. I just saw a record\
4205 \ field, so I was expecting to see an equals sign next:"
4209 \ field, so I was expecting to see an equals sign next:"
4206 ,
4210 ,
4207− addNoteForRecordIndentError $
4211+ D.stack
4208− D.fillSep $
4212+ [ D.fillSep $
4209− ["Try","putting","an",D.green "=","followed","by","an","expression?"
4213+ ["Try","putting","an",D.green "=","followed","by","an","expression?"
4214+ ]
4215+ , noteForRecordIndentError
4210− ]
4216+ ]
4211 )
4217 )
4212
4218
4213 RecordIndentExpr row col ->
4219 RecordIndentExpr row col ->
@@ -4221,11 +4227,13 @@ toRecordReport source context record startRow startCol =
4221 D.reflow $
4227 D.reflow $
4222 "I am partway through parsing a record, and I was expecting to run into an expression next:"
4228 "I am partway through parsing a record, and I was expecting to run into an expression next:"
4223 ,
4229 ,
4224− addNoteForRecordIndentError $
4230+ D.stack
4225− D.fillSep $
4231+ [ D.fillSep $
4226− ["Try","putting","something","like"
4232+ ["Try","putting","something","like"
4227− ,D.dullyellow "42","or",D.dullyellow"\"hello\"","for","now?"
4233+ ,D.dullyellow "42","or",D.dullyellow"\"hello\"","for","now?"
4234+ ]
4235+ , noteForRecordIndentError
4228− ]
4236+ ]
4229 )
4237 )
4230
4238
4231
4239
@@ -4246,11 +4254,9 @@ noteForRecordError =
4246 ]
4254 ]
4247
4255
4248
4256
4249−addNoteForRecordIndentError :: D.Doc -> D.Doc
4257+noteForRecordIndentError :: D.Doc
4250−addNoteForRecordIndentError normalRecommendation =
4258+noteForRecordIndentError =
4251− D.stack $
4259+ D.stack
4252− normalRecommendation
4253− :
4254 [ D.toSimpleNote
4260 [ D.toSimpleNote
4255 "I may be confused by indentation. For example, if you are trying to define\
4261 "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:"
4262 \ a record across multiple lines, I recommend using this format:"