source: trip-planner-front/node_modules/@webassemblyjs/ast/esm/nodes.js@ fa375fe

Last change on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 32.8 KB
Line 
1function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
3// THIS FILE IS AUTOGENERATED
4// see scripts/generateNodeUtils.js
5function isTypeOf(t) {
6 return function (n) {
7 return n.type === t;
8 };
9}
10
11function assertTypeOf(t) {
12 return function (n) {
13 return function () {
14 if (!(n.type === t)) {
15 throw new Error('n.type === t' + " error: " + (undefined || "unknown"));
16 }
17 }();
18 };
19}
20
21export function module(id, fields, metadata) {
22 if (id !== null && id !== undefined) {
23 if (!(typeof id === "string")) {
24 throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
25 }
26 }
27
28 if (!(_typeof(fields) === "object" && typeof fields.length !== "undefined")) {
29 throw new Error('typeof fields === "object" && typeof fields.length !== "undefined"' + " error: " + (undefined || "unknown"));
30 }
31
32 var node = {
33 type: "Module",
34 id: id,
35 fields: fields
36 };
37
38 if (typeof metadata !== "undefined") {
39 node.metadata = metadata;
40 }
41
42 return node;
43}
44export function moduleMetadata(sections, functionNames, localNames, producers) {
45 if (!(_typeof(sections) === "object" && typeof sections.length !== "undefined")) {
46 throw new Error('typeof sections === "object" && typeof sections.length !== "undefined"' + " error: " + (undefined || "unknown"));
47 }
48
49 if (functionNames !== null && functionNames !== undefined) {
50 if (!(_typeof(functionNames) === "object" && typeof functionNames.length !== "undefined")) {
51 throw new Error('typeof functionNames === "object" && typeof functionNames.length !== "undefined"' + " error: " + (undefined || "unknown"));
52 }
53 }
54
55 if (localNames !== null && localNames !== undefined) {
56 if (!(_typeof(localNames) === "object" && typeof localNames.length !== "undefined")) {
57 throw new Error('typeof localNames === "object" && typeof localNames.length !== "undefined"' + " error: " + (undefined || "unknown"));
58 }
59 }
60
61 if (producers !== null && producers !== undefined) {
62 if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) {
63 throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown"));
64 }
65 }
66
67 var node = {
68 type: "ModuleMetadata",
69 sections: sections
70 };
71
72 if (typeof functionNames !== "undefined" && functionNames.length > 0) {
73 node.functionNames = functionNames;
74 }
75
76 if (typeof localNames !== "undefined" && localNames.length > 0) {
77 node.localNames = localNames;
78 }
79
80 if (typeof producers !== "undefined" && producers.length > 0) {
81 node.producers = producers;
82 }
83
84 return node;
85}
86export function moduleNameMetadata(value) {
87 if (!(typeof value === "string")) {
88 throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
89 }
90
91 var node = {
92 type: "ModuleNameMetadata",
93 value: value
94 };
95 return node;
96}
97export function functionNameMetadata(value, index) {
98 if (!(typeof value === "string")) {
99 throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
100 }
101
102 if (!(typeof index === "number")) {
103 throw new Error('typeof index === "number"' + " error: " + ("Argument index must be of type number, given: " + _typeof(index) || "unknown"));
104 }
105
106 var node = {
107 type: "FunctionNameMetadata",
108 value: value,
109 index: index
110 };
111 return node;
112}
113export function localNameMetadata(value, localIndex, functionIndex) {
114 if (!(typeof value === "string")) {
115 throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
116 }
117
118 if (!(typeof localIndex === "number")) {
119 throw new Error('typeof localIndex === "number"' + " error: " + ("Argument localIndex must be of type number, given: " + _typeof(localIndex) || "unknown"));
120 }
121
122 if (!(typeof functionIndex === "number")) {
123 throw new Error('typeof functionIndex === "number"' + " error: " + ("Argument functionIndex must be of type number, given: " + _typeof(functionIndex) || "unknown"));
124 }
125
126 var node = {
127 type: "LocalNameMetadata",
128 value: value,
129 localIndex: localIndex,
130 functionIndex: functionIndex
131 };
132 return node;
133}
134export function binaryModule(id, blob) {
135 if (id !== null && id !== undefined) {
136 if (!(typeof id === "string")) {
137 throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
138 }
139 }
140
141 if (!(_typeof(blob) === "object" && typeof blob.length !== "undefined")) {
142 throw new Error('typeof blob === "object" && typeof blob.length !== "undefined"' + " error: " + (undefined || "unknown"));
143 }
144
145 var node = {
146 type: "BinaryModule",
147 id: id,
148 blob: blob
149 };
150 return node;
151}
152export function quoteModule(id, string) {
153 if (id !== null && id !== undefined) {
154 if (!(typeof id === "string")) {
155 throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
156 }
157 }
158
159 if (!(_typeof(string) === "object" && typeof string.length !== "undefined")) {
160 throw new Error('typeof string === "object" && typeof string.length !== "undefined"' + " error: " + (undefined || "unknown"));
161 }
162
163 var node = {
164 type: "QuoteModule",
165 id: id,
166 string: string
167 };
168 return node;
169}
170export function sectionMetadata(section, startOffset, size, vectorOfSize) {
171 if (!(typeof startOffset === "number")) {
172 throw new Error('typeof startOffset === "number"' + " error: " + ("Argument startOffset must be of type number, given: " + _typeof(startOffset) || "unknown"));
173 }
174
175 var node = {
176 type: "SectionMetadata",
177 section: section,
178 startOffset: startOffset,
179 size: size,
180 vectorOfSize: vectorOfSize
181 };
182 return node;
183}
184export function producersSectionMetadata(producers) {
185 if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) {
186 throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown"));
187 }
188
189 var node = {
190 type: "ProducersSectionMetadata",
191 producers: producers
192 };
193 return node;
194}
195export function producerMetadata(language, processedBy, sdk) {
196 if (!(_typeof(language) === "object" && typeof language.length !== "undefined")) {
197 throw new Error('typeof language === "object" && typeof language.length !== "undefined"' + " error: " + (undefined || "unknown"));
198 }
199
200 if (!(_typeof(processedBy) === "object" && typeof processedBy.length !== "undefined")) {
201 throw new Error('typeof processedBy === "object" && typeof processedBy.length !== "undefined"' + " error: " + (undefined || "unknown"));
202 }
203
204 if (!(_typeof(sdk) === "object" && typeof sdk.length !== "undefined")) {
205 throw new Error('typeof sdk === "object" && typeof sdk.length !== "undefined"' + " error: " + (undefined || "unknown"));
206 }
207
208 var node = {
209 type: "ProducerMetadata",
210 language: language,
211 processedBy: processedBy,
212 sdk: sdk
213 };
214 return node;
215}
216export function producerMetadataVersionedName(name, version) {
217 if (!(typeof name === "string")) {
218 throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
219 }
220
221 if (!(typeof version === "string")) {
222 throw new Error('typeof version === "string"' + " error: " + ("Argument version must be of type string, given: " + _typeof(version) || "unknown"));
223 }
224
225 var node = {
226 type: "ProducerMetadataVersionedName",
227 name: name,
228 version: version
229 };
230 return node;
231}
232export function loopInstruction(label, resulttype, instr) {
233 if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) {
234 throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown"));
235 }
236
237 var node = {
238 type: "LoopInstruction",
239 id: "loop",
240 label: label,
241 resulttype: resulttype,
242 instr: instr
243 };
244 return node;
245}
246export function instr(id, object, args, namedArgs) {
247 if (!(typeof id === "string")) {
248 throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
249 }
250
251 if (!(_typeof(args) === "object" && typeof args.length !== "undefined")) {
252 throw new Error('typeof args === "object" && typeof args.length !== "undefined"' + " error: " + (undefined || "unknown"));
253 }
254
255 var node = {
256 type: "Instr",
257 id: id,
258 args: args
259 };
260
261 if (typeof object !== "undefined") {
262 node.object = object;
263 }
264
265 if (typeof namedArgs !== "undefined" && Object.keys(namedArgs).length !== 0) {
266 node.namedArgs = namedArgs;
267 }
268
269 return node;
270}
271export function ifInstruction(testLabel, test, result, consequent, alternate) {
272 if (!(_typeof(test) === "object" && typeof test.length !== "undefined")) {
273 throw new Error('typeof test === "object" && typeof test.length !== "undefined"' + " error: " + (undefined || "unknown"));
274 }
275
276 if (!(_typeof(consequent) === "object" && typeof consequent.length !== "undefined")) {
277 throw new Error('typeof consequent === "object" && typeof consequent.length !== "undefined"' + " error: " + (undefined || "unknown"));
278 }
279
280 if (!(_typeof(alternate) === "object" && typeof alternate.length !== "undefined")) {
281 throw new Error('typeof alternate === "object" && typeof alternate.length !== "undefined"' + " error: " + (undefined || "unknown"));
282 }
283
284 var node = {
285 type: "IfInstruction",
286 id: "if",
287 testLabel: testLabel,
288 test: test,
289 result: result,
290 consequent: consequent,
291 alternate: alternate
292 };
293 return node;
294}
295export function stringLiteral(value) {
296 if (!(typeof value === "string")) {
297 throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
298 }
299
300 var node = {
301 type: "StringLiteral",
302 value: value
303 };
304 return node;
305}
306export function numberLiteral(value, raw) {
307 if (!(typeof value === "number")) {
308 throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown"));
309 }
310
311 if (!(typeof raw === "string")) {
312 throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
313 }
314
315 var node = {
316 type: "NumberLiteral",
317 value: value,
318 raw: raw
319 };
320 return node;
321}
322export function longNumberLiteral(value, raw) {
323 if (!(typeof raw === "string")) {
324 throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
325 }
326
327 var node = {
328 type: "LongNumberLiteral",
329 value: value,
330 raw: raw
331 };
332 return node;
333}
334export function floatLiteral(value, nan, inf, raw) {
335 if (!(typeof value === "number")) {
336 throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown"));
337 }
338
339 if (nan !== null && nan !== undefined) {
340 if (!(typeof nan === "boolean")) {
341 throw new Error('typeof nan === "boolean"' + " error: " + ("Argument nan must be of type boolean, given: " + _typeof(nan) || "unknown"));
342 }
343 }
344
345 if (inf !== null && inf !== undefined) {
346 if (!(typeof inf === "boolean")) {
347 throw new Error('typeof inf === "boolean"' + " error: " + ("Argument inf must be of type boolean, given: " + _typeof(inf) || "unknown"));
348 }
349 }
350
351 if (!(typeof raw === "string")) {
352 throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
353 }
354
355 var node = {
356 type: "FloatLiteral",
357 value: value,
358 raw: raw
359 };
360
361 if (nan === true) {
362 node.nan = true;
363 }
364
365 if (inf === true) {
366 node.inf = true;
367 }
368
369 return node;
370}
371export function elem(table, offset, funcs) {
372 if (!(_typeof(offset) === "object" && typeof offset.length !== "undefined")) {
373 throw new Error('typeof offset === "object" && typeof offset.length !== "undefined"' + " error: " + (undefined || "unknown"));
374 }
375
376 if (!(_typeof(funcs) === "object" && typeof funcs.length !== "undefined")) {
377 throw new Error('typeof funcs === "object" && typeof funcs.length !== "undefined"' + " error: " + (undefined || "unknown"));
378 }
379
380 var node = {
381 type: "Elem",
382 table: table,
383 offset: offset,
384 funcs: funcs
385 };
386 return node;
387}
388export function indexInFuncSection(index) {
389 var node = {
390 type: "IndexInFuncSection",
391 index: index
392 };
393 return node;
394}
395export function valtypeLiteral(name) {
396 var node = {
397 type: "ValtypeLiteral",
398 name: name
399 };
400 return node;
401}
402export function typeInstruction(id, functype) {
403 var node = {
404 type: "TypeInstruction",
405 id: id,
406 functype: functype
407 };
408 return node;
409}
410export function start(index) {
411 var node = {
412 type: "Start",
413 index: index
414 };
415 return node;
416}
417export function globalType(valtype, mutability) {
418 var node = {
419 type: "GlobalType",
420 valtype: valtype,
421 mutability: mutability
422 };
423 return node;
424}
425export function leadingComment(value) {
426 if (!(typeof value === "string")) {
427 throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
428 }
429
430 var node = {
431 type: "LeadingComment",
432 value: value
433 };
434 return node;
435}
436export function blockComment(value) {
437 if (!(typeof value === "string")) {
438 throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
439 }
440
441 var node = {
442 type: "BlockComment",
443 value: value
444 };
445 return node;
446}
447export function data(memoryIndex, offset, init) {
448 var node = {
449 type: "Data",
450 memoryIndex: memoryIndex,
451 offset: offset,
452 init: init
453 };
454 return node;
455}
456export function global(globalType, init, name) {
457 if (!(_typeof(init) === "object" && typeof init.length !== "undefined")) {
458 throw new Error('typeof init === "object" && typeof init.length !== "undefined"' + " error: " + (undefined || "unknown"));
459 }
460
461 var node = {
462 type: "Global",
463 globalType: globalType,
464 init: init,
465 name: name
466 };
467 return node;
468}
469export function table(elementType, limits, name, elements) {
470 if (!(limits.type === "Limit")) {
471 throw new Error('limits.type === "Limit"' + " error: " + ("Argument limits must be of type Limit, given: " + limits.type || "unknown"));
472 }
473
474 if (elements !== null && elements !== undefined) {
475 if (!(_typeof(elements) === "object" && typeof elements.length !== "undefined")) {
476 throw new Error('typeof elements === "object" && typeof elements.length !== "undefined"' + " error: " + (undefined || "unknown"));
477 }
478 }
479
480 var node = {
481 type: "Table",
482 elementType: elementType,
483 limits: limits,
484 name: name
485 };
486
487 if (typeof elements !== "undefined" && elements.length > 0) {
488 node.elements = elements;
489 }
490
491 return node;
492}
493export function memory(limits, id) {
494 var node = {
495 type: "Memory",
496 limits: limits,
497 id: id
498 };
499 return node;
500}
501export function funcImportDescr(id, signature) {
502 var node = {
503 type: "FuncImportDescr",
504 id: id,
505 signature: signature
506 };
507 return node;
508}
509export function moduleImport(module, name, descr) {
510 if (!(typeof module === "string")) {
511 throw new Error('typeof module === "string"' + " error: " + ("Argument module must be of type string, given: " + _typeof(module) || "unknown"));
512 }
513
514 if (!(typeof name === "string")) {
515 throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
516 }
517
518 var node = {
519 type: "ModuleImport",
520 module: module,
521 name: name,
522 descr: descr
523 };
524 return node;
525}
526export function moduleExportDescr(exportType, id) {
527 var node = {
528 type: "ModuleExportDescr",
529 exportType: exportType,
530 id: id
531 };
532 return node;
533}
534export function moduleExport(name, descr) {
535 if (!(typeof name === "string")) {
536 throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
537 }
538
539 var node = {
540 type: "ModuleExport",
541 name: name,
542 descr: descr
543 };
544 return node;
545}
546export function limit(min, max, shared) {
547 if (!(typeof min === "number")) {
548 throw new Error('typeof min === "number"' + " error: " + ("Argument min must be of type number, given: " + _typeof(min) || "unknown"));
549 }
550
551 if (max !== null && max !== undefined) {
552 if (!(typeof max === "number")) {
553 throw new Error('typeof max === "number"' + " error: " + ("Argument max must be of type number, given: " + _typeof(max) || "unknown"));
554 }
555 }
556
557 if (shared !== null && shared !== undefined) {
558 if (!(typeof shared === "boolean")) {
559 throw new Error('typeof shared === "boolean"' + " error: " + ("Argument shared must be of type boolean, given: " + _typeof(shared) || "unknown"));
560 }
561 }
562
563 var node = {
564 type: "Limit",
565 min: min
566 };
567
568 if (typeof max !== "undefined") {
569 node.max = max;
570 }
571
572 if (shared === true) {
573 node.shared = true;
574 }
575
576 return node;
577}
578export function signature(params, results) {
579 if (!(_typeof(params) === "object" && typeof params.length !== "undefined")) {
580 throw new Error('typeof params === "object" && typeof params.length !== "undefined"' + " error: " + (undefined || "unknown"));
581 }
582
583 if (!(_typeof(results) === "object" && typeof results.length !== "undefined")) {
584 throw new Error('typeof results === "object" && typeof results.length !== "undefined"' + " error: " + (undefined || "unknown"));
585 }
586
587 var node = {
588 type: "Signature",
589 params: params,
590 results: results
591 };
592 return node;
593}
594export function program(body) {
595 if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) {
596 throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown"));
597 }
598
599 var node = {
600 type: "Program",
601 body: body
602 };
603 return node;
604}
605export function identifier(value, raw) {
606 if (!(typeof value === "string")) {
607 throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
608 }
609
610 if (raw !== null && raw !== undefined) {
611 if (!(typeof raw === "string")) {
612 throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
613 }
614 }
615
616 var node = {
617 type: "Identifier",
618 value: value
619 };
620
621 if (typeof raw !== "undefined") {
622 node.raw = raw;
623 }
624
625 return node;
626}
627export function blockInstruction(label, instr, result) {
628 if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) {
629 throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown"));
630 }
631
632 var node = {
633 type: "BlockInstruction",
634 id: "block",
635 label: label,
636 instr: instr,
637 result: result
638 };
639 return node;
640}
641export function callInstruction(index, instrArgs, numeric) {
642 if (instrArgs !== null && instrArgs !== undefined) {
643 if (!(_typeof(instrArgs) === "object" && typeof instrArgs.length !== "undefined")) {
644 throw new Error('typeof instrArgs === "object" && typeof instrArgs.length !== "undefined"' + " error: " + (undefined || "unknown"));
645 }
646 }
647
648 var node = {
649 type: "CallInstruction",
650 id: "call",
651 index: index
652 };
653
654 if (typeof instrArgs !== "undefined" && instrArgs.length > 0) {
655 node.instrArgs = instrArgs;
656 }
657
658 if (typeof numeric !== "undefined") {
659 node.numeric = numeric;
660 }
661
662 return node;
663}
664export function callIndirectInstruction(signature, intrs) {
665 if (intrs !== null && intrs !== undefined) {
666 if (!(_typeof(intrs) === "object" && typeof intrs.length !== "undefined")) {
667 throw new Error('typeof intrs === "object" && typeof intrs.length !== "undefined"' + " error: " + (undefined || "unknown"));
668 }
669 }
670
671 var node = {
672 type: "CallIndirectInstruction",
673 id: "call_indirect",
674 signature: signature
675 };
676
677 if (typeof intrs !== "undefined" && intrs.length > 0) {
678 node.intrs = intrs;
679 }
680
681 return node;
682}
683export function byteArray(values) {
684 if (!(_typeof(values) === "object" && typeof values.length !== "undefined")) {
685 throw new Error('typeof values === "object" && typeof values.length !== "undefined"' + " error: " + (undefined || "unknown"));
686 }
687
688 var node = {
689 type: "ByteArray",
690 values: values
691 };
692 return node;
693}
694export function func(name, signature, body, isExternal, metadata) {
695 if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) {
696 throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown"));
697 }
698
699 if (isExternal !== null && isExternal !== undefined) {
700 if (!(typeof isExternal === "boolean")) {
701 throw new Error('typeof isExternal === "boolean"' + " error: " + ("Argument isExternal must be of type boolean, given: " + _typeof(isExternal) || "unknown"));
702 }
703 }
704
705 var node = {
706 type: "Func",
707 name: name,
708 signature: signature,
709 body: body
710 };
711
712 if (isExternal === true) {
713 node.isExternal = true;
714 }
715
716 if (typeof metadata !== "undefined") {
717 node.metadata = metadata;
718 }
719
720 return node;
721}
722export function internalBrUnless(target) {
723 if (!(typeof target === "number")) {
724 throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
725 }
726
727 var node = {
728 type: "InternalBrUnless",
729 target: target
730 };
731 return node;
732}
733export function internalGoto(target) {
734 if (!(typeof target === "number")) {
735 throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
736 }
737
738 var node = {
739 type: "InternalGoto",
740 target: target
741 };
742 return node;
743}
744export function internalCallExtern(target) {
745 if (!(typeof target === "number")) {
746 throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
747 }
748
749 var node = {
750 type: "InternalCallExtern",
751 target: target
752 };
753 return node;
754}
755export function internalEndAndReturn() {
756 var node = {
757 type: "InternalEndAndReturn"
758 };
759 return node;
760}
761export var isModule = isTypeOf("Module");
762export var isModuleMetadata = isTypeOf("ModuleMetadata");
763export var isModuleNameMetadata = isTypeOf("ModuleNameMetadata");
764export var isFunctionNameMetadata = isTypeOf("FunctionNameMetadata");
765export var isLocalNameMetadata = isTypeOf("LocalNameMetadata");
766export var isBinaryModule = isTypeOf("BinaryModule");
767export var isQuoteModule = isTypeOf("QuoteModule");
768export var isSectionMetadata = isTypeOf("SectionMetadata");
769export var isProducersSectionMetadata = isTypeOf("ProducersSectionMetadata");
770export var isProducerMetadata = isTypeOf("ProducerMetadata");
771export var isProducerMetadataVersionedName = isTypeOf("ProducerMetadataVersionedName");
772export var isLoopInstruction = isTypeOf("LoopInstruction");
773export var isInstr = isTypeOf("Instr");
774export var isIfInstruction = isTypeOf("IfInstruction");
775export var isStringLiteral = isTypeOf("StringLiteral");
776export var isNumberLiteral = isTypeOf("NumberLiteral");
777export var isLongNumberLiteral = isTypeOf("LongNumberLiteral");
778export var isFloatLiteral = isTypeOf("FloatLiteral");
779export var isElem = isTypeOf("Elem");
780export var isIndexInFuncSection = isTypeOf("IndexInFuncSection");
781export var isValtypeLiteral = isTypeOf("ValtypeLiteral");
782export var isTypeInstruction = isTypeOf("TypeInstruction");
783export var isStart = isTypeOf("Start");
784export var isGlobalType = isTypeOf("GlobalType");
785export var isLeadingComment = isTypeOf("LeadingComment");
786export var isBlockComment = isTypeOf("BlockComment");
787export var isData = isTypeOf("Data");
788export var isGlobal = isTypeOf("Global");
789export var isTable = isTypeOf("Table");
790export var isMemory = isTypeOf("Memory");
791export var isFuncImportDescr = isTypeOf("FuncImportDescr");
792export var isModuleImport = isTypeOf("ModuleImport");
793export var isModuleExportDescr = isTypeOf("ModuleExportDescr");
794export var isModuleExport = isTypeOf("ModuleExport");
795export var isLimit = isTypeOf("Limit");
796export var isSignature = isTypeOf("Signature");
797export var isProgram = isTypeOf("Program");
798export var isIdentifier = isTypeOf("Identifier");
799export var isBlockInstruction = isTypeOf("BlockInstruction");
800export var isCallInstruction = isTypeOf("CallInstruction");
801export var isCallIndirectInstruction = isTypeOf("CallIndirectInstruction");
802export var isByteArray = isTypeOf("ByteArray");
803export var isFunc = isTypeOf("Func");
804export var isInternalBrUnless = isTypeOf("InternalBrUnless");
805export var isInternalGoto = isTypeOf("InternalGoto");
806export var isInternalCallExtern = isTypeOf("InternalCallExtern");
807export var isInternalEndAndReturn = isTypeOf("InternalEndAndReturn");
808export var isNode = function isNode(node) {
809 return isModule(node) || isModuleMetadata(node) || isModuleNameMetadata(node) || isFunctionNameMetadata(node) || isLocalNameMetadata(node) || isBinaryModule(node) || isQuoteModule(node) || isSectionMetadata(node) || isProducersSectionMetadata(node) || isProducerMetadata(node) || isProducerMetadataVersionedName(node) || isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isElem(node) || isIndexInFuncSection(node) || isValtypeLiteral(node) || isTypeInstruction(node) || isStart(node) || isGlobalType(node) || isLeadingComment(node) || isBlockComment(node) || isData(node) || isGlobal(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node) || isModuleImport(node) || isModuleExportDescr(node) || isModuleExport(node) || isLimit(node) || isSignature(node) || isProgram(node) || isIdentifier(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node) || isByteArray(node) || isFunc(node) || isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node);
810};
811export var isBlock = function isBlock(node) {
812 return isLoopInstruction(node) || isBlockInstruction(node) || isFunc(node);
813};
814export var isInstruction = function isInstruction(node) {
815 return isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isTypeInstruction(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node);
816};
817export var isExpression = function isExpression(node) {
818 return isInstr(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isValtypeLiteral(node) || isIdentifier(node);
819};
820export var isNumericLiteral = function isNumericLiteral(node) {
821 return isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node);
822};
823export var isImportDescr = function isImportDescr(node) {
824 return isGlobalType(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node);
825};
826export var isIntrinsic = function isIntrinsic(node) {
827 return isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node);
828};
829export var assertModule = assertTypeOf("Module");
830export var assertModuleMetadata = assertTypeOf("ModuleMetadata");
831export var assertModuleNameMetadata = assertTypeOf("ModuleNameMetadata");
832export var assertFunctionNameMetadata = assertTypeOf("FunctionNameMetadata");
833export var assertLocalNameMetadata = assertTypeOf("LocalNameMetadata");
834export var assertBinaryModule = assertTypeOf("BinaryModule");
835export var assertQuoteModule = assertTypeOf("QuoteModule");
836export var assertSectionMetadata = assertTypeOf("SectionMetadata");
837export var assertProducersSectionMetadata = assertTypeOf("ProducersSectionMetadata");
838export var assertProducerMetadata = assertTypeOf("ProducerMetadata");
839export var assertProducerMetadataVersionedName = assertTypeOf("ProducerMetadataVersionedName");
840export var assertLoopInstruction = assertTypeOf("LoopInstruction");
841export var assertInstr = assertTypeOf("Instr");
842export var assertIfInstruction = assertTypeOf("IfInstruction");
843export var assertStringLiteral = assertTypeOf("StringLiteral");
844export var assertNumberLiteral = assertTypeOf("NumberLiteral");
845export var assertLongNumberLiteral = assertTypeOf("LongNumberLiteral");
846export var assertFloatLiteral = assertTypeOf("FloatLiteral");
847export var assertElem = assertTypeOf("Elem");
848export var assertIndexInFuncSection = assertTypeOf("IndexInFuncSection");
849export var assertValtypeLiteral = assertTypeOf("ValtypeLiteral");
850export var assertTypeInstruction = assertTypeOf("TypeInstruction");
851export var assertStart = assertTypeOf("Start");
852export var assertGlobalType = assertTypeOf("GlobalType");
853export var assertLeadingComment = assertTypeOf("LeadingComment");
854export var assertBlockComment = assertTypeOf("BlockComment");
855export var assertData = assertTypeOf("Data");
856export var assertGlobal = assertTypeOf("Global");
857export var assertTable = assertTypeOf("Table");
858export var assertMemory = assertTypeOf("Memory");
859export var assertFuncImportDescr = assertTypeOf("FuncImportDescr");
860export var assertModuleImport = assertTypeOf("ModuleImport");
861export var assertModuleExportDescr = assertTypeOf("ModuleExportDescr");
862export var assertModuleExport = assertTypeOf("ModuleExport");
863export var assertLimit = assertTypeOf("Limit");
864export var assertSignature = assertTypeOf("Signature");
865export var assertProgram = assertTypeOf("Program");
866export var assertIdentifier = assertTypeOf("Identifier");
867export var assertBlockInstruction = assertTypeOf("BlockInstruction");
868export var assertCallInstruction = assertTypeOf("CallInstruction");
869export var assertCallIndirectInstruction = assertTypeOf("CallIndirectInstruction");
870export var assertByteArray = assertTypeOf("ByteArray");
871export var assertFunc = assertTypeOf("Func");
872export var assertInternalBrUnless = assertTypeOf("InternalBrUnless");
873export var assertInternalGoto = assertTypeOf("InternalGoto");
874export var assertInternalCallExtern = assertTypeOf("InternalCallExtern");
875export var assertInternalEndAndReturn = assertTypeOf("InternalEndAndReturn");
876export var unionTypesMap = {
877 Module: ["Node"],
878 ModuleMetadata: ["Node"],
879 ModuleNameMetadata: ["Node"],
880 FunctionNameMetadata: ["Node"],
881 LocalNameMetadata: ["Node"],
882 BinaryModule: ["Node"],
883 QuoteModule: ["Node"],
884 SectionMetadata: ["Node"],
885 ProducersSectionMetadata: ["Node"],
886 ProducerMetadata: ["Node"],
887 ProducerMetadataVersionedName: ["Node"],
888 LoopInstruction: ["Node", "Block", "Instruction"],
889 Instr: ["Node", "Expression", "Instruction"],
890 IfInstruction: ["Node", "Instruction"],
891 StringLiteral: ["Node", "Expression"],
892 NumberLiteral: ["Node", "NumericLiteral", "Expression"],
893 LongNumberLiteral: ["Node", "NumericLiteral", "Expression"],
894 FloatLiteral: ["Node", "NumericLiteral", "Expression"],
895 Elem: ["Node"],
896 IndexInFuncSection: ["Node"],
897 ValtypeLiteral: ["Node", "Expression"],
898 TypeInstruction: ["Node", "Instruction"],
899 Start: ["Node"],
900 GlobalType: ["Node", "ImportDescr"],
901 LeadingComment: ["Node"],
902 BlockComment: ["Node"],
903 Data: ["Node"],
904 Global: ["Node"],
905 Table: ["Node", "ImportDescr"],
906 Memory: ["Node", "ImportDescr"],
907 FuncImportDescr: ["Node", "ImportDescr"],
908 ModuleImport: ["Node"],
909 ModuleExportDescr: ["Node"],
910 ModuleExport: ["Node"],
911 Limit: ["Node"],
912 Signature: ["Node"],
913 Program: ["Node"],
914 Identifier: ["Node", "Expression"],
915 BlockInstruction: ["Node", "Block", "Instruction"],
916 CallInstruction: ["Node", "Instruction"],
917 CallIndirectInstruction: ["Node", "Instruction"],
918 ByteArray: ["Node"],
919 Func: ["Node", "Block"],
920 InternalBrUnless: ["Node", "Intrinsic"],
921 InternalGoto: ["Node", "Intrinsic"],
922 InternalCallExtern: ["Node", "Intrinsic"],
923 InternalEndAndReturn: ["Node", "Intrinsic"]
924};
925export var nodeAndUnionTypes = ["Module", "ModuleMetadata", "ModuleNameMetadata", "FunctionNameMetadata", "LocalNameMetadata", "BinaryModule", "QuoteModule", "SectionMetadata", "ProducersSectionMetadata", "ProducerMetadata", "ProducerMetadataVersionedName", "LoopInstruction", "Instr", "IfInstruction", "StringLiteral", "NumberLiteral", "LongNumberLiteral", "FloatLiteral", "Elem", "IndexInFuncSection", "ValtypeLiteral", "TypeInstruction", "Start", "GlobalType", "LeadingComment", "BlockComment", "Data", "Global", "Table", "Memory", "FuncImportDescr", "ModuleImport", "ModuleExportDescr", "ModuleExport", "Limit", "Signature", "Program", "Identifier", "BlockInstruction", "CallInstruction", "CallIndirectInstruction", "ByteArray", "Func", "InternalBrUnless", "InternalGoto", "InternalCallExtern", "InternalEndAndReturn", "Node", "Block", "Instruction", "Expression", "NumericLiteral", "ImportDescr", "Intrinsic"];
Note: See TracBrowser for help on using the repository browser.