| | | 1 | | namespace Elsa.Dsl.ElsaScript.Ast; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Represents a range-based for statement (e.g., for (var i = 0 to 10 step 1)). |
| | | 5 | | /// </summary> |
| | | 6 | | public class ForNode : StatementNode |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// Whether this for loop declares a new variable (var present in header). |
| | | 10 | | /// </summary> |
| | 8 | 11 | | public bool DeclaresVariable { get; set; } |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// The loop variable name. |
| | | 15 | | /// </summary> |
| | 10 | 16 | | public string VariableName { get; set; } = null!; |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// The start value expression. |
| | | 20 | | /// </summary> |
| | 7 | 21 | | public ExpressionNode Start { get; set; } = null!; |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// The end value expression. |
| | | 25 | | /// </summary> |
| | 7 | 26 | | public ExpressionNode End { get; set; } = null!; |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// The step value expression. |
| | | 30 | | /// </summary> |
| | 7 | 31 | | public ExpressionNode Step { get; set; } = null!; |
| | | 32 | | |
| | | 33 | | /// <summary> |
| | | 34 | | /// Whether the end value is inclusive (through) or exclusive (to). |
| | | 35 | | /// </summary> |
| | 8 | 36 | | public bool IsInclusive { get; set; } |
| | | 37 | | |
| | | 38 | | /// <summary> |
| | | 39 | | /// The body statement. |
| | | 40 | | /// </summary> |
| | 6 | 41 | | public StatementNode Body { get; set; } = null!; |
| | | 42 | | } |