From 94c26f456f095ec8334d9c313943c2747d27c0c2 Mon Sep 17 00:00:00 2001 From: koekeishiya Date: Sat, 7 Oct 2017 23:31:15 +0200 Subject: #15 modal support --- src/parse.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/parse.h') 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 +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 -- cgit v1.2.3