summaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-07-10 12:08:40 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-07-10 12:08:40 -0400
commit72c4d0a78c067806a6341a5fc5acb33d5805896b (patch)
tree2f2bdda14e247915b27e73b353d32501886dca42 /types.h
parente684e1bce6ac55607d0612a3f99031c7dfbdfc90 (diff)
big changes to the way for loops work
Diffstat (limited to 'types.h')
-rw-r--r--types.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/types.h b/types.h
index bfbec3c..8ffd890 100644
--- a/types.h
+++ b/types.h
@@ -250,7 +250,6 @@ static const char *directives[DIRECT_COUNT] = {
typedef enum {
KW_SEMICOLON,
KW_COLON,
- KW_COMMA,
KW_LPAREN,
KW_RPAREN,
KW_LBRACE,
@@ -278,6 +277,10 @@ typedef enum {
KW_SLASH,
KW_PERCENT,
KW_DOTDOT,
+ KW_DOTCOMMA,
+ KW_COMMADOT,
+ KW_COMMACOMMA,
+ KW_COMMA,
KW_DOT,
KW_EQ,
KW_LAST_SYMBOL = KW_EQ, /* last one entirely consisting of symbols */
@@ -322,10 +325,10 @@ typedef enum {
} Keyword;
static const char *const keywords[KW_COUNT] = {
- ";", ":", ",", "(", ")", "{", "}", "[", "]", "==",
+ ";", ":", "(", ")", "{", "}", "[", "]", "==",
"+=", "-=", "*=", "/=", "%=",
"!=", "<=", "<", ">=", ">", "&&", "||",
- "+", "-", "*", "!", "&", "/", "%", "..", ".",
+ "+", "-", "*", "!", "&", "/", "%", "..", ".,", ",.", ",,", ",", ".",
"=",
"if", "elif", "else", "while", "for", "return", "break",
"continue", "defer", "fn", "as", "struct",
@@ -864,10 +867,13 @@ typedef struct While {
} While;
enum {
- FOR_IS_RANGE = 0x01
+ FOR_IS_RANGE = 0x01,
+ FOR_INCLUDES_FROM = 0x02,
+ FOR_INCLUDES_TO = 0x04
};
+typedef U8 ForFlags;
typedef struct For {
- U8 flags;
+ ForFlags flags;
Declaration header;
Block body;
union {