MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getBinaryOpOperatorName

Function getBinaryOpOperatorName

compiler/companion/src/native/IRtoString.ts:30–81  ·  view source on GitHub ↗
(binaryOpKind: NativeCompilerIR.BinaryOperator)

Source from the content-addressed store, hash-verified

28}
29
30function getBinaryOpOperatorName(binaryOpKind: NativeCompilerIR.BinaryOperator): string {
31 switch (binaryOpKind) {
32 case NativeCompilerIR.BinaryOperator.Mult:
33 return 'mult';
34 case NativeCompilerIR.BinaryOperator.Add:
35 return 'add';
36 case NativeCompilerIR.BinaryOperator.Sub:
37 return 'sub';
38 case NativeCompilerIR.BinaryOperator.Div:
39 return 'div';
40 case NativeCompilerIR.BinaryOperator.LeftShift:
41 return 'leftshift';
42 case NativeCompilerIR.BinaryOperator.RightShift:
43 return 'rightshift';
44 case NativeCompilerIR.BinaryOperator.UnsignedRightShift:
45 return 'urightshift';
46 case NativeCompilerIR.BinaryOperator.BitwiseXOR:
47 return 'xor';
48 case NativeCompilerIR.BinaryOperator.BitwiseAND:
49 return 'and';
50 case NativeCompilerIR.BinaryOperator.BitwiseOR:
51 return 'or';
52 case NativeCompilerIR.BinaryOperator.LessThan:
53 return 'lt';
54 case NativeCompilerIR.BinaryOperator.LessThanOrEqual:
55 return 'lte';
56 case NativeCompilerIR.BinaryOperator.LessThanOrEqualEqual:
57 return 'ltee';
58 case NativeCompilerIR.BinaryOperator.GreaterThan:
59 return 'gt';
60 case NativeCompilerIR.BinaryOperator.GreaterThanOrEqual:
61 return 'gte';
62 case NativeCompilerIR.BinaryOperator.GreaterThanOrEqualEqual:
63 return 'gtee';
64 case NativeCompilerIR.BinaryOperator.EqualEqual:
65 return 'eq';
66 case NativeCompilerIR.BinaryOperator.EqualEqualEqual:
67 return 'eqstrict';
68 case NativeCompilerIR.BinaryOperator.DifferentThan:
69 return 'ne';
70 case NativeCompilerIR.BinaryOperator.DifferentThanStrict:
71 return 'nestrict';
72 case NativeCompilerIR.BinaryOperator.Modulo:
73 return 'mod';
74 case NativeCompilerIR.BinaryOperator.Exponentiation:
75 return 'exp';
76 case NativeCompilerIR.BinaryOperator.InstanceOf:
77 return 'instanceof';
78 case NativeCompilerIR.BinaryOperator.In:
79 return 'in';
80 }
81}
82
83function getBranchTypeName(branchType: NativeCompilerBuilderBranchType): string {
84 switch (branchType) {

Callers 1

outputIRFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected