]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G9.expected.txt
doc: fix license and {def => shareable}
[haskell/symantic-parser.git] / test / Golden / Splice / G9.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.ParsingError
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 join = \farInp farExp v (!inp) ->
56 let _ = "resume"
57 in finalRet
58 farInp
59 farExp
60 ( let _ = "resume.genCode"
61 in GHC.Show.show v
62 )
63 inp
64 in let _ = "catch ExceptionFailure"
65 in let catchHandler (!_exn) (!failInp) (!farInp) (!farExp) =
66 let _ = "catch.ko ExceptionFailure"
67 in if ( \( Data.Text.Internal.Text
68 _
69 i
70 _
71 )
72 ( Data.Text.Internal.Text
73 _
74 j
75 _
76 ) -> i GHC.Classes.== j
77 )
78 init
79 failInp
80 then
81 let _ = "choicesBranch.then"
82 in let failExp = Data.Set.Internal.Bin 1 (Symantic.Parser.Grammar.Combinators.SomeFailure Symantic.Parser.Grammar.Combinators.FailureEnd) Data.Set.Internal.Tip Data.Set.Internal.Tip
83 in let (#
84 farInp,
85 farExp
86 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
87 GHC.Types.LT ->
88 (#
89 failInp,
90 failExp
91 #)
92 GHC.Types.EQ ->
93 (#
94 farInp,
95 failExp GHC.Base.<> farExp
96 #)
97 GHC.Types.GT ->
98 (#
99 farInp,
100 farExp
101 #)
102 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
103 else
104 let _ = "choicesBranch.else"
105 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
106 in let _ = "catch ExceptionFailure"
107 in let catchHandler (!_exn) (!failInp) (!farInp) (!farExp) =
108 let _ = "catch.ko ExceptionFailure"
109 in let _ = "resume"
110 in join
111 farInp
112 farExp
113 ( let _ = "resume.genCode"
114 in GHC.Tuple . ()
115 )
116 init
117 in let readFail = catchHandler
118 in if readMore init
119 then
120 let !(# c, cs #) = readNext init
121 in catchHandler Symantic.Parser.Grammar.Combinators.ExceptionFailure init init Data.Set.Internal.empty
122 else
123 let _ = "checkHorizon.else"
124 in let failExp =
125 Data.Set.Internal.Bin
126 1
127 ( Symantic.Parser.Grammar.Combinators.SomeFailure
128 ( case inputToken of
129 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
130 )
131 )
132 Data.Set.Internal.Tip
133 Data.Set.Internal.Tip
134 in let (#
135 farInp,
136 farExp
137 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
138 GHC.Types.LT ->
139 (#
140 init,
141 failExp
142 #)
143 GHC.Types.EQ ->
144 (#
145 init,
146 failExp GHC.Base.<> Data.Set.Internal.empty
147 #)
148 GHC.Types.GT ->
149 (#
150 init,
151 Data.Set.Internal.empty
152 #)
153 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure init farInp farExp