aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-01-14 08:40:26 +0100
committerdec05eba <dec05eba@protonmail.com>2020-01-14 08:40:26 +0100
commit44b41bcab276f85c96bce88609865ffa4232f7e2 (patch)
tree224a20e53b65c2226c54d1b4ed2ee894c2bc9b63 /include
parentf5fc07765303055922e1dfcc35f2f2f620c1e66b (diff)
add parsing of rhs and map
Diffstat (limited to 'include')
-rw-r--r--include/parser.h1
-rw-r--r--include/tokenizer.h6
2 files changed, 6 insertions, 1 deletions
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;