aboutsummaryrefslogtreecommitdiff
path: root/src/parse.h
diff options
context:
space:
mode:
authorkoekeishiya <aasvi93@hotmail.com>2017-10-07 23:31:15 +0200
committerkoekeishiya <aasvi93@hotmail.com>2017-10-07 23:31:15 +0200
commit94c26f456f095ec8334d9c313943c2747d27c0c2 (patch)
tree248a10b142f0a59192c931da57643b90ad3b9d4a /src/parse.h
parent679ae51b23bd936485e1c5c1e868e4dec4995e97 (diff)
downloadskhd-94c26f456f095ec8334d9c313943c2747d27c0c2.tar.gz
skhd-94c26f456f095ec8334d9c313943c2747d27c0c2.zip
#15 modal support
Diffstat (limited to 'src/parse.h')
-rw-r--r--src/parse.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/parse.h b/src/parse.h
index 241e7ff..1c7719d 100644
--- a/src/parse.h
+++ b/src/parse.h
@@ -4,16 +4,25 @@
#include "tokenize.h"
#include <stdbool.h>
+struct table;
struct parser
{
struct token previous_token;
struct token current_token;
struct tokenizer tokenizer;
+ struct table *mode_map;
bool error;
};
-struct table;
-void parse_config(struct parser *parser, struct table *hotkey_map);
+enum parse_error_type
+{
+ Error_Unexpected_Token,
+ Error_Undeclared_Ident,
+ Error_Duplicate_Ident,
+};
+
+
+void parse_config(struct parser *parser);
struct token parser_peek(struct parser *parser);
struct token parser_previous(struct parser *parser);
@@ -23,6 +32,6 @@ bool parser_check(struct parser *parser, enum token_type type);
bool parser_match(struct parser *parser, enum token_type type);
bool parser_init(struct parser *parser, char *file);
void parser_destroy(struct parser *parser);
-void parser_report_error(struct parser *parser, const char *format, ...);
+void parser_report_error(struct parser *parser, enum parse_error_type error_type, const char *format, ...);
#endif