aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/parser.c
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-06-06 03:19:06 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-06-06 03:19:06 +0330
commit6e86f7b9a3ca057640bcfaa4ea72872dcd8d3af4 (patch)
treef0a854b8f0860a2a29de95b943e563fb6a2671a3 /src/compiler/parser.c
parentc64d8217a598364fcb48ed965edc7a138f2f6750 (diff)
fix when you disable statistics
some more clean up
Diffstat (limited to 'src/compiler/parser.c')
-rw-r--r--src/compiler/parser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/parser.c b/src/compiler/parser.c
index d5906a5..a35800c 100644
--- a/src/compiler/parser.c
+++ b/src/compiler/parser.c
@@ -811,7 +811,9 @@ ParserNode *parserFromPath(const char *filePath
Time *lexingTime
#endif
) {
+#ifdef PRINT_STATISTICS
Time start = get_time();
+#endif
char *code = readWholeFile(filePath);
if (code == NULL) {
return NULL;
@@ -821,8 +823,10 @@ ParserNode *parserFromPath(const char *filePath
if (lexerNodeArrayIsError(lexed)) {
return NULL;
}
+#ifdef PRINT_STATISTICS
Time end = get_time();
*lexingTime = time_add(*lexingTime, time_diff(end, start));
+#endif
ParserNode *root = parser(lexed);
lexerNodeArrayDestroy(lexed);