on master help sign in
Code.whatIsNext produces slightly more useful values
commit894fc40d7ed99c34db27a40b08d5c34b646dd960 authorEvan Czaplicki <evancz@users.noreply.github.com> dateFri 17 May 2019, 15:07 (7 years ago) parent3cb82f2
1 file changed+5−10
compiler/src/Reporting/Render/Code.hs+5−10
compiler/src/Reporting/Render/Code.hs+5−10
@@ -196,12 +196,9 @@ renderPair source@(Source sourceLines) region1 region2 =
196196
197197
198198data Next
199− = Spaces
200− | Keyword [Char]
199+ = Keyword [Char]
201200 | Operator [Char]
202− | CloseParen
203− | CloseSquare
204− | CloseCurly
201+ | Close [Char] Char
205202 | Other
206203
207204
@@ -226,11 +223,9 @@ whatIsNext (Source sourceLines) row col =
226223 Operator op
227224
228225 []
229− | null chars -> Spaces
230− | isNext ' ' chars -> Spaces
231− | isNext ')' chars -> CloseParen
232− | isNext ']' chars -> CloseSquare
233− | isNext '}' chars -> CloseCurly
226+ | isNext ')' chars -> Close "parenthesis" ')'
227+ | isNext ']' chars -> Close "square bracket" ']'
228+ | isNext '}' chars -> Close "curly brace" '}'
234229 | otherwise -> Other
235230
236231