diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2023-06-12 03:19:31 -0700 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2023-06-12 03:19:31 -0700 |
| commit | 88a8012eeb81be74a6bcaccfc514fd134a85c71a (patch) | |
| tree | 5f0cfdc75f058588f69ae9af1d87f8f9e8f15748 /parse.c | |
| parent | 43bfe5935b3f1d38775c3bc65262aca5683c0fb5 (diff) | |
added some comments, added a license and a readme
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -50,6 +50,7 @@ line_t parse_line(char* content) { } prop_t parse_proposition(tokenSet_t tokenSet, int* seek) { prop_t prop; + /* recurse to parse the parenthetical as its own proposition */ if (tokenSet.tokens[*seek].type == OPEN_PAREN) { (*seek)++; prop = parse_proposition(tokenSet, seek); @@ -63,6 +64,7 @@ prop_t parse_proposition(tokenSet_t tokenSet, int* seek) { return prop; } else { + /* the proposition we just read had a relation, so find the related proposition */ tokenType_t rel = tokenSet.tokens[*seek].type; (*seek)++; prop_t* prop1p = malloc(sizeof(prop_t)); @@ -80,6 +82,7 @@ just_t parse_justification(tokenSet_t tokenSet) { } justRule_t just; int* references = malloc(sizeof(int) * (tokenSet.count - 2)); + /* check the relation, then use a ternary operator for elim/intro */ switch (tokenSet.tokens[0].type) { case CONJUNCTION: just = tokenSet.tokens[1].type == ELIMINATION ? CONJUNCT_ELIM : CONJUNCT_INTRO; |
