parser nodes and stuff

This commit is contained in:
SimonFJ20 2023-02-18 02:39:48 +01:00
parent b71c2e5afb
commit 37748b89e9

View File

@ -20,8 +20,6 @@ typedef enum {
ParsedNodeTypeWhile,
ParsedNodeTypeLoop,
ParsedNodeTypeFor,
ParsedNodeTypeLambda,
ParsedNodeTypeCall,
ParsedNodeTypeAccess,
ParsedNodeTypeIndex,
@ -30,6 +28,14 @@ typedef enum {
ParsedNodeTypeAssign,
} ParsedNodeType;
typedef enum {
Add,
} ParsedBinaryType;
typedef enum {
Negate,
} ParsedUnaryType;
typedef struct KeyValuePair KeyValuePair;
typedef struct ParsedNode ParsedNode;
@ -57,6 +63,31 @@ struct ParsedNode {
ParsedNode* truthy;
ParsedNode* falsy;
} if_node;
struct {
ParsedNode* condition;
ParsedNode* body;
} while_node;
struct {
ParsedNode* body;
} loop;
struct {
ParsedNode* subject;
ParsedNode* value;
ParsedNode* body;
} for_node;
struct {
ParsedNode* subject;
ParsedNode* arguments;
size_t arguments_length;
} call;
struct {
ParsedNode* subject;
ParsedNode* value;
} access;
struct {
ParsedNode* subject;
ParsedNode* value;
} index;
};
};