summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse.c b/parse.c
index d7ec467..d26cfe8 100644
--- a/parse.c
+++ b/parse.c
@@ -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;