Exemplo n.º 1
0
 internal static uint Write(object argument, IDefinitionWriter writer)
 {
     var(falseOffset, trueOffset) = (SwitchLabel)argument;
     falseOffset -= 1 + 2;     // make relative to the jump offset
     trueOffset  -= 1 + 2 + 2; // make relative to the jump offset
     writer.WriteValueS16(falseOffset);
     writer.WriteValueS16(trueOffset);
     return(4);
 }
Exemplo n.º 2
0
        public static uint Write(object argument, IDefinitionWriter writer)
        {
            var targetOffset = (short)argument;

            targetOffset -= 1 + 2; // make relative to the jump offset;
            writer.WriteValueS16(targetOffset);
            return(2);
        }
Exemplo n.º 3
0
 internal static uint Write(object argument, IDefinitionWriter writer)
 {
     var(type, firstCaseOffset) = (Switch)argument;
     firstCaseOffset           -= 1 + 8 + 2; // make relative to the jump offset
     writer.WriteReference(type);
     writer.WriteValueS16(firstCaseOffset);
     return(10);
 }
Exemplo n.º 4
0
 internal static uint Write(object argument, IDefinitionWriter writer)
 {
     var(jnextOffset, sourceLine, function) = (FinalFunc_Offset)argument;
     jnextOffset -= 1 + 2; // make relative to the jump offset;
     writer.WriteValueS16(jnextOffset);
     writer.WriteValueU16(sourceLine);
     writer.WriteReference(function);
     return(12);
 }
Exemplo n.º 5
0
        internal static uint Write(object argument, IDefinitionWriter writer)
        {
            var instance   = (VirtualFunc)argument;
            var jumpOffset = instance.JumpOffset;

            jumpOffset -= 1 + 2; // make relative to the jump offset
            writer.WriteValueS16(jumpOffset);
            writer.WriteValueU16(instance.SourceLine);
            writer.WriteName(instance.Function);
            return(12);
        }
Exemplo n.º 6
0
 public static uint Write(object argument, IDefinitionWriter writer)
 {
     writer.WriteValueS16((short)argument);
     return(2);
 }