diff options
author | john haque <j.eh@mchsi.com> | 2012-04-19 05:27:31 -0500 |
---|---|---|
committer | john haque <j.eh@mchsi.com> | 2012-04-19 05:27:31 -0500 |
commit | 87dc23679566c5ad96f4869de6aec39c2a4c3aa7 (patch) | |
tree | a4202078cb9b63fb69828cb9a7a54d969f53bd19 /awkgram.c | |
parent | c3033f11415c6323ad6b4503c220d20d68c841a3 (diff) | |
download | egawk-87dc23679566c5ad96f4869de6aec39c2a4c3aa7.tar.gz egawk-87dc23679566c5ad96f4869de6aec39c2a4c3aa7.tar.bz2 egawk-87dc23679566c5ad96f4869de6aec39c2a4c3aa7.zip |
Improve array interface.
Diffstat (limited to 'awkgram.c')
-rw-r--r-- | awkgram.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -6387,7 +6387,11 @@ snode(INSTRUCTION *subn, INSTRUCTION *r) subn->lasti->assign_ctxt = Op_sub_builtin; subn->lasti->field_assign = (Func_ptr) 0; ip->target_assign = subn->lasti; + } else if (ip->opcode == Op_subscript_lhs) { + (void) list_append(subn, instruction(Op_subscript_assign)); + subn->lasti->assign_ctxt = Op_sub_builtin; } + return subn; } else { @@ -7553,6 +7557,8 @@ mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op) (void) list_append(ip, instruction(Op_field_assign)); ip->lasti->field_assign = (Func_ptr) 0; tp->target_assign = ip->lasti; + } else if (tp->opcode == Op_subscript_lhs) { + (void) list_append(ip, instruction(Op_subscript_assign)); } return ip; @@ -7762,7 +7768,11 @@ mk_getline(INSTRUCTION *op, INSTRUCTION *var, INSTRUCTION *redir, int redirtype) asgn->assign_ctxt = op->opcode; asgn->field_assign = (Func_ptr) 0; /* determined at run time */ tp->target_assign = asgn; + } else if (tp->opcode == Op_subscript_lhs) { + asgn = instruction(Op_subscript_assign); + asgn->assign_ctxt = op->opcode; } + if (redir != NULL) { ip = list_merge(redir, var); (void) list_append(ip, op); |