@oseo/backend-c 0.0.0-stage → 0.1.0-canary.370

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1331 @@
1
+ //#region src/emitted-c.ts
2
+ /*! SPDX-License-Identifier: MIT
3
+ * Oseo C templates incorporated into compiled programs.
4
+ *
5
+ * MIT License
6
+ *
7
+ * Copyright (c) 2026 Hong Minhee <https://hongminhee.org/>
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ */
27
+ const emittedC = {
28
+ normalReturn: {
29
+ resultAssignOseoResultOseoStatusNormal: [
30
+ [""],
31
+ ["result = (OseoResult){OSEO_STATUS_NORMAL, "],
32
+ ["};"]
33
+ ],
34
+ releaseRoots: [[""], ["oseo_roots_release(context, &frame);"]],
35
+ returnResult: [[""], ["return result;"]]
36
+ },
37
+ cString: {
38
+ backslashEscape: [["\\\\"]],
39
+ quoteEscape: [["\\\""]],
40
+ questionMarkEscape: [["\\?"]],
41
+ newlineEscape: [["\\n"]],
42
+ octalEscape: [["\\"], [""]],
43
+ octalPadding: [["0"]]
44
+ },
45
+ line: { indentLine: [[" "], [""]] },
46
+ location: {
47
+ sourceLocationPrefix: [
48
+ ["oseo_context_source_location(context, \""],
49
+ ["\", "],
50
+ ["u, "]
51
+ ],
52
+ locationPrefix: [["oseo_context_location(context, "], ["u, "]]
53
+ },
54
+ common: {
55
+ sourcePositionSuffix: [
56
+ [""],
57
+ ["u, "],
58
+ ["u);"]
59
+ ],
60
+ positionSuffix: [[""], ["u);"]],
61
+ staticConstUint16TAssignStatement: [
62
+ ["static const uint16_t "],
63
+ ["[] = {"],
64
+ ["};"]
65
+ ],
66
+ staticConstSizeTArrayAssignStatement: [
67
+ ["static const size_t "],
68
+ ["[] = {"],
69
+ ["};"]
70
+ ],
71
+ commaSpace: [[", "]],
72
+ rootAssignResultValue: [["roots["], ["] = result.value;"]],
73
+ rootsAssignOseoUndefinedStatement: [["roots["], ["] = oseo_undefined();"]],
74
+ trueValue: [["true"]],
75
+ falseValue: [["false"]],
76
+ rootsAssignOseoBooleanStatement: [
77
+ ["roots["],
78
+ ["] = oseo_boolean("],
79
+ [");"]
80
+ ],
81
+ gotoAbruptUnlessNormal: [["if (result.status != OSEO_STATUS_NORMAL) goto ab", "rupt;"]],
82
+ nullPointer: [["NULL"]],
83
+ rootAssignRoot: [
84
+ ["roots["],
85
+ ["] = roots["],
86
+ ["];"]
87
+ ],
88
+ undefinedValue: [["oseo_undefined()"]],
89
+ root: [["roots["], ["]"]],
90
+ resultAssignOseoEnvironmentGetContext: [["result = oseo_environment_get(context, "]],
91
+ rootsUStatement: [
92
+ ["roots["],
93
+ ["], "],
94
+ ["u);"]
95
+ ],
96
+ statusNormalOpen: [["if (result.status == OSEO_STATUS_NORMAL) {"]],
97
+ closeBlock: [["}"]],
98
+ resultAssignOseoCellCreateContextOseo: [["result = oseo_cell_create(context, oseo_uninitia", "lized());"]],
99
+ rootsU: [
100
+ ["roots["],
101
+ ["], "],
102
+ ["u, "]
103
+ ],
104
+ rootCallSuffix: [["roots["], ["]);"]],
105
+ rootsAssign: [["roots["], ["] = "]],
106
+ unaryToNumber: [["oseo_to_number"]],
107
+ unaryToNumeric: [["oseo_to_numeric"]],
108
+ unaryNumericOne: [["oseo_numeric_one"]],
109
+ unaryNegate: [["oseo_negate"]],
110
+ unaryToString: [["oseo_to_string"]],
111
+ unaryTypeof: [["oseo_typeof"]],
112
+ unaryBitwiseNot: [["oseo_bitwise_not"]],
113
+ oseoToBooleanRoots: [["oseo_to_boolean(roots["], ["])"]],
114
+ iteratorDone: [["iterator_done_"], [""]],
115
+ empty: [[""]],
116
+ iteratorDelegateNext: [["next"]],
117
+ iteratorDelegateReturn: [["return"]],
118
+ iteratorDelegateThrow: [["throw"]],
119
+ rootWithComma: [["roots["], ["], "]],
120
+ twoRootsWithComma: [
121
+ ["roots["],
122
+ ["], "],
123
+ [", "]
124
+ ],
125
+ boolFastAssignStatement: [
126
+ ["bool fast_"],
127
+ [" = !"],
128
+ [";"]
129
+ ],
130
+ voidFastStatement: [["(void)fast_"], [";"]],
131
+ rootsRootsAddressRoots: [
132
+ ["roots["],
133
+ ["], roots["],
134
+ ["], &roots["],
135
+ ["], "]
136
+ ],
137
+ ifOpen: [["if ("], [") {"]],
138
+ resultAssignOseoResultOseoStatusNormalOseo: [[
139
+ " result = (OseoResult){OSEO_STATUS_NORMAL, os",
140
+ "eo_undef",
141
+ "ined()};"
142
+ ]],
143
+ elseOpen: [["} else {"]],
144
+ addressStatement: [["&"], [");"]],
145
+ rootsCompletionUKindEqualStatement: [
146
+ ["roots["],
147
+ ["], completion["],
148
+ ["u].kind == 2);"]
149
+ ],
150
+ callSuffix: [[""], [");"]],
151
+ resultAssignContext: [["result = "], ["(context, "]],
152
+ twoValuesCallSuffix: [
153
+ [""],
154
+ [", "],
155
+ [");"]
156
+ ],
157
+ valueWithComma: [[""], [", "]],
158
+ undefinedFinalArgumentCallSuffix: [["oseo_undefined());"]],
159
+ twoValuesWithComma: [
160
+ [""],
161
+ [", "],
162
+ [", "]
163
+ ],
164
+ indentedCloseBlock: [[" }"]],
165
+ unsignedWithComma: [[""], ["u, "]],
166
+ resultAssignOseoObjectDefineContextRoots: [["result = oseo_object_define(context, roots["], ["], "]],
167
+ rootsRoots: [
168
+ ["roots["],
169
+ ["], roots["],
170
+ ["], "]
171
+ ],
172
+ rootsRootsStatement: [
173
+ ["roots["],
174
+ ["], roots["],
175
+ ["]);"]
176
+ ],
177
+ rootsStatement: [
178
+ ["roots["],
179
+ ["], "],
180
+ [");"]
181
+ ],
182
+ resultAssignOseoFunctionPrototypeContext: [["result = oseo_function_prototype(context, roots["], ["]);"]],
183
+ rootsAssignResultValueIfStatusNormal: [["if (result.status == OSEO_STATUS_NORMAL) roots["], ["] = result.value;"]],
184
+ rootsRootsRootsStatement: [
185
+ ["roots["],
186
+ ["], roots["],
187
+ ["], roots["],
188
+ ["]);"]
189
+ ],
190
+ privateGetterKind: [["OSEO_PRIVATE_GETTER"]],
191
+ privateSetterKind: [["OSEO_PRIVATE_SETTER"]],
192
+ privateMethodKind: [["OSEO_PRIVATE_METHOD"]],
193
+ resultAssignOseoModuleNamespaceCreate: [["result = oseo_module_namespace_create(context, "]],
194
+ bracedInitializer: [["{"], ["};"]],
195
+ oseoContextClearLanguageErrorContext: [["oseo_context_clear_language_error(context);"]],
196
+ resultAssignOseoResultOseoStatusNormal: [["result = (OseoResult){OSEO_STATUS_NORMAL, "]],
197
+ rootUnsignedInitializerSuffix: [["roots["], ["u]};"]],
198
+ contextMemberSourceIdLengthStatement: [["context->source_id_length;"]],
199
+ uStatement: [[""], ["u;"]],
200
+ rootsUAssign: [[" roots["], ["u] = "]],
201
+ gotoBbStatement: [[" goto bb"], [";"]],
202
+ returnResult: [["return result;"]],
203
+ gotoBlock: [["goto bb"], [";"]],
204
+ ifCompletionKindThrowOpen: [["if (completion["], ["u].kind == 2) {"]],
205
+ rootUnsigned: [["roots["], ["u]"]],
206
+ indent: [[" "]],
207
+ caseUGotoBbStatement: [
208
+ ["case "],
209
+ ["u: goto bb"],
210
+ [";"]
211
+ ],
212
+ defaultAbortStatement: [["default: abort();"]],
213
+ resultAssignOseoEnvironmentGetContextRoots: [["result = oseo_environment_get(context, roots["], ["], "]],
214
+ ifOseoGeneratorResumeKindGeneratorEqual: [["if (oseo_generator_resume_kind(generator) == "]],
215
+ voidCompletionLine: [[" (void)completion;\n"]],
216
+ abruptLabel: [["abrupt:"]],
217
+ oseoContextPointerContextLine: [[" OseoContext *context,\n"]],
218
+ functionBodyOpenLine: [[") {\n"]],
219
+ voidCalleeLine: [[" (void)callee;\n"]],
220
+ voidReceiverLine: [[" (void)receiver;\n"]],
221
+ valueThenNewline: [[""], ["\n"]],
222
+ newline: [["\n"]],
223
+ closeBlockLine: [["}\n"]],
224
+ script: [["script"]],
225
+ oseoResultResultLine: [[" OseoResult result;\n"]],
226
+ valueThenBlankLine: [[""], ["\n\n"]]
227
+ },
228
+ operatorHelper: {
229
+ oseoNotLooseEqual: [["oseo_not_loose_equal"]],
230
+ oseoNotStrictEqual: [["oseo_not_strict_equal"]],
231
+ oseoRemainder: [["oseo_remainder"]],
232
+ oseoBitwiseAnd: [["oseo_bitwise_and"]],
233
+ oseoMultiply: [["oseo_multiply"]],
234
+ oseoExponentiate: [["oseo_exponentiate"]],
235
+ oseoAdd: [["oseo_add"]],
236
+ oseoSubtract: [["oseo_subtract"]],
237
+ oseoDivide: [["oseo_divide"]],
238
+ oseoLessThan: [["oseo_less_than"]],
239
+ oseoShiftLeft: [["oseo_shift_left"]],
240
+ oseoLessEqual: [["oseo_less_equal"]],
241
+ oseoLooseEqual: [["oseo_loose_equal"]],
242
+ oseoStrictEqual: [["oseo_strict_equal"]],
243
+ oseoGreaterThan: [["oseo_greater_than"]],
244
+ oseoGreaterEqual: [["oseo_greater_equal"]],
245
+ oseoShiftRight: [["oseo_shift_right"]],
246
+ oseoShiftRightUnsigned: [["oseo_shift_right_unsigned"]],
247
+ oseoBitwiseXor: [["oseo_bitwise_xor"]],
248
+ oseoHasProperty: [["oseo_has_property"]],
249
+ oseoInstanceof: [["oseo_instanceof"]],
250
+ oseoBitwiseOr: [["oseo_bitwise_or"]]
251
+ },
252
+ numberLiteral: {
253
+ nan: [["NAN"]],
254
+ positiveInfinity: [["INFINITY"]],
255
+ negativeInfinity: [["-INFINITY"]],
256
+ negativeZero: [["-0.0"]],
257
+ integerAsDouble: [[""], [".0"]]
258
+ },
259
+ stringConstant: {
260
+ nullU: [["NULL, 0u"]],
261
+ stringUnits: [["string_units_"], [""]],
262
+ unitsWithLength: [
263
+ [""],
264
+ [", "],
265
+ ["u"]
266
+ ],
267
+ resultAssignOseoStringFromUnitsContext: [["result = oseo_string_from_units(context, "], [");"]]
268
+ },
269
+ templateObject: {
270
+ siteDeclaration: [["static const char "], [" = 0;"]],
271
+ pointerArrayDeclaration: [
272
+ ["static const uint16_t *const "],
273
+ ["[] = {"],
274
+ ["};"]
275
+ ],
276
+ sizeArrayDeclaration: [
277
+ ["static const size_t "],
278
+ ["[] = {"],
279
+ ["};"]
280
+ ],
281
+ boolArrayDeclaration: [
282
+ ["static const bool "],
283
+ ["[] = {"],
284
+ ["};"]
285
+ ],
286
+ resultAssign: [
287
+ ["result = oseo_template_object(context, &"],
288
+ [", "],
289
+ ["u, "],
290
+ [", "],
291
+ [", "],
292
+ [", "],
293
+ [", "],
294
+ [");"]
295
+ ]
296
+ },
297
+ regexpLiteral: {
298
+ uint16ArrayDeclaration: [
299
+ ["static uint16_t "],
300
+ ["[] = {"],
301
+ ["};"]
302
+ ],
303
+ uint32ArrayDeclaration: [
304
+ ["static uint32_t "],
305
+ ["[] = {"],
306
+ ["};"]
307
+ ],
308
+ instructionArrayDeclaration: [
309
+ ["static OseoRegExpInstruction "],
310
+ ["[] = {"],
311
+ ["};"]
312
+ ],
313
+ repeatArrayDeclaration: [
314
+ ["static OseoRegExpRepeat "],
315
+ ["[] = {"],
316
+ ["};"]
317
+ ],
318
+ captureArrayDeclaration: [
319
+ ["static OseoRegExpCapture "],
320
+ ["[] = {"],
321
+ ["};"]
322
+ ],
323
+ instructionValue: [
324
+ ["{"],
325
+ ["u, "],
326
+ ["u, {"],
327
+ ["u, "],
328
+ ["u, "],
329
+ ["u, "],
330
+ ["u}}"]
331
+ ],
332
+ repeatValue: [
333
+ ["{"],
334
+ [", "],
335
+ [", "],
336
+ ["u, "],
337
+ ["u}"]
338
+ ],
339
+ captureValue: [
340
+ ["{"],
341
+ ["u, "],
342
+ ["u, "],
343
+ ["}"]
344
+ ],
345
+ unsignedValue: [[""], ["u"]],
346
+ unsignedLongValue: [["UINT64_C("], [")"]],
347
+ unboundedValue: [["UINT64_MAX"]],
348
+ programDeclaration: [
349
+ ["static OseoRegExpProgram "],
350
+ [" = {"],
351
+ ["};"]
352
+ ],
353
+ literalDeclaration: [
354
+ ["static const OseoRegExpLiteral "],
355
+ [" = {"],
356
+ ["};"]
357
+ ],
358
+ programAddress: [["&"], [""]],
359
+ resultAssign: [["result = oseo_regexp_literal(context, &"], [");"]]
360
+ },
361
+ constant: {
362
+ resultAssignBigIntLiteral: [
363
+ ["result = oseo_bigint_literal(context, \""],
364
+ ["\", "],
365
+ ["u);"]
366
+ ],
367
+ rootsAssignOseoNullStatement: [["roots["], ["] = oseo_null();"]],
368
+ rootsAssignOseoNumberStatement: [
369
+ ["roots["],
370
+ ["] = oseo_number("],
371
+ [");"]
372
+ ]
373
+ },
374
+ arguments: {
375
+ incomingCount: [["argument_count"]],
376
+ incomingValues: [["arguments"]],
377
+ argumentCount: [["argument_count_"], [""]],
378
+ argumentValues: [["argument_values_"], [""]],
379
+ sizeTAssignUStatement: [["size_t "], [" = 0u;"]],
380
+ constOseoValuePointerAssignNullStatement: [["const OseoValue *"], [" = NULL;"]],
381
+ resultAssignOseoArgumentListViewContext: [["result = oseo_argument_list_view(context, "]],
382
+ rootsAddressAddressStatement: [
383
+ ["roots["],
384
+ ["], &"],
385
+ [", &"],
386
+ [");"]
387
+ ],
388
+ zeroUnsigned: [["0u"]],
389
+ unsignedCount: [[""], ["u"]],
390
+ addressOfRoot: [["&roots["], ["]"]]
391
+ },
392
+ argument: {
393
+ boundedArgumentCount: [
394
+ ["("],
395
+ [" > "],
396
+ ["u ? "]
397
+ ],
398
+ oseoUndefined: [
399
+ [""],
400
+ ["["],
401
+ ["] : oseo_undefined())"]
402
+ ]
403
+ },
404
+ read: { resultAssignOseoCellGetContextResultValue: [["result = oseo_cell_get(context, result.value);"]] },
405
+ write: {
406
+ resultAssignOseoResultOseoStatusNormal: [["result = (OseoResult){OSEO_STATUS_NORMAL, roots["], ["]};"]],
407
+ resultAssignOseoWriteImmutableBinding: [["result = oseo_write_immutable_binding(context);"]],
408
+ resultAssignOseoCellGetContextResultValue: [[" result = oseo_cell_get(context, result.value", ");"]],
409
+ indentedWriteImmutableBinding: [[" result = oseo_write_immutable_binding(contex", "t);"]],
410
+ resultAssignOseoCellSetContextResultValue: [["result = oseo_cell_set(context, result.value, ro", "ots["], ["]);"]],
411
+ resultAssignOseoGlobalBindingSet: [
412
+ [
413
+ "result = oseo_global_binding_set(context, result.",
414
+ "value, ro",
415
+ "ots["
416
+ ],
417
+ ["], "],
418
+ [");"]
419
+ ]
420
+ },
421
+ initialize: { resultAssignOseoCellInitializeContext: [[
422
+ "result = oseo_cell_initialize(context, result.va",
423
+ "lue, roo",
424
+ "ts["
425
+ ], ["]);"]] },
426
+ bindingReset: { resultAssignOseoEnvironmentSetContext: [[" result = oseo_environment_set(context, "]] },
427
+ unary: {
428
+ oseoBooleanOseoToBooleanRootsStatement: [["oseo_boolean(!oseo_to_boolean(roots["], ["]));"]],
429
+ resultAssignContextRootsStatement: [
430
+ ["result = "],
431
+ ["(context, roots["],
432
+ ["]);"]
433
+ ]
434
+ },
435
+ binary: {
436
+ resultAssign: [["result = "], [""]],
437
+ contextRootsRootsStatement: [
438
+ ["(context, roots["],
439
+ ["], roots["],
440
+ ["]);"]
441
+ ]
442
+ },
443
+ guardSmi: { boolFastAssignOseoValueIsSmiRootsStatement: [
444
+ ["bool fast_"],
445
+ [" = oseo_value_is_smi(roots["],
446
+ ["]);"]
447
+ ] },
448
+ unboxSmi: {
449
+ int64TFastAssign: [["int64_t fast_"], [" = "]],
450
+ oseoValueUnboxSmiRootsStatement: [["oseo_value_unbox_smi(roots["], ["]);"]]
451
+ },
452
+ checkedAdd: {
453
+ int64TFastStatement: [["int64_t fast_"], [";"]],
454
+ boolFastAssignOseoSmiTryAdd: [["bool fast_"], [" = oseo_smi_try_add("]],
455
+ fastFastAddressFastStatement: [
456
+ ["fast_"],
457
+ [", fast_"],
458
+ [", &fast_"],
459
+ [");"]
460
+ ]
461
+ },
462
+ boxSmi: { rootsAssignOseoValueBoxSmiFastStatement: [
463
+ ["roots["],
464
+ ["] = oseo_value_box_smi(fast_"],
465
+ [");"]
466
+ ] },
467
+ enumerateOperation: {
468
+ boolEnumerateDoneAssignTrueStatement: [["bool enumerate_done_"], [" = true;"]],
469
+ resultAssignOseoEnumerateGetContext: [
470
+ ["result = oseo_enumerate_get(context, roots["],
471
+ ["], &roots["],
472
+ ["], &enumerate_done_"],
473
+ [");"]
474
+ ],
475
+ resultAssignOseoEnumerateNextContext: [
476
+ ["result = oseo_enumerate_next(context, roots["],
477
+ ["], &roots["],
478
+ ["], &enumerate_done_"],
479
+ [");"]
480
+ ],
481
+ boolFastAssignEnumerateDoneStatement: [
482
+ ["bool fast_"],
483
+ [" = !enumerate_done_"],
484
+ [";"]
485
+ ]
486
+ },
487
+ disposalOperation: {
488
+ resultAssignScopeCreate: [["result = oseo_dispose_scope_create(context, "], [");"]],
489
+ resultAssignScopeAdd: [
490
+ ["result = oseo_dispose_scope_add(context, roots["],
491
+ ["], roots["],
492
+ ["], "],
493
+ [");"]
494
+ ],
495
+ resultAssignScopeCompletion: [
496
+ ["result = oseo_dispose_scope_"],
497
+ ["(context, roots["],
498
+ ["], completion["],
499
+ ["u].kind == 2, roots["],
500
+ ["]);"]
501
+ ],
502
+ resultAssignScopeQuery: [
503
+ ["result = oseo_dispose_scope_"],
504
+ ["(context, roots["],
505
+ ["]);"]
506
+ ],
507
+ resultAssignScopeContinue: [
508
+ ["result = oseo_dispose_scope_continue(context, roots["],
509
+ ["], "],
510
+ [", roots["],
511
+ ["]);"]
512
+ ]
513
+ },
514
+ iteratorOperation: {
515
+ asyncPrefix: [["async_"]],
516
+ resultAssignOseoIteratorGetContext: [["result = oseo_"], ["iterator_get(context, "]],
517
+ rootsAddressRootsStatement: [
518
+ ["roots["],
519
+ ["], &roots["],
520
+ ["]);"]
521
+ ],
522
+ rootsAssignOseoBooleanFalseStatement: [["roots["], ["] = oseo_boolean(false);"]],
523
+ rootsAssignCompletionKindThrowStatement: [
524
+ ["roots["],
525
+ ["] = oseo_boolean(completion["],
526
+ ["u].kind == 2);"]
527
+ ],
528
+ boolIteratorCloseAwaitAssignFalseStatement: [["bool iterator_close_await_"], [" = false;"]],
529
+ boolFastAssignIteratorCloseAwaitStatement: [
530
+ ["bool fast_"],
531
+ [" = iterator_close_await_"],
532
+ [";"]
533
+ ],
534
+ resultAssignOseoAsyncIteratorCloseStartContext: [
535
+ ["result = oseo_async_iterator_close_start(context, roots["],
536
+ ["], completion["],
537
+ ["u].kind == 2, &roots["],
538
+ ["], &iterator_close_await_"],
539
+ [");"]
540
+ ],
541
+ resultAssignOseoAsyncIteratorCloseResultContext: [
542
+ ["result = oseo_async_iterator_close_result(context, roots["],
543
+ ["], oseo_to_boolean(roots["],
544
+ ["]), oseo_to_boolean(roots["],
545
+ ["]));"]
546
+ ],
547
+ resultAssignOseoAsyncIteratorNextStartContext: [
548
+ ["result = oseo_async_iterator_next_start(context, roots["],
549
+ ["], roots["],
550
+ ["]);"]
551
+ ],
552
+ resultAssignOseoAsyncIteratorDelegateStartContext: [
553
+ ["result = oseo_async_iterator_delegate_"],
554
+ ["_start(context, roots["],
555
+ ["], "]
556
+ ],
557
+ rootsRootsAddressRootsStatementSuffix: [
558
+ ["roots["],
559
+ ["], roots["],
560
+ ["], &roots["],
561
+ ["]);"]
562
+ ],
563
+ rootsAddressRootsStatementSuffix: [
564
+ ["roots["],
565
+ ["], &roots["],
566
+ ["]);"]
567
+ ],
568
+ resultAssignOseoAsyncIteratorResultContext: [
569
+ ["result = oseo_async_iterator_result(context, roots["],
570
+ ["], oseo_to_boolean(roots["],
571
+ ["]), "],
572
+ [", roots["],
573
+ ["], "],
574
+ [", &roots["],
575
+ ["], &iterator_done_"],
576
+ [");"]
577
+ ],
578
+ boolIteratorDoneAssignFalseStatement: [["bool iterator_done_"], [" = false;"]],
579
+ boolAssignTrueStatement: [["bool "], [" = true;"]],
580
+ resultAssignOseoIteratorDelegateContext: [
581
+ ["result = oseo_"],
582
+ ["iterator_delegate_"],
583
+ ["(context, "]
584
+ ],
585
+ addressRootsAddressStatement: [
586
+ ["&roots["],
587
+ ["], &"],
588
+ [");"]
589
+ ],
590
+ boolIteratorDoneAssignTrueStatement: [["bool iterator_done_"], [" = true;"]],
591
+ resultAssignOseoIteratorNextContext: [["result = oseo_"], ["iterator_next(context, "]],
592
+ addressIteratorDoneStatement: [["&iterator_done_"], [");"]],
593
+ boolFastAssignIteratorDoneStatement: [
594
+ ["bool fast_"],
595
+ [" = !iterator_done_"],
596
+ [";"]
597
+ ],
598
+ iteratorStepDone: [["iterator_step_done_"], [""]],
599
+ boolAssignStatement: [
600
+ ["bool "],
601
+ [" = "],
602
+ [";"]
603
+ ],
604
+ rootsAssignOseoUndefinedStatement: [[" roots["], ["] = oseo_undefined();"]],
605
+ indentedIteratorNext: [[" result = oseo_"], ["iterator_next(context, "]],
606
+ resultAssignOseoIteratorCloseContext: [["result = oseo_"], ["iterator_close(context, "]],
607
+ indentedIteratorClose: [[" result = oseo_"], ["iterator_close(context, "]]
608
+ },
609
+ call: {
610
+ resultAssignOseoConsoleLogContext: [["result = oseo_console_log(context, "], [", "]],
611
+ resultAssignOseoModuleGraphEvaluateContext: [["result = oseo_module_graph_evaluate(context, "], [", "]],
612
+ resultAssignOseoModuleImportContext: [["result = oseo_module_import(context, "], [", "]],
613
+ resultAssignOseoPromiseAsyncCallContext: [["result = oseo_promise_async_call(context, "], [");"]],
614
+ resultAssignOseoPromiseAwaitThenContext: [["result = oseo_promise_await_then(context, "]],
615
+ resultAssignOseoPromiseThenContext: [["result = oseo_promise_then(context, "]],
616
+ threeValuesCallSuffix: [
617
+ [""],
618
+ [", "],
619
+ [", "],
620
+ [");"]
621
+ ],
622
+ oseoPromiseAll: [["oseo_promise_all"]],
623
+ oseoPromiseResolve: [["oseo_promise_resolve"]],
624
+ resultAssignContextStatement: [
625
+ ["result = "],
626
+ ["(context, "],
627
+ [");"]
628
+ ],
629
+ resultAssignOseoSetTimeoutContext: [["result = oseo_set_timeout(context, "], [", "]],
630
+ resultAssignOseoClearTimeoutContext: [["result = oseo_clear_timeout(context, "], [");"]],
631
+ callFunctionWithDynamicReceiverPrefix: [["result = oseo_call_function(context, roots["], ["], "]],
632
+ resultAssignOseoConstructorResult: [[" result = oseo_constructor_result("]],
633
+ contextResultValueRootsStatement: [["context, result.value, roots["], ["]);"]],
634
+ callFunctionWithReceiverPrefix: [["result = oseo_call_function(context, roots["], ["], receiver, "]],
635
+ callFunctionWithRootReceiverPrefix: [
636
+ ["result = oseo_call_function(context, roots["],
637
+ ["], roots["],
638
+ ["], "]
639
+ ],
640
+ newTargetStatement: [
641
+ [""],
642
+ [", "],
643
+ [", new_target);"]
644
+ ],
645
+ resultAssignOseoConstructorResultContext: [[" result = oseo_constructor_result(context, re", "sult.value, receiver);"]],
646
+ resultAssignOseoConstructorResultContextValueRoot: [[" result = oseo_constructor_result(context, result.value, roots["], ["]);"]],
647
+ oseoFunction: [["oseo_function_"], [""]],
648
+ recursiveTarget: [["recursive_target_"], [""]],
649
+ oseoFunctionEntryVolatileAssign: [["OseoFunctionEntry volatile "], [" = "]],
650
+ oseoFunctionStatement: [["oseo_function_"], [";"]],
651
+ resultAssignOseoCallEnterContextStatement: [["result = oseo_call_enter(context);"]],
652
+ resultAssignOseoFrameEnterContextU: [[" result = oseo_frame_enter(context, OSEO_CALLABLE_FRAME_COST("], ["u));"]],
653
+ ifResultStatusEqualOseoStatusNormalOpen: [[" if (result.status == OSEO_STATUS_NORMAL) {"]],
654
+ resultAssign: [[" result = "], [""]],
655
+ contextOseoUndefinedOseoUndefined: [["(context, oseo_undefined(), oseo_undefined(), "]],
656
+ oseoFrameLeaveContextUStatement: [[" oseo_frame_leave(context, OSEO_CALLABLE_FRAME_COST("], ["u));"]],
657
+ oseoCallLeaveContextStatement: [[" oseo_call_leave(context);"]],
658
+ callCompleteStatement: [[" result = oseo_call_complete(context, result);"]],
659
+ tailCallPrefix: [["result = oseo_tail_call(context, roots["], ["], "]],
660
+ tailCallDerivedPrefix: [["result = oseo_tail_call_derived(context, roots["], ["], "]],
661
+ tailHostCallPrefix: [
662
+ ["result = oseo_tail_host_call(context, "],
663
+ [", "],
664
+ [", "]
665
+ ],
666
+ tailHostCallDerivedPrefix: [
667
+ ["result = oseo_tail_host_call_derived(context, "],
668
+ [", "],
669
+ [", "]
670
+ ],
671
+ tailHostConsoleLog: [["OSEO_TAIL_HOST_CONSOLE_LOG"]],
672
+ tailHostSetTimeout: [["OSEO_TAIL_HOST_SET_TIMEOUT"]],
673
+ tailHostClearTimeout: [["OSEO_TAIL_HOST_CLEAR_TIMEOUT"]]
674
+ },
675
+ objectOperation: {
676
+ resultAssignOseoArrayCreateContextU: [["result = oseo_array_create(context, "], ["u);"]],
677
+ resultAssignOseoArrayAppendContextRoots: [["result = oseo_array_append(context, roots["], ["], "]],
678
+ resultAssignOseoArrayAppendHoleContext: [["result = oseo_array_append_hole(context, roots["], ["]);"]],
679
+ resultAssignOseoObjectLiteralCreateContext: [["result = oseo_object_literal_create(context);"]],
680
+ resultAssignOseoToObject: [["result = oseo_to_object(context, ", "roots["], ["]);"]],
681
+ resultAssignOseoRequireObjectCoercible: [["result = oseo_require_object_coercible(context, ", "roots["], ["]);"]],
682
+ resultAssignOseoRequireDeleteObjectCoercible: [["result = oseo_require_delete_object_coercible(context, ", "roots["], ["]);"]],
683
+ objectRestExcluded: [["object_rest_excluded_"], [""]],
684
+ oseoValueUAssignOpen: [
685
+ ["OseoValue "],
686
+ ["["],
687
+ ["u] = {"]
688
+ ],
689
+ initializerSuffix: [["};"]],
690
+ resultAssignOseoObjectRestContextRoots: [["result = oseo_object_rest(context, roots["], ["], "]],
691
+ resultAssignOseoObjectLiteralSetPrototypeContextRoots: [["result = oseo_object_literal_set_prototype(con", "text, roots["], ["], "]],
692
+ nullStatement: [["NULL);"]],
693
+ resultAssignOseoObjectSpreadContextRoots: [["result = oseo_object_spread(context, roots["], ["], "]],
694
+ resultAssignOseoPropertyKeyContextRoots: [["result = oseo_property_key(context, roots["], ["]);"]],
695
+ oseoPropertyAttributesTrueTrueTrueFalse: [["(OseoPropertyAttributes){true, true, true, false", "});"]],
696
+ oseoPropertyAttributesTrueFalseTrueFalse: [["(OseoPropertyAttributes){true, false, true, fals", "e});"]],
697
+ resultAssignOseoObjectDefineAccessor: [["result = oseo_object_define_accessor(context, ro", "ots["], ["], "]],
698
+ oseoPropertyAttributesTrueFalseTrue: [["(OseoPropertyAttributes){true, "], [", false, true});"]],
699
+ resultAssignOseoSuperGetContextRoots: [["result = oseo_super_get(context, roots["], ["], "]],
700
+ resultAssignOseoObjectGetContextRoots: [["result = oseo_object_get(context, roots["], ["], "]],
701
+ resultAssignOseoObjectDeleteContextRoots: [["result = oseo_object_delete(context, roots["], ["], "]],
702
+ resultAssignOseoSuperSetContextRoots: [["result = oseo_super_set(context, roots["], ["], "]],
703
+ rootsRootsRoots: [
704
+ ["roots["],
705
+ ["], roots["],
706
+ ["], roots["],
707
+ ["], "]
708
+ ],
709
+ resultAssignOseoObjectSetContextRoots: [["result = oseo_object_set(context, roots["], ["], "]]
710
+ },
711
+ argumentListOperation: {
712
+ resultAssignOseoArgumentListCreateContext: [["result = oseo_argument_list_create(context);"]],
713
+ resultAssignOseoArgumentListAppendContext: [["result = oseo_argument_list_append(context, roots["], ["], "]]
714
+ },
715
+ propertyCacheName: { propertyCache: [["property_cache_"], [""]] },
716
+ guardObject: { boolFastAssignOseoValueIsObjectRoots: [
717
+ ["bool fast_"],
718
+ [" = oseo_value_is_object(roots["],
719
+ ["]);"]
720
+ ] },
721
+ propertyCacheGuard: {
722
+ staticOseoPropertyCacheAssignUUStatement: [["static OseoPropertyCache "], [" = {0u, 0u};"]],
723
+ boolFastAssignOseoPropertyCacheMatches: [["bool fast_"], [" = oseo_property_cache_matches("]],
724
+ rootsAddressStatement: [
725
+ ["roots["],
726
+ ["], &"],
727
+ [");"]
728
+ ]
729
+ },
730
+ loadFixedSlot: { oseoPropertyCacheLoadRootsAddressStatement: [
731
+ ["oseo_property_cache_load(roots["],
732
+ ["], &"],
733
+ [");"]
734
+ ] },
735
+ updatePropertyCache: { oseoPropertyCacheUpdateRootsRoots: [
736
+ ["oseo_property_cache_update(roots["],
737
+ ["], roots["],
738
+ ["], "]
739
+ ] },
740
+ functionCreate: {
741
+ oseoFunctionArrow: [["OSEO_FUNCTION_ARROW"]],
742
+ oseoFunctionAsync: [["OSEO_FUNCTION_ASYNC"]],
743
+ oseoFunctionAsyncArrow: [["OSEO_FUNCTION_ASYNC_ARROW"]],
744
+ oseoFunctionAsyncGenerator: [["OSEO_FUNCTION_ASYNC_GENERATOR"]],
745
+ oseoFunctionClass: [["OSEO_FUNCTION_CLASS"]],
746
+ oseoFunctionGenerator: [["OSEO_FUNCTION_GENERATOR"]],
747
+ oseoFunctionMethod: [["OSEO_FUNCTION_METHOD"]],
748
+ oseoFunctionOrdinary: [["OSEO_FUNCTION_ORDINARY"]],
749
+ functionNameUnits: [["function_name_units_"], [""]],
750
+ functionSourceUnits: [["function_source_units_"], [""]],
751
+ oseoFunctionNamePrefixGet: [["OSEO_FUNCTION_NAME_PREFIX_GET"]],
752
+ oseoFunctionNamePrefixSet: [["OSEO_FUNCTION_NAME_PREFIX_SET"]],
753
+ oseoFunctionNamePrefixNone: [["OSEO_FUNCTION_NAME_PREFIX_NONE"]],
754
+ resultAssignOseoFunctionCreateContextU: [["result = oseo_function_create(context, "], ["u, "]],
755
+ resultAssignOseoFunctionCreateNonStrictContextU: [["result = oseo_function_create_non_strict(context, "], ["u, "]],
756
+ resultAssignOseoFunctionSetSource: [
757
+ ["result = oseo_function_set_source(context, roots["],
758
+ ["], "],
759
+ [", "],
760
+ ["u);"]
761
+ ],
762
+ rootsU: [
763
+ ["roots["],
764
+ ["], "],
765
+ [", "],
766
+ ["u, "]
767
+ ],
768
+ receiver: [
769
+ [""],
770
+ [", receiver, "],
771
+ [", "]
772
+ ],
773
+ bindArrowContext: [
774
+ ["oseo_bind_arrow_context(roots["],
775
+ ["], callee, "],
776
+ [");"]
777
+ ],
778
+ newTarget: [["new_target"]]
779
+ },
780
+ errorIntrinsic: {
781
+ oseoErrorAggregate: [["OSEO_ERROR_AGGREGATE"]],
782
+ oseoErrorError: [["OSEO_ERROR_ERROR"]],
783
+ oseoErrorEval: [["OSEO_ERROR_EVAL"]],
784
+ oseoErrorRange: [["OSEO_ERROR_RANGE"]],
785
+ oseoErrorReference: [["OSEO_ERROR_REFERENCE"]],
786
+ oseoErrorSyntax: [["OSEO_ERROR_SYNTAX"]],
787
+ oseoErrorType: [["OSEO_ERROR_TYPE"]],
788
+ oseoErrorUri: [["OSEO_ERROR_URI"]],
789
+ resultAssignOseoErrorIntrinsicContext: [["result = oseo_error_intrinsic(context, "]]
790
+ },
791
+ functionIntrinsic: { resultAssign: [["result = oseo_intrinsic(context, OSEO_INTRINSIC_FUNCTION);"]] },
792
+ iteratorIntrinsic: { resultAssign: [["result = oseo_intrinsic(context, OSEO_INTRINSIC_ITERATOR);"]] },
793
+ constructReceiver: { resultAssignOseoConstructorReceiverContext: [[" result = oseo_constructor_receiver(context, ", "result.value);"]] },
794
+ classHeritage: { resultAssignOseoClassHeritageContextRoots: [["result = oseo_class_heritage(context, roots["], ["], "]] },
795
+ classFieldDefine: { resultAssignOseoClassFieldDefineContext: [["result = oseo_class_field_define(context, "]] },
796
+ classStaticFieldDefine: {
797
+ oseoClassStaticPrivateFieldDefine: [["oseo_class_static_private_field_define"]],
798
+ oseoClassStaticFieldDefine: [["oseo_class_static_field_define"]]
799
+ },
800
+ privateNameCreate: { resultAssignOseoPrivateNameCreateContext: [["result = oseo_private_name_create(context);"]] },
801
+ classPrivateFieldDefine: { resultAssignOseoClassPrivateFieldDefine: [["result = oseo_class_private_field_define(context", ", "]] },
802
+ classPrivateMethodDefine: {
803
+ resultAssignOseoClassPrivateMethodDefine: [["result = oseo_class_private_method_define(context, "]],
804
+ resultAssignOseoClassStaticPrivateMethodDefine: [["result = oseo_class_static_private_method_define(context, "]]
805
+ },
806
+ privateGet: { resultAssignOseoPrivateGetContextRoots: [["result = oseo_private_get(context, roots["], ["], "]] },
807
+ privateIn: { resultAssignOseoPrivateInContextRoots: [["result = oseo_private_in(context, roots["], ["], "]] },
808
+ privateSet: { resultAssignOseoPrivateSetContextRoots: [["result = oseo_private_set(context, roots["], ["], "]] },
809
+ instanceElementsInit: { resultAssignOseoInitializeInstanceElements: [[
810
+ "result = oseo_initialize_instance_elements(conte",
811
+ "xt, call",
812
+ "ee, "
813
+ ]] },
814
+ homeObjectBind: { oseoBindHomeObjectRootsRootsStatement: [
815
+ ["oseo_bind_home_object(roots["],
816
+ ["], roots["],
817
+ ["]);"]
818
+ ] },
819
+ superBase: { rootsAssignOseoSuperBaseCalleeStatement: [["roots["], ["] = oseo_super_base(callee);"]] },
820
+ superPropertyDelete: { resultAssignOseoSuperPropertyDeleteContext: [["result = oseo_super_property_delete(context);"]] },
821
+ superConstructor: {
822
+ resultAssignOseoSuperConstructorContext: [["result = oseo_super_constructor(context, callee)", ";"]],
823
+ resultAssignOseoSuperConstructorCheckContextRoots: [["result = oseo_super_constructor_check(context, roots["], ["]);"]],
824
+ resultAssignOseoSuperConstructorReceiverContextRoots: [
825
+ ["result = oseo_super_constructor_receiver(context", ", roots["],
826
+ ["], "],
827
+ [");"]
828
+ ]
829
+ },
830
+ thisBind: { resultAssignOseoBindThisContextResultValue: [["result = oseo_bind_this(context, result.value, r", "oots["], ["]);"]] },
831
+ derivedReturn: {
832
+ resultAssignOseoDerivedConstructorResult: [["result = oseo_derived_constructor_result(context", ", roots["], ["], "]],
833
+ resultValueStatement: [["result.value);"]]
834
+ },
835
+ moduleNamespace: {
836
+ rootsUNullNullNullStatement: [["roots["], ["], 0u, NULL, NULL, NULL);"]],
837
+ namespaceUnits: [
838
+ ["namespace_units_"],
839
+ ["_"],
840
+ [""]
841
+ ],
842
+ namespace: [["namespace_"], [""]],
843
+ staticConstUint16TPointerConstNamesAssign: [["static const uint16_t *const "], ["_names[] = "]],
844
+ staticConstSizeTLengthsAssignStatement: [
845
+ ["static const size_t "],
846
+ ["_lengths[] = {"],
847
+ ["};"]
848
+ ],
849
+ staticConstSizeTBindingsAssign: [["static const size_t "], ["_bindings[] = "]],
850
+ namesLengthsBindingsStatement: [
851
+ [""],
852
+ ["_names, "],
853
+ ["_lengths, "],
854
+ ["_bindings);"]
855
+ ]
856
+ },
857
+ globalObject: {
858
+ units: [["global_object_units_"], [""]],
859
+ prefix: [["global_object"]],
860
+ resultAssignOseoGlobalObjectCreate: [["result = oseo_global_object_create(context, "]]
861
+ },
862
+ mappedArguments: {
863
+ indicesName: [["mapped_arguments_indices_"], [""]],
864
+ bindingIdsName: [["mapped_arguments_binding_ids_"], [""]]
865
+ },
866
+ operation: {
867
+ resultAssignOseoSymbolIntrinsicContext: [["result = oseo_symbol_intrinsic(context);"]],
868
+ rootsAssignReceiverStatement: [["roots["], ["] = receiver;"]],
869
+ resultAssignOseoThisValueContextReceiver: [["result = oseo_this_value(context, receiver);"]],
870
+ undefinedExpressionStatement: [["oseo_undefined();"]],
871
+ newTargetStatement: [["new_target;"]],
872
+ rootsAssignRootsUStatement: [
873
+ ["roots["],
874
+ ["] = roots["],
875
+ ["u];"]
876
+ ],
877
+ completionUKindAssignStatement: [
878
+ ["completion["],
879
+ ["u].kind = "],
880
+ [";"]
881
+ ],
882
+ completionULineAssignContextMemberLine: [["completion["], ["u].line = context->line;"]],
883
+ completionUColumnAssignContextMemberColumn: [["completion["], ["u].column = context->column;"]],
884
+ completionUSourceIdAssignContextMember: [["completion["], ["u].source_id = context->source_id;"]],
885
+ completionUSourceIdLengthAssign: [["completion["], ["u].source_id_length = "]],
886
+ completionUErrorCodeAssignContextMember: [["completion["], ["u].error_code = context->error_code;"]],
887
+ completionUErrorMessageAssignContextMember: [["completion["], ["u].error_message = context->error_message;"]],
888
+ rootsUAssign: [["roots["], ["u] = "]],
889
+ rootsStatement: [["roots["], ["];"]],
890
+ completionUTargetAssign: [["completion["], ["u].target = "]],
891
+ completionUDepthAssign: [["completion["], ["u].depth = "]],
892
+ contextMemberGuardHitsPlusAssignUStatement: [["context->guard_hits += 1u;"]],
893
+ contextMemberGuardMissesPlusAssignU: [["context->guard_misses += 1u;"]],
894
+ contextMemberOverflowMissesPlusAssignU: [["context->overflow_misses += 1u;"]],
895
+ ifResultStatusNotEqualOseoStatusNormalOpen: [["if (result.status != OSEO_STATUS_NORMAL) {"]],
896
+ ifContextMemberHasDiagnosticGotoAbrupt: [[" if (context->has_diagnostic) goto abrupt;"]],
897
+ setThrowKind: [[" completion["], ["u].kind = 2;"]],
898
+ resultValueStatement: [["result.value;"]],
899
+ setThrowLine: [[" completion["], ["u].line = context->line;"]],
900
+ setThrowColumn: [[" completion["], ["u].column = context->column;"]],
901
+ setThrowSourceId: [[" completion["], ["u].source_id = context->source_id;"]],
902
+ setThrowSourceIdLength: [[" completion["], ["u].source_id_length = "]],
903
+ setThrowErrorCode: [[" completion["], ["u].error_code = context->error_code;"]],
904
+ completionUErrorMessageAssign: [[" completion["], ["u].error_message = "]],
905
+ contextMemberErrorMessageStatement: [["context->error_message;"]]
906
+ },
907
+ completionCopy: {
908
+ completionUAssignCompletionUStatement: [
909
+ [" completion["],
910
+ ["u] = completion["],
911
+ ["u];"]
912
+ ],
913
+ rootsUStatement: [["roots["], ["u];"]]
914
+ },
915
+ terminator: {
916
+ oseoGeneratorSuspendAwait: [["OSEO_GENERATOR_SUSPEND_AWAIT"]],
917
+ oseoGeneratorSuspendYield: [["OSEO_GENERATOR_SUSPEND_YIELD"]],
918
+ oseoGeneratorSuspendContextGeneratorU: [["oseo_generator_suspend(context, generator, "], ["u, "]],
919
+ rootsStatement: [["roots["], ["]};"]],
920
+ fast: [["fast_"], [""]],
921
+ ifGotoBbStatement: [
922
+ ["if ("],
923
+ [") goto bb"],
924
+ [";"]
925
+ ],
926
+ ifCompletionUKindNotEqualAddressAddress: [["if (completion["], ["u].kind != 0 && "]],
927
+ completionUDepthAssignUOpen: [
928
+ ["completion["],
929
+ ["u].depth <= "],
930
+ ["u) {"]
931
+ ],
932
+ ifCompletionKindReturnOpen: [["if (completion["], ["u].kind == 1) {"]],
933
+ contextMemberLineAssignCompletionULine: [[" context->line = completion["], ["u].line;"]],
934
+ contextMemberColumnAssignCompletionUColumn: [[" context->column = completion["], ["u].column;"]],
935
+ contextMemberSourceIdAssignCompletionU: [[" context->source_id = completion["], ["u].source_id;"]],
936
+ contextMemberSourceIdLengthAssign: [[" context->source_id_length = "]],
937
+ completionUSourceIdLengthStatement: [["completion["], ["u].source_id_length;"]],
938
+ contextMemberErrorCodeAssignCompletionU: [[" context->error_code = completion["], ["u].error_code;"]],
939
+ contextMemberErrorMessageAssignCompletionU: [[" context->error_message = completion["], ["u].error_message;"]],
940
+ contextMemberHasDiagnosticAssignFalse: [[" context->has_diagnostic = false;"]],
941
+ resultAssignOseoResultOseoStatusThrow: [[" result = (OseoResult){OSEO_STATUS_THROW, "]],
942
+ gotoAbruptStatement: [[" goto abrupt;"]],
943
+ switchCompletionUTargetOpen: [["switch (completion["], ["u].target) {"]],
944
+ abortStatement: [["abort();"]]
945
+ },
946
+ prologue: {
947
+ resultAssignOseoEnvironmentCreateContextU: [["result = oseo_environment_create(context, "], ["u);"]],
948
+ resultAssignOseoUnresolvableCellCreate: [["result = oseo_unresolvable_cell_create(context, ", "\""], ["\");"]],
949
+ resultAssignOseoFunctionEnvironmentContext: [["result = oseo_function_environment(context, call", "ee);"]],
950
+ resultAssignOseoEnvironmentCloneContext: [["result = oseo_environment_clone(context, result.", "value);"]],
951
+ resultAssignOseoEnvironmentSetContextRoots: [["result = oseo_environment_set(context, roots["], ["], "]],
952
+ uRootsStatement: [
953
+ [""],
954
+ ["u, roots["],
955
+ ["]);"]
956
+ ],
957
+ resultAssignOseoCellInitializeContext: [["result = oseo_cell_initialize(context, result.va", "lue, callee);"]],
958
+ resultAssignOseoArgumentsCreate: [["result = oseo_arguments_create(context, argument_count, ", "arguments);"]],
959
+ resultAssignOseoMappedArgumentsCreate: [
960
+ ["result = oseo_mapped_arguments_create(context, roo", "ts["],
961
+ ["], callee, argument_count, arguments, "],
962
+ [", "],
963
+ [", "],
964
+ ["u);"]
965
+ ],
966
+ oseoCellSet: [["oseo_cell_set"]],
967
+ oseoCellInitialize: [["oseo_cell_initialize"]],
968
+ resultAssignOseoArrayCreateContextU: [["result = oseo_array_create(context, 0u);"]],
969
+ resultAssignContextRootsResultValue: [
970
+ ["result = "],
971
+ ["(context, roots["],
972
+ ["], result.value);"]
973
+ ],
974
+ forSizeTRestIndexAssignU: [
975
+ ["for (size_t rest_index_"],
976
+ [" = "],
977
+ ["u; "]
978
+ ],
979
+ restIndexArgumentCountRestIndexPlusAssignU: [
980
+ ["rest_index_"],
981
+ [" < argument_count; rest_index_"],
982
+ [" += 1u) {"]
983
+ ],
984
+ resultAssignOseoArrayAppendContextResult: [[" result = oseo_array_append(context, result.v", "alue, "]],
985
+ argumentsRestIndexStatement: [["arguments[rest_index_"], ["]);"]],
986
+ ifResultStatusNotEqualOseoStatusNormalGoto: [[" if (result.status != OSEO_STATUS_NORMAL) got", "o abrupt;"]],
987
+ resultAssignContextResultValue: [["result = "], ["(context, result.value, "]],
988
+ argumentCountUArguments: [
989
+ ["(argument_count > "],
990
+ ["u ? arguments["],
991
+ ["] : "]
992
+ ],
993
+ undefinedDefaultArgumentCallSuffix: [["oseo_undefined()));"]]
994
+ },
995
+ blocks: {
996
+ bbStatement: [["bb"], [":;"]],
997
+ rootsAssignOseoGeneratorSentGenerator: [["roots["], ["] = oseo_generator_sent(generator);"]],
998
+ oseoGeneratorResumeReturnGotoBbStatement: [["OSEO_GENERATOR_RESUME_RETURN) goto bb"], [";"]],
999
+ oseoGeneratorResumeThrowGotoBbStatement: [["OSEO_GENERATOR_RESUME_THROW) goto bb"], [";"]]
1000
+ },
1001
+ completionDeclaration: {
1002
+ oseoCompletionRecordPointerCompletion: [[" OseoCompletionRecord *completion =\n"]],
1003
+ oseoGeneratorCompletionsGeneratorLine: [[" oseo_generator_completions(generator);\n"]],
1004
+ oseoCompletionRecordCompletionUAssign: [[" OseoCompletionRecord completion["], ["u] = "]],
1005
+ uUUUNullUNullNullLine: [["{{0, 0u, 0u, 0u, 0u, NULL, 0u, NULL, NULL}};\n"]]
1006
+ },
1007
+ generatorBodyName: { oseoGeneratorBody: [["oseo_generator_body_"], [""]] },
1008
+ generatorBody: {
1009
+ switchOseoGeneratorResumePointGenerator: [["switch (oseo_generator_resume_point(generator)) ", "{"]],
1010
+ staticOseoResultLine: [["static OseoResult "], ["(\n"]],
1011
+ oseoValueGeneratorLine: [[" OseoValue generator\n"]],
1012
+ oseoValuePointerRootsAssignOseoGenerator: [[" OseoValue *roots = oseo_generator_slots(gene", "rator);\n"]],
1013
+ oseoValueCalleeAssignOseoGeneratorCallee: [[" OseoValue callee = oseo_generator_callee(gen", "erator);\n"]],
1014
+ oseoValueReceiverAssignOseoGenerator: [[" OseoValue receiver = oseo_generator_receiver", "(generator);\n"]],
1015
+ oseoResultResultAssignOseoStatusNormalOseo: [[" OseoResult result = {OSEO_STATUS_NORMAL, ose", "o_undefined()};\n"]],
1016
+ voidContextLine: [[" (void)context;\n"]]
1017
+ },
1018
+ function: {
1019
+ resultAssignOseoGeneratorCreateContext: [[
1020
+ "result = oseo_generator_create(context, callee, ",
1021
+ "receiver",
1022
+ ", "
1023
+ ]],
1024
+ frameSlotsAssignResultValueStatement: [["frame.slots[0] = result.value;"]],
1025
+ frameSlotsZero: [["frame.slots[0]"]],
1026
+ rootsAssignOseoGeneratorSlotsFrameSlots: [["roots = oseo_generator_slots(frame.slots[0]);"]],
1027
+ resultAssignOseoResultOseoStatusNormal: [["result = (OseoResult){OSEO_STATUS_NORMAL, frame.", "slots[0]};"]],
1028
+ oseoRootsReleaseContextAddressFrame: [["oseo_roots_release(context, &frame);"]],
1029
+ staticOseoResultOseoFunctionLine: [["static OseoResult oseo_function_"], ["(\n"]],
1030
+ oseoValueCalleeLine: [[" OseoValue callee,\n"]],
1031
+ oseoValueReceiverLine: [[" OseoValue receiver,\n"]],
1032
+ sizeTArgumentCountLine: [[" size_t argument_count,\n"]],
1033
+ constOseoValuePointerArgumentsLine: [[" const OseoValue *arguments,\n"]],
1034
+ oseoValueNewTargetLine: [[" OseoValue new_target\n"]],
1035
+ oseoRootFrameFrameAssignNullNullULine: [[" OseoRootFrame frame = {NULL, NULL, 0u};\n"]],
1036
+ oseoValuePointerRootsLine: [[" OseoValue *roots;\n"]],
1037
+ voidArgumentCountLine: [[" (void)argument_count;\n"]],
1038
+ voidArgumentsLine: [[" (void)arguments;\n"]],
1039
+ voidNewTargetLine: [[" (void)new_target;\n"]],
1040
+ resultAssignOseoRootsAllocate: [[" result = oseo_roots_allocate("]],
1041
+ contextAddressFrameULine: [["context, &frame, "], ["u);\n"]],
1042
+ ifResultStatusNotEqualOseoStatusNormal: [[" if (result.status != OSEO_STATUS_NORMAL) ret", "urn result;\n"]],
1043
+ rootsAssignFrameSlotsLine: [[" roots = frame.slots;\n"]],
1044
+ newline: [
1045
+ [""],
1046
+ ["\n"],
1047
+ [""]
1048
+ ]
1049
+ },
1050
+ prototype: {
1051
+ staticOseoResultOseoFunction: [["static OseoResult oseo_function_"], ["("]],
1052
+ oseoContextPointerOseoValueOseoValueSizeT: [["OseoContext *, OseoValue, OseoValue, size_t, "]],
1053
+ constOseoValuePointerOseoValueStatement: [["const OseoValue *, OseoValue);"]],
1054
+ staticOseoResult: [
1055
+ [""],
1056
+ ["\nstatic OseoResult "],
1057
+ ["("]
1058
+ ],
1059
+ oseoContextPointerOseoValueStatement: [["OseoContext *, OseoValue);"]]
1060
+ },
1061
+ generatorDispatcher: {
1062
+ source: [[
1063
+ "static OseoResult oseo_dispatch_generator(\n O",
1064
+ "seoContext *context,\n OseoValue generator\n) {",
1065
+ "\n size_t code_id = 0u;\n OseoResult result ",
1066
+ "= oseo_function_code_id(\n context, oseo_g",
1067
+ "enerator_callee(generator), &code_id);\n if (r",
1068
+ "esult.status != OSEO_STATUS_NORMAL) return resul",
1069
+ "t;\n switch (code_id) {\n"
1070
+ ], ["\n default:\n return oseo_unknown_functi", "on(context, code_id);\n }\n}"]],
1071
+ caseClause: [
1072
+ [" case "],
1073
+ ["u:\n result = oseo_frame_enter(context, ", "OSEO_CALLABLE_FRAME_COST("],
1074
+ ["u));\n if (result.status == OSEO_STATUS_NORMAL) {\n", " result = "],
1075
+ ["(context, generator);\n", " oseo_frame_leave(context, OSEO_CALLABLE_FRAME_COST("],
1076
+ ["u));\n }\n return result;"]
1077
+ ]
1078
+ },
1079
+ functionDispatcher: {
1080
+ source: [[
1081
+ "static OseoResult oseo_dispatch_function(\n Os",
1082
+ "eoContext *context,\n OseoValue callee,\n Os",
1083
+ "eoValue receiver,\n size_t argument_count,\n ",
1084
+ " const OseoValue *arguments,\n OseoValue new_t",
1085
+ "arget\n) {\n size_t code_id = 0u;\n OseoResul",
1086
+ "t result = oseo_function_code_id(\n contex",
1087
+ "t, callee, &code_id);\n if (result.status != O",
1088
+ "SEO_STATUS_NORMAL) return result;\n (void)rece",
1089
+ "iver;\n (void)argument_count;\n (void)argume",
1090
+ "nts;\n (void)new_target;\n switch (code_id) ",
1091
+ "{\n"
1092
+ ], [" default:\n return oseo_unknown_functio", "n(context, code_id);\n }\n}"]],
1093
+ caseClause: [
1094
+ [" case "],
1095
+ ["u:\n result = oseo_frame_enter(context, ", "OSEO_CALLABLE_FRAME_COST("],
1096
+ ["u));\n if (result.status == OSEO_STATUS_NOR", "MAL) {\n result = oseo_function_"],
1097
+ [
1098
+ "(\n context, callee, receiver, arg",
1099
+ "ument_count,\n arguments, new_targ",
1100
+ "et);\n oseo_frame_leave(context, ",
1101
+ "OSEO_CALLABLE_FRAME_COST("
1102
+ ],
1103
+ ["u));\n }\n return result;"]
1104
+ ]
1105
+ },
1106
+ agent: {
1107
+ holeStatement: [["result = oseo_agent_hole(context, "], ["u);"]],
1108
+ entryPrototype: [["OseoResult oseo_agent_program_"], ["(OseoContext *);\n"]],
1109
+ segmentUnits: [
1110
+ ["static const uint16_t oseo_agent_segment_"],
1111
+ ["_"],
1112
+ ["[] = {"],
1113
+ ["};\n"]
1114
+ ],
1115
+ segmentEntry: [
1116
+ ["{oseo_agent_segment_"],
1117
+ ["_"],
1118
+ [", "],
1119
+ ["u}"]
1120
+ ],
1121
+ segmentTable: [
1122
+ ["static const OseoAgentSegment oseo_agent_segments_"],
1123
+ ["[] = {"],
1124
+ ["};\n"]
1125
+ ],
1126
+ programEntry: [
1127
+ ["{oseo_agent_segments_"],
1128
+ [", "],
1129
+ ["u, oseo_agent_program_"],
1130
+ [", \""],
1131
+ ["\", "],
1132
+ ["u}"]
1133
+ ],
1134
+ programTable: [["static const OseoAgentProgram oseo_agent_programs[] = {"], ["};\n"]],
1135
+ installLine: [
1136
+ [" result = oseo_test262_host_install(\n &context, "],
1137
+ [", "],
1138
+ [
1139
+ "u);\n if (result.status != OSEO_STATUS_NORMAL) {\n ",
1140
+ " oseo_context_print_thrown(&context, result.value);\n",
1141
+ " oseo_context_destroy(&context);\n return 1;\n",
1142
+ " }\n"
1143
+ ]
1144
+ ],
1145
+ sourceRunUnits: [
1146
+ ["static const uint16_t function_source_run_"],
1147
+ ["_"],
1148
+ ["[] = {"],
1149
+ ["};"]
1150
+ ],
1151
+ sourceRunEntry: [
1152
+ ["{function_source_run_"],
1153
+ ["_"],
1154
+ [", "],
1155
+ ["u}"]
1156
+ ],
1157
+ sourceRuns: [
1158
+ ["static const OseoAgentSegment function_source_runs_"],
1159
+ ["[] = {"],
1160
+ ["};"]
1161
+ ],
1162
+ holeIndex: [[""], ["u"]],
1163
+ sourceHoles: [
1164
+ ["static const size_t function_source_holes_"],
1165
+ ["[] = {"],
1166
+ ["};"]
1167
+ ],
1168
+ setSource: [
1169
+ ["result = oseo_agent_function_set_source(context, roots["],
1170
+ ["], function_source_runs_"],
1171
+ [", "],
1172
+ ["u, function_source_holes_"],
1173
+ [");"]
1174
+ ],
1175
+ programsValue: [["oseo_agent_programs"]],
1176
+ noProgramsValue: [["NULL"]],
1177
+ generatorRegistrationLine: [[" oseo_context_set_generator_dispatcher(\n", " context, oseo_dispatch_generator);\n"]],
1178
+ source: [
1179
+ [
1180
+ "#include \"oseo_runtime.h\"\n\n#include <math.h>\n#in",
1181
+ "clude <stddef.h>\n#include <stdint.h>\n#include <s",
1182
+ "tdlib.h>\n\n"
1183
+ ],
1184
+ [""],
1185
+ ["\n\n"],
1186
+ ["\n\n"],
1187
+ [""],
1188
+ ["\nOseoResult oseo_agent_program_"],
1189
+ ["(OseoContext *context) {\n OseoResult result;\n"],
1190
+ [""],
1191
+ [" oseo_context_set_function_dispatcher(\n", " context, oseo_dispatch_function);\n"],
1192
+ [" result = oseo_frame_enter(\n context, "],
1193
+ [
1194
+ "u);\n if (result.status == OSEO_STATUS_NORMAL)",
1195
+ " {\n result = oseo_function_script(\n ",
1196
+ " context, oseo_undefined(), oseo_undefined",
1197
+ "(), 0u,\n NULL, oseo_undefined());\n ",
1198
+ " oseo_frame_leave(\n context, "
1199
+ ],
1200
+ [
1201
+ "u);\n }\n if (result.status == OSEO_STATUS_N",
1202
+ "ORMAL) {\n result = oseo_event_loop_run(\n ",
1203
+ " context, result.value);\n } else {\n",
1204
+ " result = oseo_entr",
1205
+ "y_task_checkpoint(context, result);\n }\n",
1206
+ " return result;\n}\n"
1207
+ ]
1208
+ ]
1209
+ },
1210
+ program: {
1211
+ voidOseoFunctionStatement: [[" (void)oseo_function_"], [";"]],
1212
+ typedefOseoResultPointerOseoFunctionEntry: [["typedef OseoResult (*OseoFunctionEntry)(\n"]],
1213
+ oseoContextPointerOseoValueOseoValueSizeT: [[" OseoContext *, OseoValue, OseoValue, size_t,", "\n"]],
1214
+ constOseoValuePointerOseoValueLine: [[" const OseoValue *, OseoValue);\n\n"]],
1215
+ oseoContextSetGeneratorDispatcherLine: [[" oseo_context_set_generator_dispatcher(\n"]],
1216
+ addressContextOseoDispatchGeneratorLine: [[" &context, oseo_dispatch_generator);\n"]],
1217
+ contextObserveSpecializationAssignTrueLine: [[" context.observe_specialization = true;\n"]],
1218
+ oseoContextPrintObservationsAddressContext: [[" oseo_context_print_observations(&context);\n"]],
1219
+ source: [
1220
+ [
1221
+ "#include \"oseo_runtime.h\"\n\n#include <math.h>\n#in",
1222
+ "clude <stddef.h>\n#include <stdint.h>\n#include <s",
1223
+ "tdlib.h>\n\n"
1224
+ ],
1225
+ [""],
1226
+ ["\n\n"],
1227
+ ["\n\n"],
1228
+ [""],
1229
+ ["\nint main(int argc, char **argv) {\n OseoContext context;\n O", "seoResult result;\n"],
1230
+ [""],
1231
+ [" oseo_context_init(\n &context, \""],
1232
+ ["\", "],
1233
+ [
1234
+ "u);\n oseo_process_start(&context, argc, argv);\n",
1235
+ " oseo_context_set_function_dispatcher(\n ",
1236
+ " &context, oseo_dispatch_function);\n"
1237
+ ],
1238
+ [""],
1239
+ [" result = oseo_frame_enter(\n &context,", " "],
1240
+ [
1241
+ "u);\n if (result.status == OSEO_STATUS_NORMAL)",
1242
+ " {\n result = oseo_function_script(\n ",
1243
+ " &context, oseo_undefined(), oseo_undefined",
1244
+ "(), 0u,\n NULL, oseo_undefined());\n ",
1245
+ " oseo_frame_leave(\n &context, "
1246
+ ],
1247
+ [
1248
+ "u);\n }\n if (result.status == OSEO_STATUS_N",
1249
+ "ORMAL) {\n result = oseo_event_loop_run(\n ",
1250
+ " &context, result.value);\n } else {\n",
1251
+ " result = oseo_entr",
1252
+ "y_task_checkpoint(&context, result);\n }\n i",
1253
+ "f (result.status != OSEO_STATUS_NORMAL) {\n ",
1254
+ " oseo_context_print_thrown(&context, result.val",
1255
+ "ue);\n oseo_context_destroy(&context);\n ",
1256
+ " return 1;\n }\n"
1257
+ ],
1258
+ [" int status = oseo_process_finish(&context);\n", " oseo_context_destroy(&context);\n return status;\n}\n"]
1259
+ ]
1260
+ }
1261
+ };
1262
+ const emittedCNotice = `/*
1263
+ Oseo-authored output support only (SPDX-License-Identifier: MIT).
1264
+ MIT License
1265
+
1266
+ Copyright (c) 2026 Hong Minhee <https://hongminhee.org/>
1267
+
1268
+ Permission is hereby granted, free of charge, to any person obtaining a copy
1269
+ of this software and associated documentation files (the "Software"), to deal
1270
+ in the Software without restriction, including without limitation the rights
1271
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1272
+ copies of the Software, and to permit persons to whom the Software is
1273
+ furnished to do so, subject to the following conditions:
1274
+
1275
+ The above copyright notice and this permission notice shall be included in all
1276
+ copies or substantial portions of the Software.
1277
+
1278
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1279
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1280
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1281
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1282
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1283
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1284
+ SOFTWARE.
1285
+
1286
+ Unicode-derived tables, where present (SPDX-License-Identifier: Unicode-3.0).
1287
+ UNICODE LICENSE V3
1288
+
1289
+ COPYRIGHT AND PERMISSION NOTICE
1290
+
1291
+ Copyright © 1991-2026 Unicode, Inc.
1292
+
1293
+ NOTICE TO USER: Carefully read the following legal agreement. BY
1294
+ DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
1295
+ SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
1296
+ TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
1297
+ DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
1298
+
1299
+ Permission is hereby granted, free of charge, to any person obtaining a
1300
+ copy of data files and any associated documentation (the "Data Files") or
1301
+ software and any associated documentation (the "Software") to deal in the
1302
+ Data Files or Software without restriction, including without limitation
1303
+ the rights to use, copy, modify, merge, publish, distribute, and/or sell
1304
+ copies of the Data Files or Software, and to permit persons to whom the
1305
+ Data Files or Software are furnished to do so, provided that either (a)
1306
+ this copyright and permission notice appear with all copies of the Data
1307
+ Files or Software, or (b) this copyright and permission notice appear in
1308
+ associated Documentation.
1309
+
1310
+ THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
1311
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1312
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
1313
+ THIRD PARTY RIGHTS.
1314
+
1315
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
1316
+ BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
1317
+ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
1318
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
1319
+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
1320
+ FILES OR SOFTWARE.
1321
+
1322
+ Except as contained in this notice, the name of a copyright holder shall
1323
+ not be used in advertising or otherwise to promote the sale, use or other
1324
+ dealings in these Data Files or Software without prior written
1325
+ authorization of the copyright holder.
1326
+ */
1327
+ `;
1328
+
1329
+ //#endregion
1330
+ export { emittedC, emittedCNotice };
1331
+ //# sourceMappingURL=emitted-c.js.map