CapturedVariable.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. namespace Mono.CompilerServices.SymbolWriter
  3. {
  4. public struct CapturedVariable
  5. {
  6. public enum CapturedKind : byte
  7. {
  8. Local,
  9. Parameter,
  10. This
  11. }
  12. public readonly string Name;
  13. public readonly string CapturedName;
  14. public readonly CapturedVariable.CapturedKind Kind;
  15. public CapturedVariable(string name, string captured_name, CapturedVariable.CapturedKind kind)
  16. {
  17. this.Name = name;
  18. this.CapturedName = captured_name;
  19. this.Kind = kind;
  20. }
  21. internal CapturedVariable(MyBinaryReader reader)
  22. {
  23. this.Name = reader.ReadString();
  24. this.CapturedName = reader.ReadString();
  25. this.Kind = (CapturedVariable.CapturedKind)reader.ReadByte();
  26. }
  27. //internal void Write(MyBinaryWriter bw)
  28. //{
  29. // bw.Write(this.Name);
  30. // bw.Write(this.CapturedName);
  31. // bw.Write((byte)this.Kind);
  32. //}
  33. public override string ToString()
  34. {
  35. return string.Format("[CapturedVariable {0}:{1}:{2}]", this.Name, this.CapturedName, this.Kind);
  36. }
  37. }
  38. }