summaryrefslogtreecommitdiff
path: root/redes/syntax.h
diff options
context:
space:
mode:
authorÁkos Kőrösi <korakos99@gmail.com>2026-05-21 11:53:45 +0200
committerÁkos Kőrösi <korakos99@gmail.com>2026-05-21 11:53:45 +0200
commit0cf6fc7cc6581e8a01e2d475858fec7b352fe4d0 (patch)
tree5f330dda5666b3edee8694f3e64493fb4fec4914 /redes/syntax.h
parentfdaf99196bc9c69d26a7ed5b7431528b4a0bd053 (diff)
redesign token types, pipes don't work now
Diffstat (limited to 'redes/syntax.h')
-rw-r--r--redes/syntax.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/redes/syntax.h b/redes/syntax.h
index c40a3da..0cdb76c 100644
--- a/redes/syntax.h
+++ b/redes/syntax.h
@@ -69,18 +69,32 @@ DECLARE_VEC(Chunk, Word)
typedef enum {
TOK_WORD,
TOK_SPEC,
- TOK_SUB_IN,
- TOK_SUB_OUT,
} TokenKind;
typedef enum {
- SPEC_PIPE,
- SPEC_REDIR_W_TRUNC,
- SPEC_REDIR_W_APPEND,
- SPEC_REDIR_R,
- SPEC_EOL,
+ OP_PIPE,
+ OP_REDIR_W_TRUNC,
+ OP_REDIR_W_APPEND,
+ OP_REDIR_R,
+ OP_EOL,
+} OperatorToken;
+
+
+typedef enum {
+ SPEC_OP,
+ SPEC_SUB_IN,
+ SPEC_SUB_OUT,
+} SpecialTokenKind;
+
+typedef struct {
+ SpecialTokenKind kind;
+ union {
+ OperatorToken op;
+ void* proc_sub_region;
+ } as;
} SpecialToken;
+
typedef struct Token Token;
DECLARE_VEC(Token*, TokenPtrVec)
@@ -89,7 +103,6 @@ struct Token {
union {
Word word;
SpecialToken spec;
- void* procsub_token_vec;
} as;
};