From 7d9917d5269661e21cdff29a76ad5164dedd0460 Mon Sep 17 00:00:00 2001 From: nishi Date: Wed, 22 May 2024 05:42:14 +0000 Subject: [PATCH] gonna make parser work later git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@73 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- Client/main.c | 4 ++++ Library/parser.c | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Client/main.c b/Client/main.c index f000433..ff54203 100644 --- a/Client/main.c +++ b/Client/main.c @@ -181,6 +181,10 @@ int main(int argc, char** argv) { }else if(strlen(buf) > 0){ struct __dw_token* token = __dw_parser_parse(buf); if(token != NULL){ + if(token->error){ + printf("%s\n", dataworks_database_strerror(token->errnum)); + }else{ + } }else{ printf("Parser returned NULL. Help!\n"); } diff --git a/Library/parser.c b/Library/parser.c index 162c66c..489fbac 100644 --- a/Library/parser.c +++ b/Library/parser.c @@ -28,8 +28,16 @@ #include "dw_parser.h" +#include "dw_database.h" + #include +#include +#include struct __dw_token* __dw_parser_parse(const char* str){ - return NULL; + struct __dw_token* token = malloc(sizeof(*token)); + token->error = false; + token->errnum = DW_ERR_SUCCESS; + token->token = NULL; + return token; } -- 2.43.0