Skip to content

Commit

Permalink
lint: dotnet format
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulusParssinen committed Feb 3, 2024
1 parent 6e4667e commit 05dfe10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions Flazzy/ABC/AVM2/Instructions/ASInstruction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected virtual void WriteValuesTo(ref SpanFlashWriter output)
{ }

public int GetSize() => sizeof(OPCode) + GetBodySize();
public void WriteTo(ref SpanFlashWriter output)
public void WriteTo(ref SpanFlashWriter output)
{
output.Write((byte)OP);
WriteValuesTo(ref output);
Expand All @@ -40,10 +40,10 @@ public void WriteTo(ref SpanFlashWriter output)
public override void WriteTo(FlashWriter output)
{
Span<byte> buffer = stackalloc byte[64].Slice(0, GetSize());

var outputWriter = new SpanFlashWriter(buffer);
WriteTo(ref outputWriter);

output.Write(buffer);
}

Expand Down Expand Up @@ -101,7 +101,7 @@ public static ASInstruction Create(ABCFile abc, ref SpanFlashReader input)
OPCode.StrictEquals => new StrictEqualsIns(),
OPCode.Subtract_i => new SubtractIIns(),
OPCode.Subtract => new SubtractIns(),

// Bit manipulation
OPCode.BitAnd => new BitAndIns(),
OPCode.BitNot => new BitNotIns(),
Expand All @@ -110,7 +110,7 @@ public static ASInstruction Create(ABCFile abc, ref SpanFlashReader input)
OPCode.LShift => new LShiftIns(),
OPCode.RShift => new RShiftIns(),
OPCode.URShift => new URShiftIns(),

// Control transfer
OPCode.IfEq => new IfEqualIns(ref input),
OPCode.IfGe => new IfGreaterEqualIns(ref input),
Expand All @@ -130,7 +130,7 @@ public static ASInstruction Create(ABCFile abc, ref SpanFlashReader input)

OPCode.Label => new LabelIns(),
OPCode.LookUpSwitch => new LookUpSwitchIns(ref input),

// Register management
OPCode.DecLocal_i => new DecLocalIIns(ref input),
OPCode.DecLocal => new DecLocalIns(ref input),
Expand Down Expand Up @@ -169,7 +169,7 @@ public static ASInstruction Create(ABCFile abc, ref SpanFlashReader input)
OPCode.PopScope => new PopScopeIns(),
OPCode.PushWith => new PushWithIns(),
OPCode.PushScope => new PushScopeIns(),

// Type conversion
OPCode.Coerce_a => new CoerceAIns(),
OPCode.Coerce => new CoerceIns(abc, ref input),
Expand Down Expand Up @@ -245,7 +245,7 @@ public static ASInstruction Create(ABCFile abc, ref SpanFlashReader input)
OPCode.SetSuper => new SetSuperIns(abc, ref input),
OPCode.Throw => new ThrowIns(),
OPCode.TypeOf => new TypeOfIns(),

_ => throw new Exception("Unhandled OPCode: " + op)
};
}
Expand Down
6 changes: 3 additions & 3 deletions Flazzy/IO/SpanFlashReader.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text;
using System.Buffers.Binary;
using System.Buffers.Binary;
using System.Runtime.CompilerServices;
using System.Text;

namespace Flazzy.IO;

Expand Down Expand Up @@ -123,4 +123,4 @@ public string ReadNullString()
Position += length + 1;
return value;
}
}
}

0 comments on commit 05dfe10

Please sign in to comment.