disallow single-item pointer indexing

add pointer arithmetic for unknown length pointer
This commit is contained in:
Andrew Kelley
2018-06-04 01:09:15 -04:00
parent 4c273126df
commit 96164ce613
35 changed files with 584 additions and 443 deletions

View File

@@ -1225,6 +1225,7 @@ static AstNode *ast_parse_prefix_op_expr(ParseContext *pc, size_t *token_index,
AstNode *child_node = ast_parse_pointer_type(pc, token_index, token);
child_node->column += 1;
AstNode *parent_node = ast_create_node(pc, NodeTypePointerType, token);
parent_node->data.pointer_type.star_token = token;
parent_node->data.pointer_type.op_expr = child_node;
return parent_node;
}