-
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.
Add
SetValue
to the IL instruction set.
- Loading branch information
Showing
8 changed files
with
101 additions
and
7 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
Binary file not shown.
Binary file not shown.
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,36 @@ | ||
using Unluau.IL.Values; | ||
|
||
namespace Unluau.IL.Statements.Instructions | ||
{ | ||
/// <summary> | ||
/// Assigns a value to an index. | ||
/// </summary> | ||
/// <param name="context">Information about the instruction.</param> | ||
/// <param name="index">The index.</param> | ||
/// <param name="value">The value to assign.</param> | ||
public class SetIndex(Context context, Values.Index index, BasicValue value) : Instruction(context) | ||
{ | ||
/// <summary> | ||
/// The index we are setting. | ||
/// </summary> | ||
public Values.Index Index { get; set; } = index; | ||
|
||
/// <summary> | ||
/// The value we are assigning to the index. | ||
/// </summary> | ||
public BasicValue Value { get; set; } = value; | ||
|
||
/// <summary> | ||
/// Implements the recursive visitor pattern. | ||
/// </summary> | ||
/// <param name="visitor">The visitor.</param> | ||
public override void Visit(Visitor visitor) | ||
{ | ||
if (visitor.Visit(this)) | ||
{ | ||
Index.Visit(visitor); | ||
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