parser nodes and stuff
This commit is contained in:
parent
b71c2e5afb
commit
37748b89e9
35
parser.h
35
parser.h
@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user