]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G9.expected.txt
test: add goldens for TH splices
[haskell/symantic-parser.git] / test / Golden / Splice / G9.expected.txt
1 test/Golden/Splice/G9.hs:0:0:: Splicing expression
2 P.runParser @Text Grammar.g9
3 ======>
4 \ (input :: inp)
5 -> let
6 !(# init, readMore, readNext #)
7 = let _ = "cursorOf" in
8 let
9 next t@(Data.Text.Internal.Text arr off unconsumed)
10 = let !(Data.Text.Unsafe.Iter c d) = (Data.Text.Unsafe.iter t) 0
11 in
12 (# c, ((Data.Text.Internal.Text arr) (off + d)) (unconsumed - d) #)
13 more (Data.Text.Internal.Text _ _ unconsumed) = (unconsumed > 0)
14 in (# input, more, next #) in
15 let finalRet = \ _farInp _farExp v _inp -> Right v in
16 let
17 finalRaise :: forall b. P.Catcher inp b
18 = \ _failInp !farInp !farExp
19 -> Left
20 P.ParsingErrorStandard
21 {P.parsingErrorOffset = P.offset farInp,
22 P.parsingErrorUnexpected = if readMore farInp then
23 Just (let (# c, _ #) = readNext farInp in c)
24 else
25 Nothing,
26 P.parsingErrorExpecting = Data.Set.Internal.fromList farExp} in
27 let _ = ("catchException lbl=" <> "fail") in
28 let _ = ("catchException lbl=" <> "fail") in
29 let
30 readFail
31 = \ !failInp !farInp !farExp
32 -> let _ = "resume"
33 in
34 (((finalRet farInp) farExp) (let _ = "resume.genCode" in ())) init
35 in
36 if readMore init then
37 let !(# c, cs #) = readNext init
38 in
39 if (\ x -> True) c then
40 let
41 (# farInp, farExp #)
42 = case ((compare `Data.Function.on` P.offset) init) init of
43 LT -> (# init, [] #)
44 EQ -> (# init, ([] <> []) #)
45 GT -> (# init, [] #)
46 in
47 (((\ !failInp !farInp !farExp
48 -> if (\ x -> x)
49 (((\ (Data.Text.Internal.Text _ i _)
50 (Data.Text.Internal.Text _ j _)
51 -> (i == j))
52 init)
53 failInp) then
54 let
55 (# farInp, farExp #)
56 = case
57 ((compare `Data.Function.on` P.offset) farInp) failInp
58 of
59 LT -> (# failInp, [P.ErrorItemEnd] #)
60 EQ -> (# farInp, (farExp <> [P.ErrorItemEnd]) #)
61 GT -> (# farInp, farExp #)
62 in ((finalRaise failInp) farInp) farExp
63 else
64 let
65 (# farInp, farExp #)
66 = case
67 ((compare `Data.Function.on` P.offset) farInp) failInp
68 of
69 LT -> (# failInp, [] #)
70 EQ -> (# farInp, (farExp <> []) #)
71 GT -> (# farInp, farExp #)
72 in ((finalRaise failInp) farInp) farExp)
73 init)
74 farInp)
75 farExp
76 else
77 let _ = "checkToken.else" in
78 let
79 (# farInp, farExp #)
80 = case ((compare `Data.Function.on` P.offset) init) init of
81 LT -> (# init, [] #)
82 EQ -> (# init, ([] <> []) #)
83 GT -> (# init, [] #)
84 in ((readFail init) farInp) farExp
85 else
86 let _ = "checkHorizon.else" in
87 let
88 (# farInp, farExp #)
89 = case ((compare `Data.Function.on` P.offset) init) init of
90 LT -> (# init, [P.ErrorItemHorizon 1] #)
91 EQ -> (# init, ([] <> [P.ErrorItemHorizon 1]) #)
92 GT -> (# init, [] #)
93 in ((readFail init) farInp) farExp