]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G3.expected.txt
test: add goldens for TH splices
[haskell/symantic-parser.git] / test / Golden / Splice / G3.expected.txt
1 test/Golden/Splice/G3.hs:0:0:: Splicing expression
2 P.runParser @Text Grammar.g3
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
28 name
29 = \ !ok !inp !koByLabel
30 -> let _ = ("catchException lbl=" <> "fail") in
31 let
32 readFail
33 = \ !failInp !farInp !farExp
34 -> if (\ x -> x)
35 (((\ (Data.Text.Internal.Text _ i _)
36 (Data.Text.Internal.Text _ j _)
37 -> (i == j))
38 inp)
39 failInp) then
40 let _ = "resume"
41 in
42 (((ok farInp) farExp) (let _ = "resume.genCode" in \ x -> x))
43 failInp
44 else
45 let
46 (# farInp, farExp #)
47 = case
48 ((compare `Data.Function.on` P.offset) farInp) failInp
49 of
50 LT -> (# failInp, [] #)
51 EQ -> (# farInp, (farExp <> []) #)
52 GT -> (# farInp, farExp #)
53 in
54 (((((Data.Map.Strict.Internal.findWithDefault finalRaise)
55 "fail")
56 koByLabel)
57 failInp)
58 farInp)
59 farExp
60 in
61 if readMore inp then
62 let !(# c, cs #) = readNext inp
63 in
64 if ('a' ==) c then
65 let
66 _ = "call exceptionsByName(name_1)=[] catchStackByLabel(ctx)=["fail"]"
67 in
68 ((name
69 (let
70 _ = "suspend raiseException=fromList [(name_1,fromList [])]"
71 in
72 \ farInp farExp v !inp
73 -> let _ = "resume"
74 in
75 (((ok farInp) farExp)
76 (let _ = "resume.genCode"
77 in
78 ((\ x -> \ x -> x x)
79 (((\ x -> \ x -> x x)
80 (\ x -> \ x -> \ x -> ('a' : x x)))
81 c))
82 v))
83 inp))
84 cs)
85 Data.Map.Internal.Tip
86 else
87 let _ = "checkToken.else" in
88 let
89 (# farInp, farExp #)
90 = case ((compare `Data.Function.on` P.offset) init) inp of
91 LT -> (# inp, [P.ErrorItemToken 'a'] #)
92 EQ -> (# init, ([] <> [P.ErrorItemToken 'a']) #)
93 GT -> (# init, [] #)
94 in ((readFail inp) farInp) farExp
95 else
96 let _ = "checkHorizon.else" in
97 let
98 (# farInp, farExp #)
99 = case ((compare `Data.Function.on` P.offset) init) inp of
100 LT -> (# inp, [P.ErrorItemHorizon 1] #)
101 EQ -> (# init, ([] <> [P.ErrorItemHorizon 1]) #)
102 GT -> (# init, [] #)
103 in ((readFail inp) farInp) farExp in
104 let
105 _ = "call exceptionsByName(name_1)=["fail"] catchStackByLabel(ctx)=[]"
106 in
107 ((name
108 (let
109 _ = "suspend raiseException=fromList [(name_1,fromList [("fail",())])]"
110 in
111 \ farInp farExp v !inp
112 -> let _ = "resume"
113 in
114 (((finalRet farInp) farExp)
115 (let _ = "resume.genCode"
116 in ((\ x -> \ x -> x x) (\ x -> x [])) v))
117 inp))
118 init)
119 Data.Map.Internal.Tip