hermes-parser 0.1.0

A Rust port of the Hermes JavaScript/Flow/TypeScript parser (front-end) by Tzvetan Mikov, the architect of Hermes. Not an official Meta project.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

//! Function declaration/expression parsing for the JS parser. Port of the
//! function-parsing section of `lib/Parser/JSParserImpl.cpp`
//! (`parseFunctionHelper`, `parseFormalParameters`, `parseFunctionBody`,
//! `parseFunctionDeclaration`, `parseFunctionExpression`).
//!
//! The PreParse side-table recording (cpp:803-810) and LazyParse skip-and-stub
//! block (cpp:747-796) are both implemented in `parse_function_body`. The Flow
//! signature sites (type parameters, return type, `%checks` predicate, leading
//! `this` parameter) are ported (P5.4); the TS blocks are omitted (P7).

use hermes_ast::node::{BlockStatement, FunctionDeclaration, FunctionExpression, Identifier, Node};
use hermes_ast::node_child::{NodeList, NodeMetadata};

use crate::lexer::GrammarContext;
use crate::token_kinds::TokenKind;

use super::flow::AllowAnonFunctionType;
use super::pre_lazy::{ParserPass, PreParsedFunctionInfo};
use super::{JSParserImpl, Param, PARAM_DEFAULT, PARAM_RETURN};

impl<'gc, 'ast, 'ctx, 'a> JSParserImpl<'gc, 'ast, 'ctx, 'a> {
    // -----------------------------------------------------------------------
    // parseFunctionHelper — 383 in JSParserImpl.cpp
    // -----------------------------------------------------------------------

    /// Parse a function declaration or expression (including generators and
    /// async functions). Port of `JSParserImpl::parseFunctionHelper`
    /// (lines 383-598).
    ///
    /// `force_eagerly` is threaded for fidelity (it feeds the `eagerly` arg of
    /// `parse_function_body`); in the Full-pass port the body is always parsed
    /// eagerly, so it has no observable effect.
    ///
    /// The C++ constructs a `SaveFunctionState` whose destructor restores
    /// `strictMode` (383/510). A `"use strict"` directive in the body must NOT
    /// leak strictness to the enclosing (possibly sloppy) code, so we save and
    /// restore the lexer strict-mode flag around the body. The result is
    /// computed first so the restore runs on every (including error `?`) path.
    pub(super) fn parse_function_helper(
        &mut self,
        param: Param,
        is_declaration: bool,
        force_eagerly: bool,
    ) -> Option<&'gc Node<'gc>> {
        let old_strict = self.lexer.is_strict_mode();
        // Note: the `SaveFunctionState` guard is constructed INSIDE
        // `parse_function_helper_inner`, AFTER `parse_formal_parameters` —
        // mirroring C++ cpp:510 which places it after `parseFormalParameters`
        // (cpp:465) and before `parseFunctionBody`. This matters for default-
        // parameter arrows: a `() => arguments` inside a default value must
        // NOT set `contains_arrow_functions` on this function scope; it belongs
        // to the enclosing scope.
        let old_seen_len = self.seen_directives.len();
        let result =
            self.parse_function_helper_inner(param, is_declaration, force_eagerly);
        self.seen_directives.truncate(old_seen_len);
        self.lexer.set_strict_mode(old_strict);
        result
    }

    fn parse_function_helper_inner(
        &mut self,
        param: Param,
        is_declaration: bool,
        force_eagerly: bool,
    ) -> Option<&'gc Node<'gc>> {
        // function or async function
        // C++ 387-389.
        debug_assert!(
            self.check(TokenKind::rw_function)
                || self.check_unescaped_name(b"async"),
            "parseFunctionHelper must start with 'function' or 'async'"
        );
        let is_async = self.check_unescaped_name(b"async");

        let start_loc = self.advance(GrammarContext::AllowRegExp).start;

        if is_async {
            // async function
            //       ^
            // C++ 393-397.
            self.advance(GrammarContext::AllowRegExp);
        }

        let is_generator =
            self.check_and_eat(TokenKind::star, GrammarContext::AllowRegExp);

        // newParamYield setting per the grammar (C++ 401-413):
        // FunctionDeclaration: BindingIdentifier[?Yield, ?Await]
        // FunctionExpression: BindingIdentifier[~Yield, ~Await]
        // GeneratorFunctionDeclaration: BindingIdentifier[?Yield, ?Await]
        // GeneratorFunctionExpression: BindingIdentifier[+Yield, ~Await]
        // AsyncFunctionDeclaration: BindingIdentifier[?Yield, ?Await]
        // AsyncFunctionExpression: BindingIdentifier[+Yield, +Await]
        // AsyncGeneratorDeclaration: BindingIdentifier[?Yield, ?Await]
        // AsyncGeneratorExpression: BindingIdentifier[+Yield, +Await]
        let name_param_yield = if is_declaration {
            self.param_yield.get()
        } else {
            is_generator
        };
        let name_param_await = if is_declaration {
            self.param_await.get()
        } else {
            is_async
        };
        // RAII guards: restore on every exit path (incl. `?` early-returns),
        // mirroring `llvh::SaveAndRestore<bool>`. Held until end of function.
        let _save_name_param_yield = self.save_param_yield(name_param_yield);
        let _save_name_param_await = self.save_param_await(name_param_await);

        // identifier. C++ 415-416.
        let opt_id = self.parse_binding_identifier(Param::default());
        // If this is a default function declaration, then we can match
        // [+Default] function ( FormalParameters ) { FunctionBody }
        // so the identifier is optional and we can make it nullptr.
        // C++ 417-427.
        if is_declaration && !param.has(PARAM_DEFAULT) && opt_id.is_none() {
            // C++ 421-427: errorExpected(identifier, "after 'function'",
            // "location of 'function'", startLoc).
            self.error_expected_msg(
                "'identifier' expected after 'function'",
                Some("location of 'function'"),
                Some(start_loc),
            );
            return None;
        }

        // Flow type parameters after the name. C++ 429-438.
        let mut type_parameters: Option<&'gc Node<'gc>> = None;
        if self.parse_flow() && self.check(TokenKind::less) {
            type_parameters = Some(self.parse_type_params_flow()?);
        }
        // TS type parameters after the name. C++ 440-447.
        if self.parse_ts() && self.check(TokenKind::less) {
            type_parameters = Some(self.parse_ts_type_parameters()?);
        }

        // (
        // C++ 449-457: need(l_paren, "at start of function parameter list",
        // isDeclaration ? "function declaration starts here" : "function
        // expression starts here", startLoc).
        if !self.need_at(
            TokenKind::l_paren,
            " at start of function parameter list",
            Some(if is_declaration {
                "function declaration starts here"
            } else {
                "function expression starts here"
            }),
            start_loc,
        ) {
            return None;
        }

        let mut param_list: Vec<&'gc Node<'gc>> = Vec::new();

        // The params and body are parsed with paramYield/paramAwait set from the
        // generator/async-ness of THIS function. RAII guards restore on exit.
        // C++ 461-463.
        let _save_args_yield = self.save_param_yield(is_generator);
        let _save_args_await = self.save_param_await(is_async);

        if !self.parse_formal_parameters(param, &mut param_list) {
            return None;
        }

        // Flow return type and/or `%checks` predicate. C++ 468-487.
        let mut return_type: Option<&'gc Node<'gc>> = None;
        let mut predicate: Option<&'gc Node<'gc>> = None;
        if self.parse_flow() && self.check(TokenKind::colon) {
            let annot_start = self.advance(GrammarContext::Type).start;
            if !self.check_name(b"%checks") {
                return_type = Some(self.parse_return_type_annotation_flow(
                    Some(annot_start),
                    AllowAnonFunctionType::Yes,
                )?);
            }

            if self.check_name(b"%checks") {
                predicate = Some(self.parse_predicate_flow()?);
            }
        }
        // TS return type. C++ 488-498.
        if self.parse_ts() && self.check(TokenKind::colon) {
            let annot_start = self.advance(GrammarContext::Type).start;
            if !self.check_name(b"%checks") {
                return_type = Some(self.parse_type_annotation_ts(Some(annot_start))?);
            }
        }

        // {
        // C++ 500-508: need(l_brace, isDeclaration ? "in function
        // declaration" : "in function expression", isDeclaration ? "start
        // of function declaration" : "start of function expression",
        // startLoc).
        if !self.need_at(
            TokenKind::l_brace,
            if is_declaration {
                " in function declaration"
            } else {
                " in function expression"
            },
            Some(if is_declaration {
                "start of function declaration"
            } else {
                "start of function expression"
            }),
            start_loc,
        ) {
            return None;
        }

        // SaveFunctionState guard — mirrors C++ SaveFunctionState (cpp:510),
        // which is placed AFTER parseFormalParameters and BEFORE
        // parseFunctionBody. is_arrow=false: regular function resets the
        // arrow-bookkeeping flags so that nested arrows are tracked relative to
        // THIS function body, not a surrounding default-parameter expression.
        // The guard owns `Rc<Cell<bool>>` clones, so no borrow of `self` is
        // needed; it lives until the end of this function, covering the body.
        let _sfs = self.save_function_state(false);

        // Grammar context to be used when lexing the closing brace. C++ 512-514.
        let grammar_context = if is_declaration {
            GrammarContext::AllowRegExp
        } else {
            GrammarContext::AllowDiv
        };

        // cpp:516-560 — PreParse: create the keeper we want to keep BEFORE
        // the AllocationScope, parse the real body INSIDE the scope, and
        // reclaim the body subtree on scope exit. The keeper gets a blank
        // body; only the source extent (start..body end) is retained. The
        // side-table store inside parse_function_body (cpp:803-810) records
        // owned offsets/bools/bytes and safely survives the truncation.
        //
        // Adaptation: the C++ allocates the keeper node pre-scope and
        // returns it; we keep the keeper as a stack VALUE (its children —
        // params, blank body, id, types — are arena-allocated pre-scope)
        // and let set_location allocate it post-scope. Equivalent: either
        // way no keeper storage lies inside the truncated suffix.
        if self.pass == ParserPass::PreParse {
            // Blank body, unlocated, like the C++ `BlockStatementNode({},
            // false)` (cpp:531, 544).
            let blank_body = self.gc.alloc(Node::BlockStatement(
                BlockStatement::new(
                    NodeMetadata::new(self.dummy_range()),
                    NodeList::from_iter(self.gc, Vec::<&'gc Node<'gc>>::new()),
                    false,
                ),
            ));
            let params = NodeList::from_iter(self.gc, param_list);
            let keeper = if is_declaration {
                Node::FunctionDeclaration(FunctionDeclaration::new(
                    NodeMetadata::new(self.dummy_range()),
                    opt_id,
                    params,
                    blank_body,
                    type_parameters,
                    return_type,
                    predicate,
                    is_generator,
                    is_async,
                ))
            } else {
                Node::FunctionExpression(FunctionExpression::new(
                    NodeMetadata::new(self.dummy_range()),
                    opt_id,
                    params,
                    blank_body,
                    type_parameters,
                    return_type,
                    predicate,
                    is_generator,
                    is_async,
                ))
            };

            // cpp:548. SAFETY: nothing allocated inside the scope escapes —
            // the body subtree is discarded (only its end SMLoc, plain
            // data, is read out before the drop), the keeper and all its
            // children are pre-scope, and the side-table holds no node
            // references. On the error path the `?` drops the guard, which
            // is exactly the C++ dtor behavior.
            #[allow(unsafe_code)] // alloc_scope mirrors C++ AllocationScope
            let scope = unsafe { self.gc.alloc_scope() };
            let body = self.parse_function_body(
                Param::default(),
                false,
                is_generator,
                is_async,
                grammar_context,
                /* parse_directives= */ true,
            )?;
            let body_end = body.range().end;
            // `body` must not be used past this point: the drop reclaims
            // its storage.
            drop(scope);
            return Some(self.set_location(start_loc, body_end, keeper));
        }

        // The body's paramYield/paramAwait are the args+body values
        // (is_generator/is_async) — in the Full-pass port these are inert, but
        // we pass them for fidelity. C++ `saveArgsAndBodyParamYield.get()`
        // returns the NEW value, i.e. is_generator/is_async.
        let body = self.parse_function_body(
            Param::default(),
            force_eagerly,
            is_generator,
            is_async,
            grammar_context,
            /* parse_directives= */ true,
        )?;

        let body_end = body.range().end;
        let params = NodeList::from_iter(self.gc, param_list);

        let node = if is_declaration {
            Node::FunctionDeclaration(FunctionDeclaration::new(
                NodeMetadata::new(self.dummy_range()),
                opt_id,
                params,
                body,
                type_parameters,
                return_type,
                predicate,
                is_generator,
                is_async,
            ))
        } else {
            Node::FunctionExpression(FunctionExpression::new(
                NodeMetadata::new(self.dummy_range()),
                opt_id,
                params,
                body,
                type_parameters,
                return_type,
                predicate,
                is_generator,
                is_async,
            ))
        };
        Some(self.set_location(start_loc, body_end, node))
    }

    // -----------------------------------------------------------------------
    // parseFormalParameters — 600 in JSParserImpl.cpp
    // -----------------------------------------------------------------------

    /// Parse a parenthesized formal parameter list, appending each parameter
    /// node to `param_list`. Port of `JSParserImpl::parseFormalParameters`
    /// (lines 600-667). Returns false on error.
    pub(super) fn parse_formal_parameters(
        &mut self,
        param: Param,
        param_list: &mut Vec<&'gc Node<'gc>>,
    ) -> bool {
        debug_assert!(
            self.check(TokenKind::l_paren),
            "FormalParameters must start with '('"
        );
        // (
        let lparen_loc = self.advance(GrammarContext::AllowRegExp).start;

        // The first parameter can be 'this' in Flow and TypeScript.
        // C++ 607-633.
        if self.parse_types() && self.check(TokenKind::rw_this) {
            let name = self.lexer.token().get_res_word_or_identifier();
            let this_param_start = self.advance(GrammarContext::AllowRegExp).start;

            let annot_start = self.cur_start();
            // C++ 622-628: eat(colon, Type, "in 'this' type annotation",
            // "start of 'this'", thisParamStart).
            if !self.eat_at(
                TokenKind::colon,
                GrammarContext::Type,
                " in 'this' type annotation",
                Some("start of 'this'"),
                this_param_start,
            ) {
                return false;
            }

            let Some(type_annotation) = self.parse_type_annotation(
                Some(annot_start),
                AllowAnonFunctionType::Yes,
            ) else {
                return false;
            };
            let node = Node::Identifier(Identifier::new(
                NodeMetadata::new(self.dummy_range()),
                name,
                Some(type_annotation),
                false,
            ));
            let end = self.lexer.prev_token_end();
            param_list.push(self.set_location(this_param_start, end, node));

            self.check_and_eat(TokenKind::comma, GrammarContext::AllowRegExp);
        }

        // C++ 635-654.
        while !self.check(TokenKind::r_paren) {
            if self.check(TokenKind::dotdotdot) {
                // BindingRestElement.
                match self.parse_binding_rest_element(param) {
                    Some(rest) => param_list.push(rest),
                    None => return false,
                }
                break;
            }

            // BindingElement.
            match self.parse_binding_element(param) {
                Some(elem) => param_list.push(elem),
                None => return false,
            }

            if !self.check_and_eat(TokenKind::comma, GrammarContext::AllowRegExp)
            {
                break;
            }
        }

        // )
        // C++ 656-664: eat(r_paren, AllowRegExp, "at end of function
        // parameter list", "start of parameter list", lparenLoc).
        self.eat_at(
            TokenKind::r_paren,
            GrammarContext::AllowRegExp,
            " at end of function parameter list",
            Some("start of parameter list"),
            lparen_loc,
        )
    }

    // -----------------------------------------------------------------------
    // parseFunctionBody — 740 in JSParserImpl.cpp
    // -----------------------------------------------------------------------

    /// Parse a function body (a brace-enclosed block in the `[Return]` context).
    /// Port of `JSParserImpl::parseFunctionBody` (lines 740-813).
    ///
    /// The `pass_ == LazyParse && !eagerly` block (747-797) is now ported: when
    /// in LazyParse mode and the body is not forced eager, we seek past it and
    /// return a stub `BlockStatement` with `is_lazy_function_body=true`.
    /// The `pass_ == PreParse` store (803-810) records `PreParsedFunctionInfo`
    /// for a subsequent `LazyParse` to consume.
    #[allow(clippy::too_many_arguments)]
    pub(super) fn parse_function_body(
        &mut self,
        _param: Param,
        eagerly: bool,
        param_yield: bool,
        param_await: bool,
        grammar_context: GrammarContext,
        parse_directives: bool,
    ) -> Option<&'gc Node<'gc>> {
        // cpp:747-796 — LazyParse skip block: if we are in LazyParse mode and
        // the function is not forced eager, skip the body by seeking past it
        // and return a stub BlockStatement with the decoration fields set.
        if self.pass == ParserPass::LazyParse && !eagerly {
            let start = self.cur_start();
            // The pre-parse table is keyed by the `{` offset.
            let info = self
                .pre_parsed
                .function_info
                .get(&start.offset)
                .expect("no function info stored during preparse")
                .clone();
            let end = info.end;
            if (end.offset - start.offset) as u32
                >= self.gc.ctx().preemptive_function_compilation_threshold()
            {
                // Seek the lexer past the closing `}` and scan the next token
                // (which is the token *after* the `}`, i.e. past the body).
                self.lexer.seek(end);
                self.advance(grammar_context);
                // Ensure prev_token_end reflects the `}` position because
                // seek() bypassed the normal advance() bookkeeping.
                // C++ line 763.
                self.lexer.set_prev_token_end_loc(end);
                // Propagate "use strict" from the pre-parsed info so that code
                // after the body sees the correct strictness. C++ line 766.
                self.lexer.set_strict_mode(info.strict_mode);

                // Build stub directive nodes: one ExpressionStatement wrapping
                // a StringLiteral per directive recorded during PreParse.
                // C++ lines 771-778.
                use hermes_ast::node::{
                    BlockStatement, ExpressionStatement, StringLiteral,
                };
                let mut stmt_list: Vec<&'gc Node<'gc>> = Vec::new();
                for dir_bytes in &info.directives {
                    // Re-intern the raw directive bytes into the current
                    // session's atom table (atoms are arena-scoped).
                    let atom = self.lexer.get_identifier(dir_bytes);
                    let str_node = Node::StringLiteral(StringLiteral::new(
                        NodeMetadata::new(self.dummy_range()),
                        atom,
                    ));
                    let str_lit =
                        self.set_location(start, end, str_node);
                    let dir_stmt =
                        Node::ExpressionStatement(ExpressionStatement::new(
                            NodeMetadata::new(self.dummy_range()),
                            str_lit,
                            atom,
                        ));
                    stmt_list.push(self.gc.alloc(dir_stmt));
                }

                // Build the stub BlockStatement. C++ lines 780-794.
                let stmts = NodeList::from_iter(self.gc, stmt_list);
                let body_node =
                    Node::BlockStatement(BlockStatement::new(
                        NodeMetadata::new(self.dummy_range()),
                        stmts,
                        false,
                    ));
                let body = self.set_location(start, end, body_node);
                // Set lazy decoration fields.
                if let Node::BlockStatement(b) = body {
                    b.is_lazy_function_body.set(true);
                    b.param_yield.set(param_yield);
                    b.param_await.set(param_await);
                    b.buffer_id.set(self.lexer.get_buffer_id().index());
                    b.contains_arrow_functions
                        .set(info.contains_arrow_functions);
                    b.may_contain_arrow_functions_using_arguments
                        .set(info.may_contain_arrow_functions_using_arguments);
                }
                return Some(body);
            }
        }

        let body = self.parse_block(PARAM_RETURN, grammar_context, parse_directives)?;

        // cpp:803-810 — record this function body in the PreParse side-table so
        // that a subsequent LazyParse run can skip over it. The C++ uses an
        // AllocationScope to discard the AST; Rust just lets the GC arena
        // reclaim nodes after the PreParse GCLock is dropped.
        if self.pass == ParserPass::PreParse {
            let key = body.range().start.offset;
            self.pre_parsed.function_info.insert(
                key,
                PreParsedFunctionInfo {
                    end: body.range().end,
                    strict_mode: self.lexer.is_strict_mode(),
                    directives: self.copy_seen_directives(),
                    contains_arrow_functions: self.contains_arrow_functions.get(),
                    may_contain_arrow_functions_using_arguments: self
                        .may_contain_arrow_functions_using_arguments
                        .get(),
                },
            );
        }

        Some(body)
    }

    // -----------------------------------------------------------------------
    // parseFunctionDeclaration — JSParserImpl.h ~717 (thin wrapper)
    // -----------------------------------------------------------------------

    /// Parse a function declaration. Port of the thin wrapper
    /// `JSParserImpl::parseFunctionDeclaration` which calls
    /// `parseFunctionHelper(param, /*isDeclaration*/ true,
    /// /*forceEagerly*/ false)`.
    pub(super) fn parse_function_declaration(
        &mut self,
        param: Param,
        force_eagerly: bool,
    ) -> Option<&'gc Node<'gc>> {
        self.parse_function_helper(
            param,
            /* is_declaration= */ true,
            force_eagerly,
        )
    }

    // -----------------------------------------------------------------------
    // parseFunctionExpression — JSParserImpl.cpp 3417 (thin wrapper)
    // -----------------------------------------------------------------------

    /// Parse a function expression. Port of the thin wrapper
    /// `JSParserImpl::parseFunctionExpression(forceEagerly=false)` which calls
    /// `parseFunctionHelper(Param{}, /*isDeclaration*/ false, forceEagerly)`.
    pub(super) fn parse_function_expression(
        &mut self,
        force_eagerly: bool,
    ) -> Option<&'gc Node<'gc>> {
        self.parse_function_helper(
            Param::default(),
            /* is_declaration= */ false,
            force_eagerly,
        )
    }
}