@@ -101,7 +101,7 @@ string =
101101 !pos1 = plusPtr pos 1
102102 result =
103103 if isDoubleQuote pos1 end && isDoubleQuote (plusPtr pos 2) end then
104− multiString (plusPtr pos 3) end row (col + 3) (plusPtr pos 3) mempty
104+ multiString (plusPtr pos 3) end row (col + 3) (plusPtr pos 3) row col mempty
105105 else
106106 singleString pos1 end row (col + 1) pos1 mempty
107107 in
@@ -198,10 +198,10 @@ singleString pos end row col initialPos revChunks =
198198-- MULTI STRINGS
199199
200200
201−multiString :: Ptr Word8 -> Ptr Word8 -> Word16 -> Word16 -> Ptr Word8 -> [Utf8.Chunk] -> StringResult
202−multiString pos end row col initialPos revChunks =
201+multiString :: Ptr Word8 -> Ptr Word8 -> Word16 -> Word16 -> Ptr Word8 -> Word16 -> Word16 -> [Utf8.Chunk] -> StringResult
202+multiString pos end row col initialPos sr sc revChunks =
203203 if pos >= end then
204− Err row col E.StringEnd_Multi
204+ Err row col (E.StringEnd_Multi sr sc)
205205
206206 else
207207 let !word = P.unsafeIndex pos in
@@ -211,38 +211,38 @@ multiString pos end row col initialPos revChunks =
211211
212212 else if word == 0x27 {- ' -} then
213213 let !pos1 = plusPtr pos 1 in
214− multiString pos1 end row (col + 1) pos1 $
214+ multiString pos1 end row (col + 1) pos1 sr sc $
215215 addEscape singleQuote initialPos pos revChunks
216216
217217 else if word == 0x0A {- \n -} then
218218 let !pos1 = plusPtr pos 1 in
219− multiString pos1 end (row + 1) 1 pos1 $
219+ multiString pos1 end (row + 1) 1 pos1 sr sc $
220220 addEscape newline initialPos pos revChunks
221221
222222 else if word == 0x0D {- \r -} then
223223 let !pos1 = plusPtr pos 1 in
224− multiString pos1 end row col pos1 $
224+ multiString pos1 end row col pos1 sr sc $
225225 addEscape carriageReturn initialPos pos revChunks
226226
227227 else if word == 0x5C {- \ -} then
228228 case eatEscape (plusPtr pos 1) end col of
229229 EscapeNormal ->
230− multiString (plusPtr pos 2) end row (col + 2) initialPos revChunks
230+ multiString (plusPtr pos 2) end row (col + 2) initialPos sr sc revChunks
231231
232232 EscapeUnicode delta code ->
233233 let !newPos = plusPtr pos delta in
234− multiString newPos end row (col + fromIntegral delta) newPos $
234+ multiString newPos end row (col + fromIntegral delta) newPos sr sc $
235235 addEscape (Utf8.CodePoint code) initialPos pos revChunks
236236
237237 EscapeProblem x ->
238238 Err row col x
239239
240240 EscapeEndOfFile ->
241− Err row (col + 1) E.StringEnd_Multi
241+ Err row (col + 1) (E.StringEnd_Multi sr sc)
242242
243243 else
244244 let !newPos = plusPtr pos (P.getCharWidth pos end word) in
245− multiString newPos end row (col + 1) initialPos revChunks
245+ multiString newPos end row (col + 1) initialPos sr sc revChunks
246246
247247
248248
@@ -276,7 +276,7 @@ eatEscape pos end startCol =
276276eatUnicode :: Ptr Word8 -> Ptr Word8 -> Word16 -> Escape
277277eatUnicode pos end startCol =
278278 if pos >= end || P.unsafeIndex pos /= 0x7B {- { -} then
279− EscapeProblem $ E.BadUnicodeStart startCol (startCol + 1)
279+ EscapeProblem $ E.BadUnicodeFormat startCol (startCol + 1)
280280 else
281281 let
282282 !digitPos = plusPtr pos 1
@@ -284,16 +284,16 @@ eatUnicode pos end startCol =
284284 !numDigits = minusPtr newPos digitPos
285285 in
286286 if newPos >= end || P.unsafeIndex newPos /= 0x7D {- } -} then
287− EscapeProblem $ E.BadUnicodeEnd startCol $
287+ EscapeProblem $ E.BadUnicodeFormat startCol $
288288 startCol + fromIntegral (minusPtr newPos pos)
289289
290290 else if code < 0 || 0x10FFFF < code then
291− EscapeProblem $ E.BadUnicodeRange startCol $
291+ EscapeProblem $ E.BadUnicodeCode startCol $
292292 startCol + fromIntegral (minusPtr newPos pos) + 1
293293
294294 else if numDigits < 4 || 6 < numDigits then
295295 EscapeProblem $
296− E.BadUnicodeFormat
296+ E.BadUnicodeLength
297297 startCol
298298 (startCol + fromIntegral (minusPtr newPos pos) + 1)
299299 numDigits