From 44b41bcab276f85c96bce88609865ffa4232f7e2 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 14 Jan 2020 08:40:26 +0100 Subject: add parsing of rhs and map --- include/parser.h | 1 + include/tokenizer.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/parser.h b/include/parser.h index 3523127..d130597 100644 --- a/include/parser.h +++ b/include/parser.h @@ -3,6 +3,7 @@ #include "tokenizer.h" +/* Returns 0 on success */ int tsl_parse(const char *code, size_t code_size); #endif /* TSL_PARSER_H */ diff --git a/include/tokenizer.h b/include/tokenizer.h index a1d0932..8b511ed 100644 --- a/include/tokenizer.h +++ b/include/tokenizer.h @@ -13,10 +13,13 @@ typedef enum { TSL_TOKEN_END_OF_FILE, TSL_TOKEN_UNEXPECTED_SYMBOL, TSL_TOKEN_IDENTIFIER, + TSL_TOKEN_STRING, TSL_TOKEN_NUM, TSL_TOKEN_BOOL, TSL_TOKEN_NULL, - TSL_TOKEN_EQUAL + TSL_TOKEN_EQUAL, + TSL_TOKEN_LBRACE, + TSL_TOKEN_RBRACE } TslToken; typedef struct { @@ -25,6 +28,7 @@ typedef struct { size_t code_index; TslStringView identifier; + TslStringView string; int bool_value; int64_t number_value; } TslTokenizer; -- cgit v1.2.3