@@ -224,7 +224,6 @@ data Expr
224224 | EndlessShader Row Col
225225 | ShaderProblem [Char.Char] Row Col
226226 | IndentOperatorRight Name.Name Row Col
227− | IndentMoreExpr Row Col
228227
229228
230229data Record
@@ -2337,9 +2336,6 @@ toExprReport source context expr startRow startCol =
23372336 ]
23382337 )
23392338
2340− IndentMoreExpr _ _ ->
2341− error "TODO IndentMoreExpr"
2342−
23432339
23442340
23452341-- CHAR
@@ -4270,8 +4266,41 @@ toPatternReport source context pattern startRow startCol =
42704266 "This is a reserved word! Try using some other name?"
42714267 )
42724268
4269+ Code.Operator "-" ->
4270+ let
4271+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
4272+ region = toRegion row col
4273+ in
4274+ Report.Report "UNEXPECTED SYMBOL" region [] $
4275+ Code.toSnippet source surroundings (Just region)
4276+ (
4277+ D.reflow $
4278+ "I ran into a minus sign unexpectedly in this pattern:"
4279+ ,
4280+ D.reflow $
4281+ "It is not possible to pattern match on negative numbers at this\
4282+ \ time. Try using an `if` expression for that sort of thing for now."
4283+ )
4284+
42734285 _ ->
4274− error "TODO PStart"
4286+ let
4287+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
4288+ region = toRegion row col
4289+ in
4290+ Report.Report "PROBLEM IN PATTERN" region [] $
4291+ Code.toSnippet source surroundings (Just region)
4292+ (
4293+ D.reflow $
4294+ "I wanted to parse a pattern next, but I got stuck here:"
4295+ ,
4296+ D.fillSep $
4297+ ["I","am","not","sure","why","I","am","getting","stuck","exactly."
4298+ ,"I","just","know","that","I","want","a","pattern","next."
4299+ ,"Something","as","simple","as"
4300+ ,D.dullyellow "maybeHeight","or",D.dullyellow "result"
4301+ ,"would","work!"
4302+ ]
4303+ )
42754304
42764305 PChar char row col ->
42774306 toCharReport source char row col
@@ -4348,7 +4377,29 @@ toPatternReport source context pattern startRow startCol =
43484377 toSpaceReport source space row col
43494378
43504379 PIndentStart row col ->
4351− error "TODO PIndentStart" row col
4380+ let
4381+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
4382+ region = toRegion row col
4383+ in
4384+ Report.Report "UNFINISHED PATTERN" region [] $
4385+ Code.toSnippet source surroundings (Just region)
4386+ (
4387+ D.reflow $
4388+ "I wanted to parse a pattern next, but I got stuck here:"
4389+ ,
4390+ D.stack
4391+ [ D.fillSep $
4392+ ["I","am","not","sure","why","I","am","getting","stuck","exactly."
4393+ ,"I","just","know","that","I","want","a","pattern","next."
4394+ ,"Something","as","simple","as"
4395+ ,D.dullyellow "maybeHeight","or",D.dullyellow "result"
4396+ ,"would","work!"
4397+ ]
4398+ , D.toSimpleNote $
4399+ "I can get confused by indentation. If you think there is a pattern next, maybe\
4400+ \ it needs to be indented a bit more?"
4401+ ]
4402+ )
43524403
43534404 PIndentAlias row col ->
43544405 let