From 484898d4efdab6d8cff3a887601d5a612034ce0f Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Sat, 17 Jun 2023 23:13:23 -0700 Subject: separated switch case into functions, added negation intro rule --- src/operetta.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/operetta.c') diff --git a/src/operetta.c b/src/operetta.c index 9b7fea3..ae9a418 100644 --- a/src/operetta.c +++ b/src/operetta.c @@ -32,7 +32,19 @@ int main(int argc, char** argv) { snprintf(s, 100, "%d. %s BECAUSE: %s <%s>", i + 1, propString, justString, isValid ? "SOUND" : "UNSOUND"); free(propString); free(justString); - consoleLines[i] = init_simple_consoleline(CWHITE, s); + int indent = lines.lines[i].scope.depth; + if (indent > 0) { + char* si = malloc(sizeof(char) * (indent + strlen(s) + 1)); + for (int j = 0; j < indent; j++) { + si[j] = ' '; + } + si[indent] = '\0'; + strcat(si, s); + consoleLines[i] = init_simple_consoleline(CWHITE, si); + } + else { + consoleLines[i] = init_simple_consoleline(CWHITE, s); + } } set_cache(init_consolelineset(consoleLines, lines.count)); /* enter main loop */ -- cgit v1.3.1