parser generator supports a simple OR

This commit is contained in:
Andrew Kelley
2015-11-07 04:50:48 -07:00
parent ae0e9685c6
commit 4236b85c72
5 changed files with 213 additions and 74 deletions

View File

@@ -82,3 +82,9 @@ void ast_print(AstNode *node, int indent) {
AstNode *ast_create_root(Token *token) {
return nullptr;
}
void ast_invalid_token_error(Buf *buf, Token *token) {
Buf token_value = {0};
buf_init_from_mem(&token_value, buf_ptr(buf) + token->start_pos, token->end_pos - token->start_pos);
ast_error(token, "invalid token: '%s'", buf_ptr(&token_value));
}