summaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'types.h')
-rw-r--r--types.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/types.h b/types.h
index 3410f4f..1eadff5 100644
--- a/types.h
+++ b/types.h
@@ -877,21 +877,22 @@ enum {
FOR_INCLUDES_TO = 0x04
};
typedef U8 ForFlags;
+typedef struct {
+ Expression *from; // can't be null
+ Expression *to; // can be null
+ union {
+ // (either) can be null
+ Expression *step; // before typing
+ Value *stepval; /* after typing. the type of this is header.type.tuple[0] (i.e. the value type for this for loop),
+NOTE: this might be different from the original ForExpr.step.type, because of implicit type conversions. */
+ };
+} RangeFor;
typedef struct For {
ForFlags flags;
Declaration header;
Block body;
union {
- struct {
- Expression *from; // can't be null
- Expression *to; // can be null
- union {
- // (either) can be null
- Expression *step; // before typing
- Value *stepval; /* after typing. the type of this is header.type.tuple[0] (i.e. the value type for this for loop),
- NOTE: this might be different from the original ForExpr.step.type, because of implicit type conversions. */
- };
- } range;
+ RangeFor range;
Expression *of;
};
} For;