add operations

This commit is contained in:
2025-06-10 04:41:06 +01:00
parent 1b90438bb9
commit 86c0eabfde
18 changed files with 207 additions and 68 deletions

View File

@@ -5,6 +5,23 @@
#include <stdbool.h>
#include <stddef.h>
#define SWITCH_OPERATIONS case TOKEN_AND:\
case TOKEN_OR:\
case TOKEN_NOT_IN:\
case TOKEN_LE:\
case TOKEN_GE:\
case TOKEN_LT:\
case TOKEN_GT:\
case TOKEN_NE:\
case TOKEN_EQ:\
case TOKEN_PLUS:\
case TOKEN_MINUS:\
case TOKEN_MODULO:\
case TOKEN_STAR:\
case TOKEN_FLOORDIV:\
case TOKEN_SLASH:\
case TOKEN_CARET:
typedef struct LinkedList LinkedList;
typedef enum {
@@ -18,7 +35,8 @@ typedef enum {
AST_DECLARATION,
AST_NULL,
AST_BOOLEAN,
AST_DOWRAP
AST_DOWRAP,
AST_OPERATION
} ValueType;
extern const char* ValueTypeNames[];
@@ -30,8 +48,11 @@ typedef struct {
void parser(char *file, DArray *parsed, DArray *tokens, bool inline_flag);
ParsedValue *parse_token(char *file, DArray *tokens,
size_t *index, bool inline_flag);
ParsedValue *parse_token_full(char *file, DArray *tokens, size_t *index,
bool inline_flag, bool process_operations);
ParsedValue *parse_token(char *file, DArray *tokens, size_t *index,
bool inline_flag);
void free_parsed(void *ptr);