Type Tagging #1

Merged
cosmonaut merged 15 commits from venko/wraith-lang:identifiers into main 2021-05-14 18:54:11 +00:00

Implements identifier lookup, and type tagging of Identifier nodes in the AST. Does not perform type checking or identifier validation.

Areas of future work:

  • Move type-tagging and ID lookup logic into AST itself rather than relying on IdNode trees.
  • Implement type checking
  • Implement identifier checking
Implements identifier lookup, and type tagging of Identifier nodes in the AST. Does not perform type checking or identifier validation. Areas of future work: * Move type-tagging and ID lookup logic into AST itself rather than relying on `IdNode` trees. * Implement type checking * Implement identifier checking
venko added 14 commits 2021-05-14 17:29:51 +00:00
cosmonaut requested changes 2021-05-14 18:35:22 +00:00
src/identcheck.c Outdated
@ -0,0 +280,4 @@
// This has the notable side-effect that this function will return NULL if you attempt to look
// up a struct's internals starting from the node representing the struct itself. This is
// because an IdNode corresponds to the location *where an identifier is first declared.* Thus,
// an identifier has no knowledge of identifiers declared "inside" of it.

Use /* */ for comments please, // is technically not valid C99

Use /* */ for comments please, // is technically not valid C99
src/identcheck.c Outdated
@ -0,0 +287,4 @@
uint32_t idxLimit;
// If the current node forms an ordered scope then we want to prevent ourselves from looking
// up identifiers declared after the scope we have just come from.

Same here

Same here
@ -0,0 +42,4 @@
IdNode* LookdownId(IdNode *root, NodeType targetType, char *targetName);
IdNode* LookupId(IdNode *node, IdNode *prev, char* target);
//IdStatus CheckIds(Node *root);

Unused code

Unused code
cosmonaut added 1 commit 2021-05-14 18:53:14 +00:00
cosmonaut merged commit 41bf2bece8 into main 2021-05-14 18:54:11 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cosmonaut/wraith-lang#1
There is no content yet.