diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2023-06-17 23:13:23 -0700 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2023-06-17 23:13:23 -0700 |
| commit | 484898d4efdab6d8cff3a887601d5a612034ce0f (patch) | |
| tree | 6a87555ec863ee7e056972c7cd4eb9f502faf930 /src/operetta.c | |
| parent | a9a6750e2b97708c6d324d9c3cf2f5422cfe853e (diff) | |
separated switch case into functions, added negation intro rule
Diffstat (limited to 'src/operetta.c')
| -rw-r--r-- | src/operetta.c | 14 |
1 files changed, 13 insertions, 1 deletions
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 */ |
