Skip to content

Commit

Permalink
Add Operations stringify
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamQiufeng committed Aug 4, 2022
1 parent b338afc commit 1d54cec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions PseudoCode.Core/Runtime/Operations/AddTypeOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ public override void MetaOperate()
Attributes = Definition.Attribute.Type
}, SourceRange);
}

public override string ToPlainString() => $"Type alias {Name} = {TypeDescriptor}";
}
2 changes: 2 additions & 0 deletions PseudoCode.Core/Runtime/Operations/MakeConstOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ public override void MetaOperate()
Definition.ConstantInstance = constDef.ConstantInstance;
base.MetaOperate();
}

public override string ToPlainString() => $"Const {Definition.Name}";
}
2 changes: 2 additions & 0 deletions PseudoCode.Core/Runtime/Operations/MakeEnumOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ public override void MetaOperate()
ParentScope.AddVariableDefinition(elementName, definition, SourceRange);
}
}

public override string ToPlainString() => $"Enum {Name} = ({string.Join(", ", Names)})";
}
2 changes: 2 additions & 0 deletions PseudoCode.Core/Runtime/Operations/MakeTypeOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ public override void MetaOperate()
Attributes = Definition.Attribute.Type
}, SourceRange);
}

public override string ToPlainString() => $"Make Type {Name}";
}

0 comments on commit 1d54cec

Please sign in to comment.