aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.y
diff options
context:
space:
mode:
Diffstat (limited to 'awkgram.y')
-rw-r--r--awkgram.y11
1 files changed, 11 insertions, 0 deletions
diff --git a/awkgram.y b/awkgram.y
index 3048cc80..cee18459 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1857,6 +1857,7 @@ static const struct token tokentab[] = {
{"eval", Op_symbol, LEX_EVAL, 0, 0, 0},
{"exit", Op_K_exit, LEX_EXIT, 0, 0, 0},
{"exp", Op_builtin, LEX_BUILTIN, A(1), do_exp, MPF(exp)},
+{"extension", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_ext, 0},
{"fflush", Op_builtin, LEX_BUILTIN, A(0)|A(1), do_fflush, 0},
{"for", Op_K_for, LEX_FOR, BREAK|CONTINUE, 0, 0},
{"func", Op_func, LEX_FUNCTION, NOT_POSIX|NOT_OLD, 0, 0},
@@ -3801,7 +3802,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 {
@@ -5007,6 +5012,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;
@@ -5216,7 +5223,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);