aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/parser.c
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-05-11 15:59:43 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-05-11 15:59:43 +0330
commitfe81eba1c232ab99bcfedf9546a82b06c796b086 (patch)
tree1ddf9d17f14a69c9cbe93cdbb1ef557f812c79d7 /src/compiler/parser.c
parent1a50974b834227190f7de3939db5689bb0702a34 (diff)
some clean ups
Diffstat (limited to 'src/compiler/parser.c')
-rw-r--r--src/compiler/parser.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/compiler/parser.c b/src/compiler/parser.c
index 7bb0f1d..388e69a 100644
--- a/src/compiler/parser.c
+++ b/src/compiler/parser.c
@@ -731,11 +731,10 @@ ParserNode *newParserNode(ParserToken token, char const *str_begin,
ParserNode *parserFromPath(const char *filePath
#ifdef PRINT_STATISTICS
,
- struct timespec *lexingTime
+ Time *lexingTime
#endif
) {
- struct timespec start, end;
- clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &start);
+ Time start = get_time();
char *code = readWholeFile(filePath);
if (code == NULL) {
return NULL;
@@ -745,7 +744,7 @@ ParserNode *parserFromPath(const char *filePath
if (lexerNodeArrayIsError(lexed)) {
return NULL;
}
- clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &end);
+ Time end = get_time();
*lexingTime = time_add(*lexingTime, time_diff(end, start));
ParserNode *root = parser(lexed);