@@ -40,14 +40,16 @@ panic msg = appfn_ (gref "PANIC") [V $ NativeString msg]
40
40
euNull :: LambdaForm
41
41
euNull = standardConstructor 0 stgUnit
42
42
43
- emitMS :: StgSyn
44
- emitMS = appbif_ (intrinsicIndex " EMIT{" ) []
43
+ -- | Emit mapping start using specified metadata
44
+ emitMS :: Ref -> StgSyn
45
+ emitMS m = appbif_ (intrinsicIndex " EMIT{" ) [m]
45
46
46
47
emitME :: StgSyn
47
48
emitME = appbif_ (intrinsicIndex " EMIT}" ) []
48
49
49
- emitSS :: StgSyn
50
- emitSS = appbif_ (intrinsicIndex " EMIT[" ) []
50
+ -- | Emit sequence start using specified metadata
51
+ emitSS :: Ref -> StgSyn
52
+ emitSS m = appbif_ (intrinsicIndex " EMIT[" ) [m]
51
53
52
54
emitSE :: StgSyn
53
55
emitSE = appbif_ (intrinsicIndex " EMIT]" ) []
@@ -149,10 +151,8 @@ startList =
149
151
lam_ 0 2 $
150
152
ann_ " Emit.startList" 0 $
151
153
force_
152
- emitSS
153
- (force_
154
- (appfn_ (gref " RENDER" ) [L 0 ])
155
- (appfn_ (gref " Emit.continueList" ) [L 1 ]))
154
+ (appfn_ (gref " RENDER" ) [L 0 ])
155
+ (appfn_ (gref " Emit.continueList" ) [L 1 ])
156
156
157
157
-- | __Emit.continueKVList(l)
158
158
continueKVList :: LambdaForm
@@ -173,24 +173,27 @@ euRender :: LambdaForm
173
173
euRender =
174
174
lam_ 0 1 $
175
175
ann_ " __RENDER" 0 $
176
+ force_ (appfn_ (gref " META" ) [L 0 ]) $
177
+ force_ (appfn_ (gref " Emit.forceExportMetadata" ) [L 1 ]) $
176
178
casedef_
177
179
(Atom (L 0 ))
178
180
[ ( stgBlock
179
181
, ( 1
180
- , force_ (appfn_ (gref " ALIST.PRUNE" ) [L 1 ]) $
181
- forceall_ [emitMS, appfn_ (gref " Emit.continueKVList" ) [L 2 ], emitME]))
182
- , (stgCons, (2 , appfn_ (gref " Emit.startList" ) [L 1 , L 2 ]))
183
- , (stgNil, (0 , force_ emitSS emitSE))
182
+ , force_ (appfn_ (gref " ALIST.PRUNE" ) [L 3 ]) $
183
+ forceall_
184
+ [emitMS (L 1 ), appfn_ (gref " Emit.continueKVList" ) [L 4 ], emitME]))
185
+ , ( stgCons
186
+ , (2 , force_ (emitSS (L 1 )) $ appfn_ (gref " Emit.startList" ) [L 3 , L 4 ]))
187
+ , (stgNil, (0 , force_ (emitSS (L 1 )) emitSE))
184
188
, (stgUnit, (0 , emitNull))
185
189
, (stgTrue, (0 , emitTrue))
186
190
, (stgFalse, (0 , emitFalse))
187
191
, ( stgIOSMBlock
188
192
, ( 1
189
- , force_ (appfn_ (gref " IOSM.LIST" ) [L 1 ]) $
190
- forceall_ [emitMS, appfn_ (gref " Emit.continueKVList" ) [L 2 ], emitME]))
193
+ , force_ (appfn_ (gref " IOSM.LIST" ) [L 3 ]) $
194
+ forceall_ [emitMS ( L 1 ) , appfn_ (gref " Emit.continueKVList" ) [L 4 ], emitME]))
191
195
] $
192
- force_ (appfn_ (gref " META" ) [L 1 ]) $
193
- force_ (appfn_ (gref " Emit.forceExportMetadata" ) [L 2 ]) $ emitScalar (L 1 )
196
+ emitScalar (L 3 )
194
197
195
198
196
199
-- | Single argument is the metadata (not the annotated value)
0 commit comments