diff options
Diffstat (limited to 'lex.h')
| -rw-r--r-- | lex.h | 27 |
1 files changed, 13 insertions, 14 deletions
@@ -1,7 +1,7 @@ #include "typeutils.h" -typedef struct Region Region; +typedef struct ExpansionRegion ExpansionRegion; typedef enum { @@ -10,24 +10,19 @@ typedef enum { DOUBLE_Q, } QuotationMode; - typedef enum { LITERAL, - CMD_SUB, - ARITHM, + REGION_EXP, VAR_EXP, // TODO: Later include other exps } ChunkKind; - typedef struct { ChunkKind kind; - QuotationMode mode; - + QuotationMode qmode; union { - char* lit_str; - Region* sub_cmd_region; - Region* arithm_expr_region; - char* param_string; + char* literal_str; + ExpansionRegion* reg_ptr; + char* varname; } as; } Chunk; @@ -61,12 +56,16 @@ DECLARE_VEC(Token, TokenVec) DECLARE_MAYBE(SpecialToken) +typedef enum { + CMD_SUB, + ARITHM, +} RegionMode; -struct Region { - QuotationMode mode; +struct ExpansionRegion { + RegionMode mode; TokenVec tokens; }; DECLARE_MAYBE(Chunk); -DECLARE_VEC(Region, RegionVec) +DECLARE_VEC(ExpansionRegion, ExpansionRegionVec) |
