diff options
author | koekeishiya <aasvi93@hotmail.com> | 2017-10-07 23:31:15 +0200 |
---|---|---|
committer | koekeishiya <aasvi93@hotmail.com> | 2017-10-07 23:31:15 +0200 |
commit | 94c26f456f095ec8334d9c313943c2747d27c0c2 (patch) | |
tree | 248a10b142f0a59192c931da57643b90ad3b9d4a /src/parse.h | |
parent | 679ae51b23bd936485e1c5c1e868e4dec4995e97 (diff) | |
download | skhd-94c26f456f095ec8334d9c313943c2747d27c0c2.tar.gz skhd-94c26f456f095ec8334d9c313943c2747d27c0c2.zip |
#15 modal support
Diffstat (limited to 'src/parse.h')
-rw-r--r-- | src/parse.h | 15 |
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 |