for loop: add ability to get pointer to elem var

see #51
This commit is contained in:
Andrew Kelley
2016-04-20 11:58:01 -07:00
parent a25307c0a1
commit 6acc354957
7 changed files with 46 additions and 6 deletions

View File

@@ -812,6 +812,10 @@ static bool eval_for_expr(EvalFn *ef, AstNode *node, ConstExprValue *out_val) {
assert(elem_node->type == NodeTypeSymbol);
Buf *elem_var_name = &elem_node->data.symbol_expr.symbol;
if (node->data.for_expr.elem_is_ptr) {
zig_panic("TODO");
}
Buf *index_var_name = nullptr;
if (index_node) {
assert(index_node->type == NodeTypeSymbol);