mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Import and export are working
This commit is contained in:
@@ -93,6 +93,12 @@ void freeNodeCustom(Node* node, bool freeSelf) {
|
||||
case NODE_INCREMENT_POSTFIX:
|
||||
freeLiteral(node->increment.identifier);
|
||||
break;
|
||||
|
||||
case NODE_IMPORT:
|
||||
case NODE_EXPORT:
|
||||
freeLiteral(node->import.identifier);
|
||||
freeLiteral(node->import.alias);
|
||||
break;
|
||||
}
|
||||
|
||||
if (freeSelf) {
|
||||
@@ -246,3 +252,13 @@ void emitNodePostfixIncrement(Node** nodeHandle, Literal identifier, int increme
|
||||
|
||||
*nodeHandle = tmp;
|
||||
}
|
||||
|
||||
void emitNodeImport(Node** nodeHandle, NodeType mode, Literal identifier, Literal alias) {
|
||||
Node* tmp = ALLOCATE(Node, 1);
|
||||
|
||||
tmp->type = mode;
|
||||
tmp->import.identifier = copyLiteral(identifier);
|
||||
tmp->import.alias = copyLiteral(alias);
|
||||
|
||||
*nodeHandle = tmp;
|
||||
}
|
||||
Reference in New Issue
Block a user