🎉 Initial commit
This commit is contained in:
24
main.c
Normal file
24
main.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#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;
|
||||
}
|
Reference in New Issue
Block a user