machine: improve comments
[haskell/symantic-parser.git] / test / Golden / Splice / G6.expected.txt
index b8c34d79604e7c6fc4e04c22dcff84ec85bd99fc..ec66571c2915d6f5062629c7810c067435b0212c 100644 (file)
                         unconsumed
                       ) = unconsumed GHC.Classes.> 0
                in (# input, more, next #)
-   in let finalRet = \_farInp _farExp v _inp -> Data.Either.Right v
-       in let finalRaise ::
-                forall b.
-                Symantic.Parser.Machine.Generate.Catcher
-                  inp
-                  b = \_failInp (!farInp) (!farExp) ->
-                  Data.Either.Left
-                    Symantic.Parser.Machine.Generate.ParsingErrorStandard
-                      { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.offset farInp,
-                        Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
-                          if readMore farInp
-                            then
-                              GHC.Maybe.Just
-                                ( let (#
-                                        c,
-                                        _
-                                        #) = readNext farInp
-                                   in c
-                                )
-                            else GHC.Maybe.Nothing,
-                        Symantic.Parser.Machine.Generate.parsingErrorExpecting = Data.Set.Internal.fromList farExp
-                      }
-           in let
-               in let join = \farInp farExp v (!inp) ->
-                        let _ = "resume"
-                         in finalRet
-                              farInp
-                              farExp
-                              ( let _ = "resume.genCode"
-                                 in GHC.Show.show v
-                              )
-                              inp
-                   in let _ = "catchException lbl=fail"
-                       in let catchHandler (!failInp) (!farInp) (!farExp) =
-                                let _ = "catchException.ko lbl=fail"
-                                 in if ( \( Data.Text.Internal.Text
-                                              _
-                                              i
-                                              _
-                                            )
-                                          ( Data.Text.Internal.Text
-                                              _
-                                              j
-                                              _
-                                            ) -> i GHC.Classes.== j
-                                       )
-                                      init
-                                      failInp
-                                      then
-                                        let _ = "choicesBranch.then"
-                                         in let readFail = finalRaise
-                                             in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 failInp)
-                                                  then
-                                                    let !(#
-                                                           c,
-                                                           cs
-                                                           #) = readNext failInp
-                                                     in if ('a' GHC.Classes.==) c
-                                                          then
-                                                            let readFail = finalRaise
-                                                             in let !(#
-                                                                       c,
-                                                                       cs
-                                                                       #) = readNext cs
-                                                                 in if ('b' GHC.Classes.==) c
-                                                                      then
-                                                                        let _ = "resume"
-                                                                         in join
-                                                                              farInp
+      finalRet = \_farInp _farExp v _inp -> Data.Either.Right v
+      finalRaise ::
+        forall b.
+        Symantic.Parser.Machine.Generate.Catcher
+          inp
+          b = \(!exn) _failInp (!farInp) (!farExp) ->
+          Data.Either.Left
+            Symantic.Parser.Machine.Generate.ParsingErrorStandard
+              { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.offset farInp,
+                Symantic.Parser.Machine.Generate.parsingErrorException = exn,
+                Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
+                  if readMore farInp
+                    then
+                      GHC.Maybe.Just
+                        ( let (#
+                                c,
+                                _
+                                #) = readNext farInp
+                           in c
+                        )
+                    else GHC.Maybe.Nothing,
+                Symantic.Parser.Machine.Generate.parsingErrorExpecting = farExp
+              }
+   in let inputToken = Data.Proxy.Proxy :: Data.Proxy.Proxy (Symantic.Parser.Machine.Input.InputToken inp)
+       in let
+           in let join = \farInp farExp v (!inp) ->
+                    let _ = "resume"
+                     in finalRet
+                          farInp
+                          farExp
+                          ( let _ = "resume.genCode"
+                             in GHC.Show.show v
+                          )
+                          inp
+               in let _ = "catch ExceptionFailure"
+                   in let catchHandler (!_exn) (!failInp) (!farInp) (!farExp) =
+                            let _ = "catch.ko ExceptionFailure"
+                             in if ( \( Data.Text.Internal.Text
+                                          _
+                                          i
+                                          _
+                                        )
+                                      ( Data.Text.Internal.Text
+                                          _
+                                          j
+                                          _
+                                        ) -> i GHC.Classes.== j
+                                   )
+                                  init
+                                  failInp
+                                  then
+                                    let _ = "choicesBranch.then"
+                                     in let readFail = finalRaise
+                                         in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 failInp)
+                                              then
+                                                let !(#
+                                                       c,
+                                                       cs
+                                                       #) = readNext failInp
+                                                 in if ('a' GHC.Classes.==) c
+                                                      then
+                                                        let readFail = finalRaise
+                                                         in let !(#
+                                                                   c,
+                                                                   cs
+                                                                   #) = readNext cs
+                                                             in if ('b' GHC.Classes.==) c
+                                                                  then
+                                                                    let _ = "resume"
+                                                                     in join
+                                                                          farInp
+                                                                          farExp
+                                                                          ( let _ = "resume.genCode"
+                                                                             in 'a' GHC.Types.: ('b' GHC.Types.: GHC.Types . [])
+                                                                          )
+                                                                          cs
+                                                                  else
+                                                                    let _ = "checkToken.else"
+                                                                     in let failExp =
+                                                                              Data.Set.Internal.Bin
+                                                                                1
+                                                                                ( Symantic.Parser.Grammar.Combinators.SomeFailure
+                                                                                    ( case inputToken of
+                                                                                        (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
+                                                                                    )
+                                                                                )
+                                                                                Data.Set.Internal.Tip
+                                                                                Data.Set.Internal.Tip
+                                                                            (#
+                                                                              farInp,
                                                                               farExp
-                                                                              ( let _ = "resume.genCode"
-                                                                                 in 'a' GHC.Types.: ('b' GHC.Types.: GHC.Types . [])
-                                                                              )
-                                                                              cs
-                                                                      else
-                                                                        let _ = "checkToken.else"
-                                                                         in let (#
-                                                                                  farInp,
-                                                                                  farExp
-                                                                                  #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp cs of
-                                                                                    GHC.Types.LT ->
-                                                                                      (#
-                                                                                        cs,
-                                                                                        [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'b']
-                                                                                      #)
-                                                                                    GHC.Types.EQ ->
-                                                                                      (#
-                                                                                        farInp,
-                                                                                        farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'b']
-                                                                                      #)
-                                                                                    GHC.Types.GT ->
-                                                                                      (#
-                                                                                        farInp,
-                                                                                        farExp
-                                                                                      #)
-                                                                             in finalRaise cs farInp farExp
-                                                          else
-                                                            let _ = "checkToken.else"
-                                                             in let (#
-                                                                      farInp,
-                                                                      farExp
-                                                                      #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
-                                                                        GHC.Types.LT ->
-                                                                          (#
-                                                                            failInp,
-                                                                            [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
-                                                                          #)
-                                                                        GHC.Types.EQ ->
-                                                                          (#
-                                                                            farInp,
-                                                                            farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
-                                                                          #)
-                                                                        GHC.Types.GT ->
-                                                                          (#
-                                                                            farInp,
-                                                                            farExp
-                                                                          #)
-                                                                 in finalRaise failInp farInp farExp
-                                                  else
-                                                    let _ = "checkHorizon.else"
-                                                     in let (#
-                                                              farInp,
-                                                              farExp
-                                                              #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
-                                                                GHC.Types.LT ->
-                                                                  (#
-                                                                    failInp,
-                                                                    [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
-                                                                  #)
-                                                                GHC.Types.EQ ->
-                                                                  (#
-                                                                    farInp,
-                                                                    farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
-                                                                  #)
-                                                                GHC.Types.GT ->
-                                                                  (#
-                                                                    farInp,
-                                                                    farExp
-                                                                  #)
-                                                         in finalRaise failInp farInp farExp
-                                      else
-                                        let _ = "choicesBranch.else"
-                                         in let (#
-                                                  farInp,
-                                                  farExp
-                                                  #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
-                                                    GHC.Types.LT ->
-                                                      (#
-                                                        failInp,
-                                                        []
-                                                      #)
-                                                    GHC.Types.EQ ->
-                                                      (#
-                                                        farInp,
-                                                        farExp GHC.Base.<> []
-                                                      #)
-                                                    GHC.Types.GT ->
-                                                      (#
-                                                        farInp,
-                                                        farExp
-                                                      #)
-                                             in finalRaise failInp farInp farExp
-                           in let readFail = catchHandler
-                               in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 init)
-                                    then
-                                      let !(# c, cs #) = readNext init
-                                       in if ('a' GHC.Classes.==) c
-                                            then
-                                              let readFail = readFail
-                                               in let !(#
-                                                         c,
-                                                         cs
-                                                         #) = readNext cs
-                                                   in if ('a' GHC.Classes.==) c
-                                                        then
-                                                          let _ = "resume"
-                                                           in join init GHC.Types
-                                                                . []
-                                                                  ( let _ = "resume.genCode"
-                                                                     in 'a' GHC.Types.: ('a' GHC.Types.: GHC.Types . [])
+                                                                              #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp cs of
+                                                                                GHC.Types.LT ->
+                                                                                  (#
+                                                                                    cs,
+                                                                                    failExp
+                                                                                  #)
+                                                                                GHC.Types.EQ ->
+                                                                                  (#
+                                                                                    farInp,
+                                                                                    failExp GHC.Base.<> farExp
+                                                                                  #)
+                                                                                GHC.Types.GT ->
+                                                                                  (#
+                                                                                    farInp,
+                                                                                    farExp
+                                                                                  #)
+                                                                         in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp
+                                                      else
+                                                        let _ = "checkToken.else"
+                                                         in let failExp =
+                                                                  Data.Set.Internal.Bin
+                                                                    1
+                                                                    ( Symantic.Parser.Grammar.Combinators.SomeFailure
+                                                                        ( case inputToken of
+                                                                            (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
+                                                                        )
+                                                                    )
+                                                                    Data.Set.Internal.Tip
+                                                                    Data.Set.Internal.Tip
+                                                                (#
+                                                                  farInp,
+                                                                  farExp
+                                                                  #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
+                                                                    GHC.Types.LT ->
+                                                                      (#
+                                                                        failInp,
+                                                                        failExp
+                                                                      #)
+                                                                    GHC.Types.EQ ->
+                                                                      (#
+                                                                        farInp,
+                                                                        failExp GHC.Base.<> farExp
+                                                                      #)
+                                                                    GHC.Types.GT ->
+                                                                      (#
+                                                                        farInp,
+                                                                        farExp
+                                                                      #)
+                                                             in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
+                                              else
+                                                let _ = "checkHorizon.else"
+                                                 in let failExp =
+                                                          Data.Set.Internal.Bin
+                                                            1
+                                                            ( Symantic.Parser.Grammar.Combinators.SomeFailure
+                                                                ( case inputToken of
+                                                                    (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
+                                                                )
+                                                            )
+                                                            Data.Set.Internal.Tip
+                                                            Data.Set.Internal.Tip
+                                                        (#
+                                                          farInp,
+                                                          farExp
+                                                          #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
+                                                            GHC.Types.LT ->
+                                                              (#
+                                                                failInp,
+                                                                failExp
+                                                              #)
+                                                            GHC.Types.EQ ->
+                                                              (#
+                                                                farInp,
+                                                                failExp GHC.Base.<> farExp
+                                                              #)
+                                                            GHC.Types.GT ->
+                                                              (#
+                                                                farInp,
+                                                                farExp
+                                                              #)
+                                                     in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
+                                  else
+                                    let _ = "choicesBranch.else"
+                                     in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
+                       in let readFail = catchHandler
+                           in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 init)
+                                then
+                                  let !(# c, cs #) = readNext init
+                                   in if ('a' GHC.Classes.==) c
+                                        then
+                                          let readFail = readFail
+                                           in let !(# c, cs #) = readNext cs
+                                               in if ('a' GHC.Classes.==) c
+                                                    then
+                                                      let _ = "resume"
+                                                       in join
+                                                            init
+                                                            Data.Set.Internal.empty
+                                                            ( let _ = "resume.genCode"
+                                                               in 'a' GHC.Types.: ('a' GHC.Types.: GHC.Types . [])
+                                                            )
+                                                            cs
+                                                    else
+                                                      let _ = "checkToken.else"
+                                                       in let failExp =
+                                                                Data.Set.Internal.Bin
+                                                                  1
+                                                                  ( Symantic.Parser.Grammar.Combinators.SomeFailure
+                                                                      ( case inputToken of
+                                                                          (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
+                                                                      )
                                                                   )
-                                                                  cs
-                                                        else
-                                                          let _ = "checkToken.else"
-                                                           in let (#
-                                                                    farInp,
-                                                                    farExp
-                                                                    #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init cs of
-                                                                      GHC.Types.LT ->
-                                                                        (#
-                                                                          cs,
-                                                                          [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
-                                                                        #)
-                                                                      GHC.Types.EQ ->
-                                                                        (#
-                                                                          init,
-                                                                          GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
-                                                                        #)
-                                                                      GHC.Types.GT ->
-                                                                        (#
-                                                                          init,
-                                                                          GHC.Types . []
-                                                                        #)
-                                                               in readFail cs farInp farExp
-                                            else
-                                              let _ = "checkToken.else"
-                                               in let (#
-                                                        farInp,
-                                                        farExp
-                                                        #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
-                                                          GHC.Types.LT ->
-                                                            (#
-                                                              init,
-                                                              [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
-                                                            #)
-                                                          GHC.Types.EQ ->
-                                                            (#
-                                                              init,
-                                                              GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
-                                                            #)
-                                                          GHC.Types.GT ->
-                                                            (#
-                                                              init,
-                                                              GHC.Types . []
-                                                            #)
-                                                   in readFail init farInp farExp
-                                    else
-                                      let _ = "checkHorizon.else"
-                                       in let (#
-                                                farInp,
-                                                farExp
-                                                #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
-                                                  GHC.Types.LT ->
-                                                    (#
-                                                      init,
-                                                      [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
-                                                    #)
-                                                  GHC.Types.EQ ->
-                                                    (#
-                                                      init,
-                                                      GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
-                                                    #)
-                                                  GHC.Types.GT ->
-                                                    (#
-                                                      init,
-                                                      GHC.Types . []
-                                                    #)
-                                           in readFail init farInp farExp
+                                                                  Data.Set.Internal.Tip
+                                                                  Data.Set.Internal.Tip
+                                                              (#
+                                                                farInp,
+                                                                farExp
+                                                                #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init cs of
+                                                                  GHC.Types.LT ->
+                                                                    (#
+                                                                      cs,
+                                                                      failExp
+                                                                    #)
+                                                                  GHC.Types.EQ ->
+                                                                    (#
+                                                                      init,
+                                                                      failExp GHC.Base.<> Data.Set.Internal.empty
+                                                                    #)
+                                                                  GHC.Types.GT ->
+                                                                    (#
+                                                                      init,
+                                                                      Data.Set.Internal.empty
+                                                                    #)
+                                                           in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp
+                                        else
+                                          let _ = "checkToken.else"
+                                           in let failExp =
+                                                    Data.Set.Internal.Bin
+                                                      1
+                                                      ( Symantic.Parser.Grammar.Combinators.SomeFailure
+                                                          ( case inputToken of
+                                                              (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
+                                                          )
+                                                      )
+                                                      Data.Set.Internal.Tip
+                                                      Data.Set.Internal.Tip
+                                                  (#
+                                                    farInp,
+                                                    farExp
+                                                    #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
+                                                      GHC.Types.LT ->
+                                                        (#
+                                                          init,
+                                                          failExp
+                                                        #)
+                                                      GHC.Types.EQ ->
+                                                        (#
+                                                          init,
+                                                          failExp GHC.Base.<> Data.Set.Internal.empty
+                                                        #)
+                                                      GHC.Types.GT ->
+                                                        (#
+                                                          init,
+                                                          Data.Set.Internal.empty
+                                                        #)
+                                               in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure init farInp farExp
+                                else
+                                  let _ = "checkHorizon.else"
+                                   in let failExp =
+                                            Data.Set.Internal.Bin
+                                              1
+                                              ( Symantic.Parser.Grammar.Combinators.SomeFailure
+                                                  ( case inputToken of
+                                                      (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
+                                                  )
+                                              )
+                                              Data.Set.Internal.Tip
+                                              Data.Set.Internal.Tip
+                                          (#
+                                            farInp,
+                                            farExp
+                                            #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
+                                              GHC.Types.LT ->
+                                                (#
+                                                  init,
+                                                  failExp
+                                                #)
+                                              GHC.Types.EQ ->
+                                                (#
+                                                  init,
+                                                  failExp GHC.Base.<> Data.Set.Internal.empty
+                                                #)
+                                              GHC.Types.GT ->
+                                                (#
+                                                  init,
+                                                  Data.Set.Internal.empty
+                                                #)
+                                       in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure init farInp farExp