mirror of
https://github.com/ZuneDev/ZuneUIXTools.git
synced 2026-07-27 13:11:59 -07:00
Implement TypeOf and ConvertType instructions
This commit is contained in:
@@ -396,6 +396,21 @@ partial class Decompiler
|
|||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case OpCode.TypeOf:
|
||||||
|
var typeOfSchema = _context.GetImportedType(instruction.Operands.First());
|
||||||
|
var typeOfExpr = TypeOfExpression(IrisExpression.ToSyntax(typeOfSchema, _context));
|
||||||
|
stack.Push(typeOfExpr);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OpCode.ConvertType:
|
||||||
|
var destinationTypeSchema = _context.GetImportedType(instruction.Operands.First());
|
||||||
|
var typeCastExpr = CastExpression(
|
||||||
|
IrisExpression.ToSyntax(destinationTypeSchema, _context),
|
||||||
|
Parenthesize(IrisExpression.ToSyntax(stack.Pop(), _context))
|
||||||
|
);
|
||||||
|
stack.Push(typeCastExpr);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -263,6 +263,8 @@ public partial class Decompiler
|
|||||||
case OpCode.PropertyGetPeek:
|
case OpCode.PropertyGetPeek:
|
||||||
case OpCode.PropertyGetStatic:
|
case OpCode.PropertyGetStatic:
|
||||||
case OpCode.Operation:
|
case OpCode.Operation:
|
||||||
|
case OpCode.TypeOf:
|
||||||
|
case OpCode.ConvertType:
|
||||||
// These instructions only appear in initializers as inline expressions
|
// These instructions only appear in initializers as inline expressions
|
||||||
if (!TryDecompileExpression(instruction, stack))
|
if (!TryDecompileExpression(instruction, stack))
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
|||||||
Reference in New Issue
Block a user