-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
65 additions
and
16 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace Unluau.IL.Values.Conditions | ||
{ | ||
/// <summary> | ||
/// Condition that checks if the basic value is valid (not null or true boolean). | ||
/// </summary> | ||
/// <param name="context"></param> | ||
/// <param name="basicValue"></param> | ||
public class Test(Context context, BasicValue basicValue) : BasicCondition(context) | ||
{ | ||
/// <summary> | ||
/// The value to check. | ||
/// </summary> | ||
public BasicValue Value { get; set; } = basicValue; | ||
|
||
/// <summary> | ||
/// Returns a string representation of the current value. | ||
/// </summary> | ||
/// <returns>String representation.</returns> | ||
public override string? ToString() => $"Test({Value})"; | ||
|
||
/// <summary> | ||
/// Implements the visitor. | ||
/// </summary> | ||
/// <param name="visitor">The visitor.</param> | ||
public override void Visit(Visitor visitor) | ||
{ | ||
if (visitor.Visit(this)) | ||
{ | ||
Value.Visit(visitor); | ||
} | ||
} | ||
} | ||
} |
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