@@ -3977,21 +3977,42 @@ toRecordReport source context record startRow startCol =
39773977 )
39783978
39793979 RecordIndentEnd row col ->
3980- let
3981- surroundings = A. Region (A. Position startRow startCol) (A. Position row col)
3982- region = toRegion row col
3983- in
3984- Report. Report " UNFINISHED RECORD" region [] $
3985- Code. toSnippet source surroundings (Just region)
3986- (
3987- D. reflow $
3988- " I was expecting to see a closing curly brace next:"
3989- ,
3990- addNoteForRecordIndentError $
3991- D. fillSep $
3992- [" Try" ," putting" ," an" ,D. green " }" ," and" ," see" ," if" ," that" ," helps?"
3993- ]
3994- )
3980+ case Code. nextLineStartsWithCloseCurly source row of
3981+ Just (curlyRow, curlyCol) ->
3982+ let
3983+ surroundings = A. Region (A. Position startRow startCol) (A. Position curlyRow curlyCol)
3984+ region = toRegion curlyRow curlyCol
3985+ in
3986+ Report. Report " NEED MORE INDENTATION" region [] $
3987+ Code. toSnippet source surroundings (Just region)
3988+ (
3989+ D. reflow $
3990+ " I was partway through parsing a record, but I got stuck here:"
3991+ ,
3992+ D. stack
3993+ [ D. reflow $
3994+ " I need this curly brace to be indented more. Try adding some spaces before it!"
3995+ , noteForRecordError
3996+ ]
3997+ )
3998+
3999+ Nothing ->
4000+ let
4001+ surroundings = A. Region (A. Position startRow startCol) (A. Position row col)
4002+ region = toRegion row col
4003+ in
4004+ Report. Report " UNFINISHED RECORD" region [] $
4005+ Code. toSnippet source surroundings (Just region)
4006+ (
4007+ D. reflow $
4008+ " I was partway through parsing a record, but I got stuck here:"
4009+ ,
4010+ addNoteForRecordIndentError $
4011+ D. fillSep $
4012+ [" I" ," was" ," expecting" ," to" ," see" ," a" ," closing" ," curly" ," brace" ," next."
4013+ ," Try" ," putting" ," a" ,D. green " }" ," next" ," and" ," see" ," if" ," that" ," helps?"
4014+ ]
4015+ )
39954016
39964017 RecordIndentField row col ->
39974018 let
@@ -5384,23 +5405,44 @@ toTRecordReport source context record startRow startCol =
53845405 )
53855406
53865407 TRecordIndentEnd row col ->
5387- let
5388- surroundings = A. Region (A. Position startRow startCol) (A. Position row col)
5389- region = toRegion row col
5390- in
5391- Report. Report " UNFINISHED RECORD TYPE" region [] $
5392- Code. toSnippet source surroundings (Just region)
5393- (
5394- D. reflow $
5395- " I was expecting to see a closing curly brace next:"
5396- ,
5397- D. stack
5398- [ D. fillSep $
5399- [" Try" ," putting" ," an" ,D. green " }" ," and" ," see" ," if" ," that" ," helps?"
5408+ case Code. nextLineStartsWithCloseCurly source row of
5409+ Just (curlyRow, curlyCol) ->
5410+ let
5411+ surroundings = A. Region (A. Position startRow startCol) (A. Position curlyRow curlyCol)
5412+ region = toRegion curlyRow curlyCol
5413+ in
5414+ Report. Report " NEED MORE INDENTATION" region [] $
5415+ Code. toSnippet source surroundings (Just region)
5416+ (
5417+ D. reflow $
5418+ " I was partway through parsing a record type, but I got stuck here:"
5419+ ,
5420+ D. stack
5421+ [ D. reflow $
5422+ " I need this curly brace to be indented more. Try adding some spaces before it!"
5423+ , noteForRecordTypeError
54005424 ]
5401- , noteForRecordTypeIndentError
5402- ]
5403- )
5425+ )
5426+
5427+ Nothing ->
5428+ let
5429+ surroundings = A. Region (A. Position startRow startCol) (A. Position row col)
5430+ region = toRegion row col
5431+ in
5432+ Report. Report " UNFINISHED RECORD TYPE" region [] $
5433+ Code. toSnippet source surroundings (Just region)
5434+ (
5435+ D. reflow $
5436+ " I was partway through parsing a record type, but I got stuck here:"
5437+ ,
5438+ D. stack
5439+ [ D. fillSep $
5440+ [" I" ," was" ," expecting" ," to" ," see" ," a" ," closing" ," curly" ," brace" ," next."
5441+ ," Try" ," putting" ," a" ,D. green " }" ," next" ," and" ," see" ," if" ," that" ," helps?"
5442+ ]
5443+ , noteForRecordTypeIndentError
5444+ ]
5445+ )
54045446
54055447 TRecordIndentField row col ->
54065448 let
0 commit comments