@@ -36,14 +36,14 @@ fromByteString decoder src =
36 fromAST decoder (P.fromByteString pFile src)
36 fromAST decoder (P.fromByteString pFile src)
39−fromAST :: Decoder e a -> P.Result E.Context E.ParseExpectation AST -> Either (E.Error e) a
39+fromAST :: Decoder e a -> P.Result E.ParseError AST -> Either (E.Error e) a
40fromAST (Decoder decode) parserResult =
40fromAST (Decoder decode) parserResult =
41 case parserResult of
41 case parserResult of
42 P.Ok ast _ ->
42 P.Ok ast _ ->
43 decode ast Right (Left . E.DecodeProblem)
43 decode ast Right (Left . E.DecodeProblem)
45− P.Err row col ctx expectation ->
45+ P.Err err ->
46− Left (E.ParseProblem row col ctx expectation)
46+ Left (E.ParseProblem err)
@@ -51,7 +51,14 @@ fromAST (Decoder decode) parserResult =
53newtype Decoder e a =
53newtype Decoder e a =
54− Decoder (forall b. AST -> (a -> b) -> (E.Problem e -> b) -> b)
59+ -> (E.Problem e -> b)
@@ -352,7 +359,7 @@ data AST
354type Parser a =
361type Parser a =
355− P.Parser E.Context E.ParseExpectation a
362+ P.Parser E.ParseError a
358pFile :: Parser AST
365pFile :: Parser AST
@@ -379,9 +386,9 @@ pValue =
380endOfFile :: Parser ()
387endOfFile :: Parser ()
381endOfFile =
388endOfFile =
382− P.Parser $ \state@(P.State pos end _ row col ctx) _ eok _ eerr ->
389+ P.Parser $ \state@(P.State pos end _ row col) _ eok _ eerr ->
383 if pos < end then
390 if pos < end then
384− eerr row col ctx E.EndOfFile
391+ eerr row col E.EndOfFile
386 eok () state
393 eok () state
@@ -466,7 +473,7 @@ pArrayHelp !len revEntries =
467pString :: Parser Utf8.String
474pString :: Parser Utf8.String
469− P.Parser $ \(P.State pos end indent row col ctx) cok _ cerr eerr ->
476+ P.Parser $ \(P.State pos end indent row col) cok _ cerr eerr ->
470 if pos < end && P.unsafeIndex pos == 0x22 {-"-} then
477 if pos < end && P.unsafeIndex pos == 0x22 {-"-} then
@@ -478,16 +485,16 @@ pString =
478 case status of
485 case status of
479 GoodString ->
486 GoodString ->
481− !newState = P.State newPos end indent newRow newCol ctx
488+ !newState = P.State newPos end indent newRow newCol
482 !content = Utf8.fromPtr pos1 (plusPtr newPos (-1))
489 !content = Utf8.fromPtr pos1 (plusPtr newPos (-1))
484 cok content newState
491 cok content newState
486 BadStringEnd ->
493 BadStringEnd ->
487− cerr newRow newCol ctx E.StringEnd
494+ cerr newRow newCol E.StringEnd
490− eerr row col ctx E.StringStart
497+ eerr row col E.StringStart
493data StringStatus
500data StringStatus
@@ -534,7 +541,7 @@ pStringHelp pos end row col =
535spaces :: Parser ()
542spaces :: Parser ()
537− P.Parser $ \state@(P.State pos end indent row col ctx) cok eok _ _ ->
544+ P.Parser $ \state@(P.State pos end indent row col) cok eok _ _ ->
539 (# newPos, newRow, newCol #) =
546 (# newPos, newRow, newCol #) =
540 eatSpaces pos end row col
547 eatSpaces pos end row col
@@ -544,7 +551,7 @@ spaces =
546 !newState =
553 !newState =
547− P.State newPos end indent newRow newCol ctx
554+ P.State newPos end indent newRow newCol
549 cok () newState
556 cok () newState
@@ -570,27 +577,27 @@ eatSpaces pos end row col =
571pInt :: Parser AST
578pInt :: Parser AST
573− P.Parser $ \(P.State pos end indent row col ctx) cok _ cerr eerr ->
580+ P.Parser $ \(P.State pos end indent row col) cok _ cerr eerr ->
574 if pos >= end then
581 if pos >= end then
575− eerr row col ctx E.IntStart
582+ eerr row col E.IntStart
578 let !word = P.unsafeIndex pos in
585 let !word = P.unsafeIndex pos in
579 if not (isDecimalDigit word) then
586 if not (isDecimalDigit word) then
580− eerr row col ctx E.IntStart
587+ eerr row col E.IntStart
582 else if word == 0x30 {-0-} then
589 else if word == 0x30 {-0-} then
585 !pos1 = plusPtr pos 1
592 !pos1 = plusPtr pos 1
586− !newState = P.State pos1 end indent row (col + 1) ctx
593+ !newState = P.State pos1 end indent row (col + 1)
588 if pos1 < end then
595 if pos1 < end then
589 let !word1 = P.unsafeIndex pos1 in
596 let !word1 = P.unsafeIndex pos1 in
590 if isDecimalDigit word1 then
597 if isDecimalDigit word1 then
591− cerr row (col + 1) ctx E.NoLeadingZeros
598+ cerr row (col + 1) E.NoLeadingZeros
592 else if word1 == 0x2E {-.-} then
599 else if word1 == 0x2E {-.-} then
593− cerr row (col + 1) ctx E.NoFloats
600+ cerr row (col + 1) E.NoFloats
595 cok (Int 0) newState
602 cok (Int 0) newState
@@ -607,12 +614,12 @@ pInt =
607 GoodInt ->
614 GoodInt ->
609 !newState =
616 !newState =
610− P.State newPos end indent row (col + len) ctx
617+ P.State newPos end indent row (col + len)
612 cok (Int n) newState
619 cok (Int n) newState
614 BadIntEnd ->
621 BadIntEnd ->
615− cerr row (col + len) ctx E.NoFloats
622+ cerr row (col + len) E.NoFloats
618data IntStatus = GoodInt | BadIntEnd
625data IntStatus = GoodInt | BadIntEnd