]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G1.expected.txt
replace ValueCode by Production
[haskell/symantic-parser.git] / test / Golden / Splice / G1.expected.txt
1 \(input :: inp) ->
2 let !(#
3 init,
4 readMore,
5 readNext
6 #) =
7 let _ = "cursorOf"
8 in let next
9 ( t@( Data.Text.Internal.Text
10 arr
11 off
12 unconsumed
13 )
14 ) =
15 let !( Data.Text.Unsafe.Iter
16 c
17 d
18 ) = Data.Text.Unsafe.iter t 0
19 in (#
20 c,
21 Data.Text.Internal.Text arr (off GHC.Num.+ d) (unconsumed GHC.Num.- d)
22 #)
23 more
24 ( Data.Text.Internal.Text
25 _
26 _
27 unconsumed
28 ) = unconsumed GHC.Classes.> 0
29 in (# input, more, next #)
30 finalRet = \_farInp _farExp v _inp -> Data.Either.Right v
31 finalRaise ::
32 forall b.
33 Symantic.Parser.Machine.Generate.Catcher
34 inp
35 b = \(!exn) _failInp (!farInp) (!farExp) ->
36 Data.Either.Left
37 Symantic.Parser.Machine.Generate.ParsingErrorStandard
38 { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.offset farInp,
39 Symantic.Parser.Machine.Generate.parsingErrorException = exn,
40 Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
41 if readMore farInp
42 then
43 GHC.Maybe.Just
44 ( let (#
45 c,
46 _
47 #) = readNext farInp
48 in c
49 )
50 else GHC.Maybe.Nothing,
51 Symantic.Parser.Machine.Generate.parsingErrorExpecting = farExp
52 }
53 in let inputToken = Data.Proxy.Proxy :: Data.Proxy.Proxy (Symantic.Parser.Machine.Input.InputToken inp)
54 in let
55 in let readFail = finalRaise
56 in if readMore init
57 then
58 let !(# c, cs #) = readNext init
59 in if ('a' GHC.Classes.==) c
60 then
61 let _ = "resume"
62 in finalRet
63 init
64 Data.Set.Internal.empty
65 ( let _ = "resume.genCode"
66 in GHC.Show.show 'a'
67 )
68 cs
69 else
70 let _ = "checkToken.else"
71 in let failExp =
72 Data.Set.Internal.Bin
73 1
74 ( Symantic.Parser.Grammar.Combinators.SomeFailure
75 ( case inputToken of
76 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
77 )
78 )
79 Data.Set.Internal.Tip
80 Data.Set.Internal.Tip
81 in let (#
82 farInp,
83 farExp
84 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
85 GHC.Types.LT ->
86 (#
87 init,
88 failExp
89 #)
90 GHC.Types.EQ ->
91 (#
92 init,
93 failExp GHC.Base.<> Data.Set.Internal.empty
94 #)
95 GHC.Types.GT ->
96 (#
97 init,
98 Data.Set.Internal.empty
99 #)
100 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure init farInp farExp
101 else
102 let _ = "checkHorizon.else"
103 in let failExp =
104 Data.Set.Internal.Bin
105 1
106 ( Symantic.Parser.Grammar.Combinators.SomeFailure
107 ( case inputToken of
108 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
109 )
110 )
111 Data.Set.Internal.Tip
112 Data.Set.Internal.Tip
113 in let (#
114 farInp,
115 farExp
116 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
117 GHC.Types.LT ->
118 (#
119 init,
120 failExp
121 #)
122 GHC.Types.EQ ->
123 (#
124 init,
125 failExp GHC.Base.<> Data.Set.Internal.empty
126 #)
127 GHC.Types.GT ->
128 (#
129 init,
130 Data.Set.Internal.empty
131 #)
132 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure init farInp farExp