LBL.cs 795 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. namespace OpenVIII.Fields.Scripts.Instructions
  3. {
  4. internal sealed class LBL : JsmInstruction
  5. {
  6. public Int32 Label { get; }
  7. public LBL(Int32 label)
  8. {
  9. Label = label;
  10. }
  11. public LBL(Int32 label, IStack<IJsmExpression> stack)
  12. : this(label)
  13. {
  14. }
  15. public override String ToString()
  16. {
  17. return $"{nameof(LBL)}({nameof(Label)}: {Label})";
  18. }
  19. public override void Format(ScriptWriter sw, IScriptFormatterContext formatterContext, IServices services)
  20. {
  21. sw.AppendLine($"// ScriptId: {Label}");
  22. }
  23. public override IAwaitable Execute(IServices services)
  24. {
  25. return DummyAwaitable.Instance;
  26. }
  27. }
  28. }