summaryrefslogtreecommitdiff
path: root/lex.h
diff options
context:
space:
mode:
Diffstat (limited to 'lex.h')
-rw-r--r--lex.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/lex.h b/lex.h
index f8d48ab..b6a102d 100644
--- a/lex.h
+++ b/lex.h
@@ -4,7 +4,7 @@
#include "typeutils.h"
-typedef struct ExpansionRegion ExpansionRegion;
+typedef struct Region Region;
typedef enum {
@@ -24,13 +24,15 @@ typedef struct {
QuotationMode qmode;
union {
char* literal_str;
- ExpansionRegion* reg_ptr;
+ Region* reg_ptr;
char* varname;
} as;
} Chunk;
-DECLARE_VEC(Chunk, ChunkVec)
+DECLARE_VEC(Chunk, Word)
+
+DECLARE_VEC(Word, WordVec)
typedef enum {
TOK_WORD,
@@ -52,7 +54,7 @@ typedef struct {
TokenKind kind;
union {
- ChunkVec word;
+ Word word;
SpecialToken spec;
} as;
} Token;
@@ -67,19 +69,19 @@ typedef enum {
ARITHM,
} RegionMode;
-struct ExpansionRegion {
+struct Region {
RegionMode mode;
TokenVec tokens;
};
DECLARE_MAYBE(Chunk);
-DECLARE_VEC(ExpansionRegion, ExpansionRegionVec)
+DECLARE_VEC(Region, RegionVec)
typedef struct {
TokenVec top_tokens;
- ExpansionRegionVec reg_arena;
+ RegionVec reg_arena;
} LexResult;