-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added
ErrorMetadataAttribute
which tags certain Yolol emulator me…
…thods with information about when they will throw errors - Tagged division and string decrementing with new attribute - Ordered state printing in cmdline emulator interface
- Loading branch information
1 parent
0bf4763
commit da37857
Showing
6 changed files
with
105 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
|
||
namespace Yolol.Execution.Attributes | ||
{ | ||
/// <summary> | ||
/// Tags an operator overload with methods that check if it might/will throw | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Method)] | ||
public class ErrorMetadataAttribute | ||
: Attribute | ||
{ | ||
public bool IsInfallible { get; } | ||
public string? WillThrow { get; } | ||
|
||
/// <summary> | ||
/// </summary> | ||
/// <param name="isInfallible">If true, indicates that this method can never throw a runtime error</param> | ||
public ErrorMetadataAttribute(bool isInfallible) | ||
{ | ||
IsInfallible = isInfallible; | ||
WillThrow = null; | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="willThrow">The name of a method which checks if the operation (given value(s)) will throw.</param> | ||
public ErrorMetadataAttribute(string willThrow) | ||
{ | ||
IsInfallible = false; | ||
WillThrow = willThrow; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters