treesummaryrefslogcommitdiff
path: root/main2.c
diff options
context:
space:
mode:
Diffstat (limited to 'main2.c')
-rw-r--r--main2.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/main2.c b/main2.c
index 5ea32ef..104c2a4 100644
--- a/main2.c
+++ b/main2.c
@@ -14,7 +14,7 @@
#define NEWARR(TYPE, NUM) ((TYPE *)calloc(NUM, sizeof(TYPE)))
-// getch()
+// getch
#ifdef _WIN32
#include <windows.h>
@@ -279,8 +279,8 @@ GetChar() {
int
PeekChar() {
- int c = GetChar();
- ungetch(c);
+ Draw();
+ int c = peekch();
return c;
}
@@ -354,20 +354,20 @@ GetNode(JSONNode * parent) {
}
case 'o': {
result->kind = JSONNodeKind_Obj;
- while ((c = peekch()), (c != '\r') && (c != '\n')) {
+ while ((c = PeekChar()), (c != '\r') && (c != '\n')) {
JSONNodePush(result, JSONNodeNewStr(GetStr()));
JSONNodePush(result, GetNode(result));
}
- getch();
+ GetChar();
break;
}
case 'a': {
result->kind = JSONNodeKind_Arr;
- while ((c = peekch()), (c != '\r') && (c != '\n')) {
+ while ((c = PeekChar()), (c != '\r') && (c != '\n')) {
JSONNodePush(result, GetNode(result));
}
- getch();
+ GetChar();
break;
}
case 8: