pwetty/main.c
Daniel Svitan 74e99cf19a 🎉 Initial commit
2025-05-05 21:27:02 +02:00

25 lines
418 B
C

#include <stdio.h>
#include <unistd.h>
#include <stdbool.h>
int main() {
int scope = 0;
bool in_string = false;
bool escape_next = false;
char c;
while (read(STDIN_FILENO, &c, 1) > 0) {
putchar(c);
if (c == '{' || c == '[') {
scope++;
putchar('\n');
}
else if (c == '}' || c == ']') {
scope--;
}
}
return 0;
}