Add utility function to check if token is an operator.

This commit is contained in:
Danila Fedorin 2018-02-15 23:11:25 -08:00
parent ee19f55058
commit e11f56ee68

View File

@ -71,6 +71,11 @@ libab_result _parser_extract_token(struct parser_state* state, char** into, liba
return result; return result;
} }
int _parser_match_is_op(libab_lexer_match* match) {
return match->type == TOKEN_OP_INFIX ||
match->type == TOKEN_OP_PREFIX ||
match->type == TOKEN_OP_POSTFIX;
}
libab_result _parse_expression(struct parser_state* state, libab_tree** store_into) { libab_result _parse_expression(struct parser_state* state, libab_tree** store_into) {
libab_result result = LIBAB_SUCCESS; libab_result result = LIBAB_SUCCESS;
return result; return result;