Plumbing for index and dot notations is working

This commit is contained in:
2022-09-05 17:43:42 +01:00
parent 82c03ecb33
commit 304e1a5fb0
14 changed files with 708 additions and 29 deletions

View File

@@ -30,6 +30,8 @@ typedef enum NodeType {
NODE_INCREMENT_POSTFIX,
NODE_IMPORT,
NODE_EXPORT,
NODE_INDEX,
NODE_DOT,
} NodeType;
typedef struct NodeLiteral {
@@ -124,6 +126,13 @@ typedef struct NodeImport {
Literal alias;
} NodeImport;
typedef struct NodeIndex {
NodeType type;
Node* first;
Node* second;
Node* third;
} NodeIndex;
union _node {
NodeType type;
NodeLiteral atomic;
@@ -140,6 +149,7 @@ union _node {
NodePath path;
NodeIncrement increment;
NodeImport import;
NodeIndex index;
};
void freeNode(Node* node);
@@ -157,4 +167,6 @@ void emitNodeFnCollection(Node** nodeHandle);
void emitNodePath(Node** nodeHandle, NodeType type, Node* preClause, Node* postClause, Node* condition, Node* thenPath, Node* elsePath);
void emitNodePrefixIncrement(Node** nodeHandle, Literal identifier, int increment);
void emitNodePostfixIncrement(Node** nodeHandle, Literal identifier, int increment);
void emitNodeImport(Node** nodeHandle, NodeType mode, Literal identifier, Literal alias);
void emitNodeImport(Node** nodeHandle, NodeType mode, Literal identifier, Literal alias);
void emitNodeIndex(Node** nodeHandle, Node* first, Node* second, Node* third);
void emitNodeDot(Node** nodeHandle, Node* first);