|
@@ -25,6 +25,7 @@
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
#include <stdio.h>
|
|
|
#include <stdlib.h>
|
|
#include <stdlib.h>
|
|
|
|
|
+#include <ctype.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
#define panic(msg, ...) error(msg, ##__VA_ARGS__); exit(1)
|
|
#define panic(msg, ...) error(msg, ##__VA_ARGS__); exit(1)
|
|
@@ -68,9 +69,8 @@
|
|
|
fprintf(stderr, "\n")
|
|
fprintf(stderr, "\n")
|
|
|
|
|
|
|
|
|
|
|
|
|
-#define isspace(c) (((c) == '\n') || ((c) == '\t') || ((c) == ' '))
|
|
|
|
|
-#define isnr(c) ((c) >= '0' && (c) <= '9')
|
|
|
|
|
-#define ischr(c) (((c) >= 'A' && (c) <= 'Z') || ((c) >= 'a' && (c) <= 'z'))
|
|
|
|
|
|
|
+#define isnr isdigit
|
|
|
|
|
+#define ischr isalpha
|
|
|
#define _skip_spaces(s) while (isspace(*(s))) (s)++;
|
|
#define _skip_spaces(s) while (isspace(*(s))) (s)++;
|
|
|
#define skip_spaces() _skip_spaces(line_buffer);
|
|
#define skip_spaces() _skip_spaces(line_buffer);
|
|
|
#define _skip_word(s) while (!isspace(*(s))) (s)++; _skip_spaces(s)
|
|
#define _skip_word(s) while (!isspace(*(s))) (s)++; _skip_spaces(s)
|