@@ -3233,7 +3233,7 @@ toPTupleReport source context tuple startRow startCol =
3233 surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
3233 surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
3234 region = toRegion row col
3234 region = toRegion row col
3236− Report.Report "UNFINISHED TUPLE" region [] $
3236+ Report.Report "UNFINISHED TUPLE PATTERN" region [] $
3237 Code.toSnippet source surroundings (Just region) $
3237 Code.toSnippet source surroundings (Just region) $
3239 D.reflow $
3239 D.reflow $
@@ -3256,10 +3256,49 @@ toPListReport :: Code.Source -> PContext -> PList -> Row -> Col -> Report.Report
3256toPListReport source context list startRow startCol =
3256toPListReport source context list startRow startCol =
3257 case list of
3257 case list of
3258 PListOpen row col ->
3258 PListOpen row col ->
3259− error "TODO PListOpen" row col startRow startCol
3259+ case Code.whatIsNext source row col of
3260+ Code.Keyword keyword ->
3262+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
3263+ region = toWiderRegion row col (fromIntegral (length keyword))
3265+ Report.Report "RESERVED WORD" region [] $
3266+ Code.toSnippet source surroundings (Just region)
3269+ "It looks like you are trying to use `" ++ keyword ++ "` to name an element of a list:"
3272+ "This is a reserved word though! Try using some other name?"
3277+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
3278+ region = toRegion row col
3280+ Report.Report "UNFINISHED LIST PATTERN" region [] $
3281+ Code.toSnippet source surroundings (Just region) $
3284+ "I just saw an open square bracket, but then I got stuck here:"
3286+ D.fillSep ["Try","adding","a",D.dullyellow "]","to","see","if","that","helps?"]
3261 PListEnd row col ->
3289 PListEnd row col ->
3262− error "TODO PListEnd" row col
3290+ let
3291+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
3292+ region = toRegion row col
3294+ Report.Report "UNFINISHED LIST PATTERN" region [] $
3295+ Code.toSnippet source surroundings (Just region) $
3298+ "I was expecting a closing square bracket to end this list pattern:"
3300+ D.fillSep ["Try","adding","a",D.dullyellow "]","to","see","if","that","helps?"]
3264 PListExpr pattern row col ->
3303 PListExpr pattern row col ->
3265 toPatternReport source context pattern row col
3304 toPatternReport source context pattern row col
@@ -3268,13 +3307,62 @@ toPListReport source context list startRow startCol =
3268 toSpaceReport source space row col
3307 toSpaceReport source space row col
3270 PListIndentOpen row col ->
3309 PListIndentOpen row col ->
3271− error "TODO PListIndentOpen" row col
3310+ let
3311+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
3312+ region = toRegion row col
3314+ Report.Report "UNFINISHED LIST PATTERN" region [] $
3315+ Code.toSnippet source surroundings (Just region) $
3318+ "I just saw an open square bracket, but then I got stuck here:"
3321+ [ D.fillSep ["Try","adding","a",D.dullyellow "]","to","see","if","that","helps?"]
3323+ "I can get confused by indentation in cases like this, so\
3324+ \ maybe there is something next, but it is not indented enough?"
3273 PListIndentEnd row col ->
3328 PListIndentEnd row col ->
3274− error "TODO PListIndentEnd" row col
3329+ let
3330+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
3331+ region = toRegion row col
3333+ Report.Report "UNFINISHED LIST PATTERN" region [] $
3334+ Code.toSnippet source surroundings (Just region) $
3337+ "I was expecting a closing square bracket to end this list pattern:"
3340+ [ D.fillSep ["Try","adding","a",D.dullyellow "]","to","see","if","that","helps?"]
3342+ "I can get confused by indentation in cases like this, so\
3343+ \ maybe you have a closing square bracket but it is not indented enough?"
3276 PListIndentExpr row col ->
3347 PListIndentExpr row col ->
3277− error "TODO PListIndentExpr" row col
3348+ let
3349+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
3350+ region = toRegion row col
3352+ Report.Report "UNFINISHED LIST PATTERN" region [] $
3353+ Code.toSnippet source surroundings (Just region) $
3356+ "I am partway through parsing a list pattern, but I got stuck here:"
3360+ "I was expecting to see another pattern next. Maybe a variable name."
3362+ "I can get confused by indentation in cases like this, so\
3363+ \ maybe there is more to this pattern but it is not indented enough?"