diff --git a/libs/UIX.DecompXml/Decompiler.Script.cs b/libs/UIX.DecompXml/Decompiler.Script.cs index 9d2faa8..a247f38 100644 --- a/libs/UIX.DecompXml/Decompiler.Script.cs +++ b/libs/UIX.DecompXml/Decompiler.Script.cs @@ -396,6 +396,21 @@ partial class Decompiler )); 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: return false; } diff --git a/libs/UIX.DecompXml/Decompiler.cs b/libs/UIX.DecompXml/Decompiler.cs index b3fcd54..186497d 100644 --- a/libs/UIX.DecompXml/Decompiler.cs +++ b/libs/UIX.DecompXml/Decompiler.cs @@ -263,6 +263,8 @@ public partial class Decompiler case OpCode.PropertyGetPeek: case OpCode.PropertyGetStatic: case OpCode.Operation: + case OpCode.TypeOf: + case OpCode.ConvertType: // These instructions only appear in initializers as inline expressions if (!TryDecompileExpression(instruction, stack)) throw new NotImplementedException();