[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, async-events, created. gawk-4.1.0-361-g8
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, async-events, created. gawk-4.1.0-361-g8e303ac |
Date: |
Tue, 08 Apr 2014 19:06:11 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, async-events has been created
at 8e303acf253ef740abd08c1fe44faf1d7a72c9f7 (commit)
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=8e303acf253ef740abd08c1fe44faf1d7a72c9f7
commit 8e303acf253ef740abd08c1fe44faf1d7a72c9f7
Merge: 612b31c 0b8ef4f
Author: Arnold D. Robbins <address@hidden>
Date: Thu Feb 20 20:33:33 2014 +0200
Merge branch 'master' into async-events
diff --cc awkgram.c
index 98333f3,948e63b..ef3cde6
--- a/awkgram.c
+++ b/awkgram.c
@@@ -2376,55 -2172,53 +2172,54 @@@ yyreduce
break;
case 38:
- /* Line 1787 of yacc.c */
- #line 448 "awkgram.y"
+ #line 448 "awkgram.y" /* yacc.c:1646 */
{
- if ((yyvsp[(2) - (2)]) == NULL)
- (yyval) = (yyvsp[(1) - (2)]);
+ if ((yyvsp[0]) == NULL)
+ (yyval) = (yyvsp[-1]);
else {
- add_lint((yyvsp[(2) - (2)]), LINT_no_effect);
- if ((yyvsp[(1) - (2)]) == NULL)
- (yyval) = (yyvsp[(2) - (2)]);
+ add_lint((yyvsp[0]), LINT_no_effect);
+ if ((yyvsp[-1]) == NULL)
+ (yyval) = (yyvsp[0]);
else
- (yyval) = list_merge((yyvsp[(1) - (2)]),
(yyvsp[(2) - (2)]));
+ (yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
+ list_append((yyval), instruction(Op_end_stmt));
yyerrok;
}
-#line 2189 "awkgram.c" /* yacc.c:1646 */
++#line 2190 "awkgram.c" /* yacc.c:1646 */
break;
case 39:
- /* Line 1787 of yacc.c */
- #line 462 "awkgram.y"
-#line 461 "awkgram.y" /* yacc.c:1646 */
++#line 462 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2195 "awkgram.c" /* yacc.c:1646 */
++#line 2196 "awkgram.c" /* yacc.c:1646 */
break;
case 42:
- /* Line 1787 of yacc.c */
- #line 472 "awkgram.y"
-#line 471 "awkgram.y" /* yacc.c:1646 */
++#line 472 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2201 "awkgram.c" /* yacc.c:1646 */
++#line 2202 "awkgram.c" /* yacc.c:1646 */
break;
case 43:
- /* Line 1787 of yacc.c */
- #line 474 "awkgram.y"
- { (yyval) = (yyvsp[(2) - (3)]); }
-#line 473 "awkgram.y" /* yacc.c:1646 */
++#line 474 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[-1]); }
-#line 2207 "awkgram.c" /* yacc.c:1646 */
++#line 2208 "awkgram.c" /* yacc.c:1646 */
break;
case 44:
- /* Line 1787 of yacc.c */
- #line 476 "awkgram.y"
-#line 475 "awkgram.y" /* yacc.c:1646 */
++#line 476 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
- (yyval) = list_prepend((yyvsp[(1) - (1)]),
instruction(Op_exec_count));
+ (yyval) = list_prepend((yyvsp[0]),
instruction(Op_exec_count));
else
- (yyval) = (yyvsp[(1) - (1)]);
+ (yyval) = (yyvsp[0]);
}
-#line 2218 "awkgram.c" /* yacc.c:1646 */
++#line 2219 "awkgram.c" /* yacc.c:1646 */
break;
case 45:
- /* Line 1787 of yacc.c */
- #line 483 "awkgram.y"
-#line 482 "awkgram.y" /* yacc.c:1646 */
++#line 483 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@@ -2514,11 -2308,11 +2309,11 @@@
break_allowed--;
fix_break_continue(ip, tbreak, NULL);
}
-#line 2312 "awkgram.c" /* yacc.c:1646 */
++#line 2313 "awkgram.c" /* yacc.c:1646 */
break;
case 46:
- /* Line 1787 of yacc.c */
- #line 573 "awkgram.y"
-#line 572 "awkgram.y" /* yacc.c:1646 */
++#line 573 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@@ -2560,11 -2354,11 +2355,11 @@@
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
}
-#line 2358 "awkgram.c" /* yacc.c:1646 */
++#line 2359 "awkgram.c" /* yacc.c:1646 */
break;
case 47:
- /* Line 1787 of yacc.c */
- #line 615 "awkgram.y"
-#line 614 "awkgram.y" /* yacc.c:1646 */
++#line 615 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@@ -2606,21 -2400,21 +2401,21 @@@
} /* else
$1 and $4 are NULLs */
}
-#line 2404 "awkgram.c" /* yacc.c:1646 */
++#line 2405 "awkgram.c" /* yacc.c:1646 */
break;
case 48:
- /* Line 1787 of yacc.c */
- #line 657 "awkgram.y"
-#line 656 "awkgram.y" /* yacc.c:1646 */
++#line 657 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip;
- char *var_name = (yyvsp[(3) - (8)])->lextok;
-
- if ((yyvsp[(8) - (8)]) != NULL
- && (yyvsp[(8) - (8)])->lasti->opcode ==
Op_K_delete
- && (yyvsp[(8) - (8)])->lasti->expr_count == 1
- && (yyvsp[(8) - (8)])->nexti->opcode == Op_push
- && ((yyvsp[(8) - (8)])->nexti->memory->type !=
Node_var || !((yyvsp[(8) - (8)])->nexti->memory->var_update))
- && strcmp((yyvsp[(8) -
(8)])->nexti->memory->vname, var_name) == 0
+ char *var_name = (yyvsp[-5])->lextok;
+
+ if ((yyvsp[0]) != NULL
+ && (yyvsp[0])->lasti->opcode == Op_K_delete
+ && (yyvsp[0])->lasti->expr_count == 1
+ && (yyvsp[0])->nexti->opcode == Op_push
+ && ((yyvsp[0])->nexti->memory->type != Node_var
|| !((yyvsp[0])->nexti->memory->var_update))
+ && strcmp((yyvsp[0])->nexti->memory->vname,
var_name) == 0
) {
/* Efficiency hack. Recognize the special case of
@@@ -2723,98 -2517,98 +2518,98 @@@ regular_loop
break_allowed--;
continue_allowed--;
}
-#line 2521 "awkgram.c" /* yacc.c:1646 */
++#line 2522 "awkgram.c" /* yacc.c:1646 */
break;
case 49:
- /* Line 1787 of yacc.c */
- #line 770 "awkgram.y"
-#line 769 "awkgram.y" /* yacc.c:1646 */
++#line 770 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = mk_for_loop((yyvsp[(1) - (12)]), (yyvsp[(3) - (12)]),
(yyvsp[(6) - (12)]), (yyvsp[(9) - (12)]), (yyvsp[(12) - (12)]));
+ (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]),
(yyvsp[-3]), (yyvsp[0]));
break_allowed--;
continue_allowed--;
}
-#line 2532 "awkgram.c" /* yacc.c:1646 */
++#line 2533 "awkgram.c" /* yacc.c:1646 */
break;
case 50:
- /* Line 1787 of yacc.c */
- #line 777 "awkgram.y"
-#line 776 "awkgram.y" /* yacc.c:1646 */
++#line 777 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = mk_for_loop((yyvsp[(1) - (11)]), (yyvsp[(3) - (11)]),
(INSTRUCTION *) NULL, (yyvsp[(8) - (11)]), (yyvsp[(11) - (11)]));
+ (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION
*) NULL, (yyvsp[-3]), (yyvsp[0]));
break_allowed--;
continue_allowed--;
}
-#line 2543 "awkgram.c" /* yacc.c:1646 */
++#line 2544 "awkgram.c" /* yacc.c:1646 */
break;
case 51:
- /* Line 1787 of yacc.c */
- #line 784 "awkgram.y"
-#line 783 "awkgram.y" /* yacc.c:1646 */
++#line 784 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
- (yyval) = list_prepend((yyvsp[(1) - (1)]),
instruction(Op_exec_count));
+ (yyval) = list_prepend((yyvsp[0]),
instruction(Op_exec_count));
else
- (yyval) = (yyvsp[(1) - (1)]);
+ (yyval) = (yyvsp[0]);
}
-#line 2554 "awkgram.c" /* yacc.c:1646 */
++#line 2555 "awkgram.c" /* yacc.c:1646 */
break;
case 52:
- /* Line 1787 of yacc.c */
- #line 794 "awkgram.y"
-#line 793 "awkgram.y" /* yacc.c:1646 */
++#line 794 "awkgram.y" /* yacc.c:1646 */
{
if (! break_allowed)
- error_ln((yyvsp[(1) - (2)])->source_line,
+ error_ln((yyvsp[-1])->source_line,
_("`break' is not allowed outside a loop or
switch"));
- (yyvsp[(1) - (2)])->target_jmp = NULL;
- (yyval) = list_create((yyvsp[(1) - (2)]));
+ (yyvsp[-1])->target_jmp = NULL;
+ (yyval) = list_create((yyvsp[-1]));
}
-#line 2567 "awkgram.c" /* yacc.c:1646 */
++#line 2568 "awkgram.c" /* yacc.c:1646 */
break;
case 53:
- /* Line 1787 of yacc.c */
- #line 803 "awkgram.y"
-#line 802 "awkgram.y" /* yacc.c:1646 */
++#line 803 "awkgram.y" /* yacc.c:1646 */
{
if (! continue_allowed)
- error_ln((yyvsp[(1) - (2)])->source_line,
+ error_ln((yyvsp[-1])->source_line,
_("`continue' is not allowed outside a loop"));
- (yyvsp[(1) - (2)])->target_jmp = NULL;
- (yyval) = list_create((yyvsp[(1) - (2)]));
+ (yyvsp[-1])->target_jmp = NULL;
+ (yyval) = list_create((yyvsp[-1]));
}
-#line 2580 "awkgram.c" /* yacc.c:1646 */
++#line 2581 "awkgram.c" /* yacc.c:1646 */
break;
case 54:
- /* Line 1787 of yacc.c */
- #line 812 "awkgram.y"
-#line 811 "awkgram.y" /* yacc.c:1646 */
++#line 812 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
- error_ln((yyvsp[(1) - (2)])->source_line,
+ error_ln((yyvsp[-1])->source_line,
_("`next' used in %s action"), ruletab[rule]);
- (yyvsp[(1) - (2)])->target_jmp = ip_rec;
- (yyval) = list_create((yyvsp[(1) - (2)]));
+ (yyvsp[-1])->target_jmp = ip_rec;
+ (yyval) = list_create((yyvsp[-1]));
}
-#line 2593 "awkgram.c" /* yacc.c:1646 */
++#line 2594 "awkgram.c" /* yacc.c:1646 */
break;
case 55:
- /* Line 1787 of yacc.c */
- #line 821 "awkgram.y"
-#line 820 "awkgram.y" /* yacc.c:1646 */
++#line 821 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule == BEGIN || rule == END || rule == ENDFILE)
- error_ln((yyvsp[(1) - (2)])->source_line,
+ error_ln((yyvsp[-1])->source_line,
_("`nextfile' used in %s action"),
ruletab[rule]);
- (yyvsp[(1) - (2)])->target_newfile = ip_newfile;
- (yyvsp[(1) - (2)])->target_endfile = ip_endfile;
- (yyval) = list_create((yyvsp[(1) - (2)]));
+ (yyvsp[-1])->target_newfile = ip_newfile;
+ (yyvsp[-1])->target_endfile = ip_endfile;
+ (yyval) = list_create((yyvsp[-1]));
}
-#line 2608 "awkgram.c" /* yacc.c:1646 */
++#line 2609 "awkgram.c" /* yacc.c:1646 */
break;
case 56:
- /* Line 1787 of yacc.c */
- #line 832 "awkgram.y"
-#line 831 "awkgram.y" /* yacc.c:1646 */
++#line 832 "awkgram.y" /* yacc.c:1646 */
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@@ -2827,25 -2621,25 +2622,25 @@@
(void) list_prepend((yyval), instruction(Op_push_i));
(yyval)->nexti->memory = dupnode(Nnull_string);
} else
- (yyval) = list_append((yyvsp[(2) - (3)]), (yyvsp[(1) -
(3)]));
+ (yyval) = list_append((yyvsp[-1]), (yyvsp[-2]));
}
-#line 2627 "awkgram.c" /* yacc.c:1646 */
++#line 2628 "awkgram.c" /* yacc.c:1646 */
break;
case 57:
- /* Line 1787 of yacc.c */
- #line 847 "awkgram.y"
-#line 846 "awkgram.y" /* yacc.c:1646 */
++#line 847 "awkgram.y" /* yacc.c:1646 */
{
if (! in_function)
yyerror(_("`return' used outside function context"));
}
-#line 2636 "awkgram.c" /* yacc.c:1646 */
++#line 2637 "awkgram.c" /* yacc.c:1646 */
break;
case 58:
- /* Line 1787 of yacc.c */
- #line 850 "awkgram.y"
-#line 849 "awkgram.y" /* yacc.c:1646 */
++#line 850 "awkgram.y" /* yacc.c:1646 */
{
- if ((yyvsp[(3) - (4)]) == NULL) {
- (yyval) = list_create((yyvsp[(1) - (4)]));
+ if ((yyvsp[-1]) == NULL) {
+ (yyval) = list_create((yyvsp[-3]));
(void) list_prepend((yyval), instruction(Op_push_i));
(yyval)->nexti->memory = dupnode(Nnull_string);
} else {
@@@ -2857,23 -2651,23 +2652,23 @@@
* call without a return value is recognized
* in mk_function().
*/
- ((yyvsp[(3) - (4)])->lasti + 1)->tail_call =
true;
+ ((yyvsp[-1])->lasti + 1)->tail_call = true;
}
- (yyval) = list_append((yyvsp[(3) - (4)]), (yyvsp[(1) -
(4)]));
+ (yyval) = list_append((yyvsp[-1]), (yyvsp[-3]));
}
}
-#line 2661 "awkgram.c" /* yacc.c:1646 */
++#line 2662 "awkgram.c" /* yacc.c:1646 */
break;
case 60:
- /* Line 1787 of yacc.c */
- #line 882 "awkgram.y"
-#line 881 "awkgram.y" /* yacc.c:1646 */
++#line 882 "awkgram.y" /* yacc.c:1646 */
{ in_print = true; in_parens = 0; }
-#line 2667 "awkgram.c" /* yacc.c:1646 */
++#line 2668 "awkgram.c" /* yacc.c:1646 */
break;
case 61:
- /* Line 1787 of yacc.c */
- #line 883 "awkgram.y"
-#line 882 "awkgram.y" /* yacc.c:1646 */
++#line 883 "awkgram.y" /* yacc.c:1646 */
{
/*
* Optimization: plain `print' has no expression list, so $3 is
null.
@@@ -2970,27 -2764,27 +2765,27 @@@ regular_print
}
}
}
-#line 2768 "awkgram.c" /* yacc.c:1646 */
++#line 2769 "awkgram.c" /* yacc.c:1646 */
break;
case 62:
- /* Line 1787 of yacc.c */
- #line 980 "awkgram.y"
-#line 979 "awkgram.y" /* yacc.c:1646 */
++#line 980 "awkgram.y" /* yacc.c:1646 */
{ sub_counter = 0; }
-#line 2774 "awkgram.c" /* yacc.c:1646 */
++#line 2775 "awkgram.c" /* yacc.c:1646 */
break;
case 63:
- /* Line 1787 of yacc.c */
- #line 981 "awkgram.y"
-#line 980 "awkgram.y" /* yacc.c:1646 */
++#line 981 "awkgram.y" /* yacc.c:1646 */
{
- char *arr = (yyvsp[(2) - (4)])->lextok;
+ char *arr = (yyvsp[-2])->lextok;
- (yyvsp[(2) - (4)])->opcode = Op_push_array;
- (yyvsp[(2) - (4)])->memory = variable((yyvsp[(2) -
(4)])->source_line, arr, Node_var_new);
+ (yyvsp[-2])->opcode = Op_push_array;
+ (yyvsp[-2])->memory = variable((yyvsp[-2])->source_line, arr,
Node_var_new);
if (! do_posix && ! do_traditional) {
- if ((yyvsp[(2) - (4)])->memory == symbol_table)
+ if ((yyvsp[-2])->memory == symbol_table)
fatal(_("`delete' is not allowed with SYMTAB"));
- else if ((yyvsp[(2) - (4)])->memory == func_table)
+ else if ((yyvsp[-2])->memory == func_table)
fatal(_("`delete' is not allowed with
FUNCTAB"));
}
@@@ -3006,21 -2800,21 +2801,21 @@@
* Also, since BWK awk supports it, we don't have to
* check do_traditional either.
*/
- (yyvsp[(1) - (4)])->expr_count = 0;
- (yyval) = list_append(list_create((yyvsp[(2) - (4)])),
(yyvsp[(1) - (4)]));
+ (yyvsp[-3])->expr_count = 0;
+ (yyval) = list_append(list_create((yyvsp[-2])),
(yyvsp[-3]));
} else {
- (yyvsp[(1) - (4)])->expr_count = sub_counter;
- (yyval) = list_append(list_append((yyvsp[(4) - (4)]),
(yyvsp[(2) - (4)])), (yyvsp[(1) - (4)]));
+ (yyvsp[-3])->expr_count = sub_counter;
+ (yyval) = list_append(list_append((yyvsp[0]),
(yyvsp[-2])), (yyvsp[-3]));
}
}
-#line 2811 "awkgram.c" /* yacc.c:1646 */
++#line 2812 "awkgram.c" /* yacc.c:1646 */
break;
case 64:
- /* Line 1787 of yacc.c */
- #line 1018 "awkgram.y"
-#line 1017 "awkgram.y" /* yacc.c:1646 */
++#line 1018 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
- char *arr = (yyvsp[(3) - (4)])->lextok;
+ char *arr = (yyvsp[-1])->lextok;
if (do_lint && ! warned) {
warned = true;
@@@ -3043,465 -2837,465 +2838,465 @@@
fatal(_("`delete' is not allowed with
FUNCTAB"));
}
}
-#line 2841 "awkgram.c" /* yacc.c:1646 */
++#line 2842 "awkgram.c" /* yacc.c:1646 */
break;
case 65:
- /* Line 1787 of yacc.c */
- #line 1044 "awkgram.y"
- { (yyval) = optimize_assignment((yyvsp[(1) - (1)])); }
-#line 1043 "awkgram.y" /* yacc.c:1646 */
++#line 1044 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = optimize_assignment((yyvsp[0])); }
-#line 2847 "awkgram.c" /* yacc.c:1646 */
++#line 2848 "awkgram.c" /* yacc.c:1646 */
break;
case 66:
- /* Line 1787 of yacc.c */
- #line 1049 "awkgram.y"
-#line 1048 "awkgram.y" /* yacc.c:1646 */
++#line 1049 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2853 "awkgram.c" /* yacc.c:1646 */
++#line 2854 "awkgram.c" /* yacc.c:1646 */
break;
case 67:
- /* Line 1787 of yacc.c */
- #line 1051 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1050 "awkgram.y" /* yacc.c:1646 */
++#line 1051 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 2859 "awkgram.c" /* yacc.c:1646 */
++#line 2860 "awkgram.c" /* yacc.c:1646 */
break;
case 68:
- /* Line 1787 of yacc.c */
- #line 1056 "awkgram.y"
-#line 1055 "awkgram.y" /* yacc.c:1646 */
++#line 1056 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2865 "awkgram.c" /* yacc.c:1646 */
++#line 2866 "awkgram.c" /* yacc.c:1646 */
break;
case 69:
- /* Line 1787 of yacc.c */
- #line 1058 "awkgram.y"
-#line 1057 "awkgram.y" /* yacc.c:1646 */
++#line 1058 "awkgram.y" /* yacc.c:1646 */
{
- if ((yyvsp[(1) - (2)]) == NULL)
- (yyval) = list_create((yyvsp[(2) - (2)]));
+ if ((yyvsp[-1]) == NULL)
+ (yyval) = list_create((yyvsp[0]));
else
- (yyval) = list_prepend((yyvsp[(1) - (2)]), (yyvsp[(2) -
(2)]));
+ (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0]));
}
-#line 2876 "awkgram.c" /* yacc.c:1646 */
++#line 2877 "awkgram.c" /* yacc.c:1646 */
break;
case 70:
- /* Line 1787 of yacc.c */
- #line 1065 "awkgram.y"
-#line 1064 "awkgram.y" /* yacc.c:1646 */
++#line 1065 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2882 "awkgram.c" /* yacc.c:1646 */
++#line 2883 "awkgram.c" /* yacc.c:1646 */
break;
case 71:
- /* Line 1787 of yacc.c */
- #line 1070 "awkgram.y"
-#line 1069 "awkgram.y" /* yacc.c:1646 */
++#line 1070 "awkgram.y" /* yacc.c:1646 */
{
- INSTRUCTION *casestmt = (yyvsp[(5) - (5)]);
- if ((yyvsp[(5) - (5)]) == NULL)
+ INSTRUCTION *casestmt = (yyvsp[0]);
+ if ((yyvsp[0]) == NULL)
casestmt = list_create(instruction(Op_no_op));
if (do_pretty_print)
(void) list_prepend(casestmt,
instruction(Op_exec_count));
- (yyvsp[(1) - (5)])->case_exp = (yyvsp[(2) - (5)]);
- (yyvsp[(1) - (5)])->case_stmt = casestmt;
- bcfree((yyvsp[(3) - (5)]));
- (yyval) = (yyvsp[(1) - (5)]);
+ (yyvsp[-4])->case_exp = (yyvsp[-3]);
+ (yyvsp[-4])->case_stmt = casestmt;
+ bcfree((yyvsp[-2]));
+ (yyval) = (yyvsp[-4]);
}
-#line 2898 "awkgram.c" /* yacc.c:1646 */
++#line 2899 "awkgram.c" /* yacc.c:1646 */
break;
case 72:
- /* Line 1787 of yacc.c */
- #line 1082 "awkgram.y"
-#line 1081 "awkgram.y" /* yacc.c:1646 */
++#line 1082 "awkgram.y" /* yacc.c:1646 */
{
- INSTRUCTION *casestmt = (yyvsp[(4) - (4)]);
- if ((yyvsp[(4) - (4)]) == NULL)
+ INSTRUCTION *casestmt = (yyvsp[0]);
+ if ((yyvsp[0]) == NULL)
casestmt = list_create(instruction(Op_no_op));
if (do_pretty_print)
(void) list_prepend(casestmt,
instruction(Op_exec_count));
- bcfree((yyvsp[(2) - (4)]));
- (yyvsp[(1) - (4)])->case_stmt = casestmt;
- (yyval) = (yyvsp[(1) - (4)]);
+ bcfree((yyvsp[-2]));
+ (yyvsp[-3])->case_stmt = casestmt;
+ (yyval) = (yyvsp[-3]);
}
-#line 2913 "awkgram.c" /* yacc.c:1646 */
++#line 2914 "awkgram.c" /* yacc.c:1646 */
break;
case 73:
- /* Line 1787 of yacc.c */
- #line 1096 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1095 "awkgram.y" /* yacc.c:1646 */
++#line 1096 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 2919 "awkgram.c" /* yacc.c:1646 */
++#line 2920 "awkgram.c" /* yacc.c:1646 */
break;
case 74:
- /* Line 1787 of yacc.c */
- #line 1098 "awkgram.y"
-#line 1097 "awkgram.y" /* yacc.c:1646 */
++#line 1098 "awkgram.y" /* yacc.c:1646 */
{
- NODE *n = (yyvsp[(2) - (2)])->memory;
+ NODE *n = (yyvsp[0])->memory;
(void) force_number(n);
negate_num(n);
- bcfree((yyvsp[(1) - (2)]));
- (yyval) = (yyvsp[(2) - (2)]);
+ bcfree((yyvsp[-1]));
+ (yyval) = (yyvsp[0]);
}
-#line 2931 "awkgram.c" /* yacc.c:1646 */
++#line 2932 "awkgram.c" /* yacc.c:1646 */
break;
case 75:
- /* Line 1787 of yacc.c */
- #line 1106 "awkgram.y"
-#line 1105 "awkgram.y" /* yacc.c:1646 */
++#line 1106 "awkgram.y" /* yacc.c:1646 */
{
- bcfree((yyvsp[(1) - (2)]));
- (yyval) = (yyvsp[(2) - (2)]);
+ bcfree((yyvsp[-1]));
+ (yyval) = (yyvsp[0]);
}
-#line 2940 "awkgram.c" /* yacc.c:1646 */
++#line 2941 "awkgram.c" /* yacc.c:1646 */
break;
case 76:
- /* Line 1787 of yacc.c */
- #line 1111 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1110 "awkgram.y" /* yacc.c:1646 */
++#line 1111 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 2946 "awkgram.c" /* yacc.c:1646 */
++#line 2947 "awkgram.c" /* yacc.c:1646 */
break;
case 77:
- /* Line 1787 of yacc.c */
- #line 1113 "awkgram.y"
-#line 1112 "awkgram.y" /* yacc.c:1646 */
++#line 1113 "awkgram.y" /* yacc.c:1646 */
{
- (yyvsp[(1) - (1)])->opcode = Op_push_re;
- (yyval) = (yyvsp[(1) - (1)]);
+ (yyvsp[0])->opcode = Op_push_re;
+ (yyval) = (yyvsp[0]);
}
-#line 2955 "awkgram.c" /* yacc.c:1646 */
++#line 2956 "awkgram.c" /* yacc.c:1646 */
break;
case 78:
- /* Line 1787 of yacc.c */
- #line 1121 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1120 "awkgram.y" /* yacc.c:1646 */
++#line 1121 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 2961 "awkgram.c" /* yacc.c:1646 */
++#line 2962 "awkgram.c" /* yacc.c:1646 */
break;
case 79:
- /* Line 1787 of yacc.c */
- #line 1123 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1122 "awkgram.y" /* yacc.c:1646 */
++#line 1123 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 2967 "awkgram.c" /* yacc.c:1646 */
++#line 2968 "awkgram.c" /* yacc.c:1646 */
break;
case 81:
- /* Line 1787 of yacc.c */
- #line 1133 "awkgram.y"
-#line 1132 "awkgram.y" /* yacc.c:1646 */
++#line 1133 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = (yyvsp[(2) - (3)]);
+ (yyval) = (yyvsp[-1]);
}
-#line 2975 "awkgram.c" /* yacc.c:1646 */
++#line 2976 "awkgram.c" /* yacc.c:1646 */
break;
case 82:
- /* Line 1787 of yacc.c */
- #line 1140 "awkgram.y"
-#line 1139 "awkgram.y" /* yacc.c:1646 */
++#line 1140 "awkgram.y" /* yacc.c:1646 */
{
in_print = false;
in_parens = 0;
(yyval) = NULL;
}
-#line 2985 "awkgram.c" /* yacc.c:1646 */
++#line 2986 "awkgram.c" /* yacc.c:1646 */
break;
case 83:
- /* Line 1787 of yacc.c */
- #line 1145 "awkgram.y"
-#line 1144 "awkgram.y" /* yacc.c:1646 */
++#line 1145 "awkgram.y" /* yacc.c:1646 */
{ in_print = false; in_parens = 0; }
-#line 2991 "awkgram.c" /* yacc.c:1646 */
++#line 2992 "awkgram.c" /* yacc.c:1646 */
break;
case 84:
- /* Line 1787 of yacc.c */
- #line 1146 "awkgram.y"
-#line 1145 "awkgram.y" /* yacc.c:1646 */
++#line 1146 "awkgram.y" /* yacc.c:1646 */
{
- if ((yyvsp[(1) - (3)])->redir_type == redirect_twoway
- && (yyvsp[(3) - (3)])->lasti->opcode ==
Op_K_getline_redir
- && (yyvsp[(3) - (3)])->lasti->redir_type ==
redirect_twoway)
+ if ((yyvsp[-2])->redir_type == redirect_twoway
+ && (yyvsp[0])->lasti->opcode == Op_K_getline_redir
+ && (yyvsp[0])->lasti->redir_type ==
redirect_twoway)
yyerror(_("multistage two-way pipelines don't work"));
- (yyval) = list_prepend((yyvsp[(3) - (3)]), (yyvsp[(1) - (3)]));
+ (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2]));
}
-#line 3003 "awkgram.c" /* yacc.c:1646 */
++#line 3004 "awkgram.c" /* yacc.c:1646 */
break;
case 85:
- /* Line 1787 of yacc.c */
- #line 1157 "awkgram.y"
-#line 1156 "awkgram.y" /* yacc.c:1646 */
++#line 1157 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = mk_condition((yyvsp[(3) - (6)]), (yyvsp[(1) - (6)]),
(yyvsp[(6) - (6)]), NULL, NULL);
+ (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]),
NULL, NULL);
}
-#line 3011 "awkgram.c" /* yacc.c:1646 */
++#line 3012 "awkgram.c" /* yacc.c:1646 */
break;
case 86:
- /* Line 1787 of yacc.c */
- #line 1162 "awkgram.y"
-#line 1161 "awkgram.y" /* yacc.c:1646 */
++#line 1162 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = mk_condition((yyvsp[(3) - (9)]), (yyvsp[(1) - (9)]),
(yyvsp[(6) - (9)]), (yyvsp[(7) - (9)]), (yyvsp[(9) - (9)]));
+ (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]),
(yyvsp[-2]), (yyvsp[0]));
}
-#line 3019 "awkgram.c" /* yacc.c:1646 */
++#line 3020 "awkgram.c" /* yacc.c:1646 */
break;
case 91:
- /* Line 1787 of yacc.c */
- #line 1179 "awkgram.y"
-#line 1178 "awkgram.y" /* yacc.c:1646 */
++#line 1179 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3025 "awkgram.c" /* yacc.c:1646 */
++#line 3026 "awkgram.c" /* yacc.c:1646 */
break;
case 92:
- /* Line 1787 of yacc.c */
- #line 1181 "awkgram.y"
-#line 1180 "awkgram.y" /* yacc.c:1646 */
++#line 1181 "awkgram.y" /* yacc.c:1646 */
{
- bcfree((yyvsp[(1) - (2)]));
- (yyval) = (yyvsp[(2) - (2)]);
+ bcfree((yyvsp[-1]));
+ (yyval) = (yyvsp[0]);
}
-#line 3034 "awkgram.c" /* yacc.c:1646 */
++#line 3035 "awkgram.c" /* yacc.c:1646 */
break;
case 93:
- /* Line 1787 of yacc.c */
- #line 1189 "awkgram.y"
-#line 1188 "awkgram.y" /* yacc.c:1646 */
++#line 1189 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3040 "awkgram.c" /* yacc.c:1646 */
++#line 3041 "awkgram.c" /* yacc.c:1646 */
break;
case 94:
- /* Line 1787 of yacc.c */
- #line 1191 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]) ; }
-#line 1190 "awkgram.y" /* yacc.c:1646 */
++#line 1191 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]) ; }
-#line 3046 "awkgram.c" /* yacc.c:1646 */
++#line 3047 "awkgram.c" /* yacc.c:1646 */
break;
case 95:
- /* Line 1787 of yacc.c */
- #line 1196 "awkgram.y"
-#line 1195 "awkgram.y" /* yacc.c:1646 */
++#line 1196 "awkgram.y" /* yacc.c:1646 */
{
- (yyvsp[(1) - (1)])->param_count = 0;
- (yyval) = list_create((yyvsp[(1) - (1)]));
+ (yyvsp[0])->param_count = 0;
+ (yyval) = list_create((yyvsp[0]));
}
-#line 3055 "awkgram.c" /* yacc.c:1646 */
++#line 3056 "awkgram.c" /* yacc.c:1646 */
break;
case 96:
- /* Line 1787 of yacc.c */
- #line 1201 "awkgram.y"
-#line 1200 "awkgram.y" /* yacc.c:1646 */
++#line 1201 "awkgram.y" /* yacc.c:1646 */
{
- (yyvsp[(3) - (3)])->param_count = (yyvsp[(1) -
(3)])->lasti->param_count + 1;
- (yyval) = list_append((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));
+ (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1;
+ (yyval) = list_append((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3065 "awkgram.c" /* yacc.c:1646 */
++#line 3066 "awkgram.c" /* yacc.c:1646 */
break;
case 97:
- /* Line 1787 of yacc.c */
- #line 1207 "awkgram.y"
-#line 1206 "awkgram.y" /* yacc.c:1646 */
++#line 1207 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3071 "awkgram.c" /* yacc.c:1646 */
++#line 3072 "awkgram.c" /* yacc.c:1646 */
break;
case 98:
- /* Line 1787 of yacc.c */
- #line 1209 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (2)]); }
-#line 1208 "awkgram.y" /* yacc.c:1646 */
++#line 1209 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[-1]); }
-#line 3077 "awkgram.c" /* yacc.c:1646 */
++#line 3078 "awkgram.c" /* yacc.c:1646 */
break;
case 99:
- /* Line 1787 of yacc.c */
- #line 1211 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (3)]); }
-#line 1210 "awkgram.y" /* yacc.c:1646 */
++#line 1211 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[-2]); }
-#line 3083 "awkgram.c" /* yacc.c:1646 */
++#line 3084 "awkgram.c" /* yacc.c:1646 */
break;
case 100:
- /* Line 1787 of yacc.c */
- #line 1217 "awkgram.y"
-#line 1216 "awkgram.y" /* yacc.c:1646 */
++#line 1217 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3089 "awkgram.c" /* yacc.c:1646 */
++#line 3090 "awkgram.c" /* yacc.c:1646 */
break;
case 101:
- /* Line 1787 of yacc.c */
- #line 1219 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1218 "awkgram.y" /* yacc.c:1646 */
++#line 1219 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3095 "awkgram.c" /* yacc.c:1646 */
++#line 3096 "awkgram.c" /* yacc.c:1646 */
break;
case 102:
- /* Line 1787 of yacc.c */
- #line 1224 "awkgram.y"
-#line 1223 "awkgram.y" /* yacc.c:1646 */
++#line 1224 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3101 "awkgram.c" /* yacc.c:1646 */
++#line 3102 "awkgram.c" /* yacc.c:1646 */
break;
case 103:
- /* Line 1787 of yacc.c */
- #line 1226 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1225 "awkgram.y" /* yacc.c:1646 */
++#line 1226 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3107 "awkgram.c" /* yacc.c:1646 */
++#line 3108 "awkgram.c" /* yacc.c:1646 */
break;
case 104:
- /* Line 1787 of yacc.c */
- #line 1231 "awkgram.y"
- { (yyval) = mk_expression_list(NULL, (yyvsp[(1) - (1)])); }
-#line 1230 "awkgram.y" /* yacc.c:1646 */
++#line 1231 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3113 "awkgram.c" /* yacc.c:1646 */
++#line 3114 "awkgram.c" /* yacc.c:1646 */
break;
case 105:
- /* Line 1787 of yacc.c */
- #line 1233 "awkgram.y"
-#line 1232 "awkgram.y" /* yacc.c:1646 */
++#line 1233 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) -
(3)]));
+ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3122 "awkgram.c" /* yacc.c:1646 */
++#line 3123 "awkgram.c" /* yacc.c:1646 */
break;
case 106:
- /* Line 1787 of yacc.c */
- #line 1238 "awkgram.y"
-#line 1237 "awkgram.y" /* yacc.c:1646 */
++#line 1238 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3128 "awkgram.c" /* yacc.c:1646 */
++#line 3129 "awkgram.c" /* yacc.c:1646 */
break;
case 107:
- /* Line 1787 of yacc.c */
- #line 1240 "awkgram.y"
-#line 1239 "awkgram.y" /* yacc.c:1646 */
++#line 1240 "awkgram.y" /* yacc.c:1646 */
{
/*
* Returning the expression list instead of NULL lets
* snode get a list of arguments that it can count.
*/
- (yyval) = (yyvsp[(1) - (2)]);
+ (yyval) = (yyvsp[-1]);
}
-#line 3140 "awkgram.c" /* yacc.c:1646 */
++#line 3141 "awkgram.c" /* yacc.c:1646 */
break;
case 108:
- /* Line 1787 of yacc.c */
- #line 1248 "awkgram.y"
-#line 1247 "awkgram.y" /* yacc.c:1646 */
++#line 1248 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
- (yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) -
(3)]));
+ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3149 "awkgram.c" /* yacc.c:1646 */
++#line 3150 "awkgram.c" /* yacc.c:1646 */
break;
case 109:
- /* Line 1787 of yacc.c */
- #line 1253 "awkgram.y"
-#line 1252 "awkgram.y" /* yacc.c:1646 */
++#line 1253 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
- (yyval) = (yyvsp[(1) - (3)]);
+ (yyval) = (yyvsp[-2]);
}
-#line 3158 "awkgram.c" /* yacc.c:1646 */
++#line 3159 "awkgram.c" /* yacc.c:1646 */
break;
case 110:
- /* Line 1787 of yacc.c */
- #line 1262 "awkgram.y"
-#line 1261 "awkgram.y" /* yacc.c:1646 */
++#line 1262 "awkgram.y" /* yacc.c:1646 */
{
- if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode ==
Op_match_rec)
- lintwarn_ln((yyvsp[(2) - (3)])->source_line,
+ if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec)
+ lintwarn_ln((yyvsp[-1])->source_line,
_("regular expression on right of assignment"));
- (yyval) = mk_assignment((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]),
(yyvsp[(2) - (3)]));
+ (yyval) = mk_assignment((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1]));
}
-#line 3169 "awkgram.c" /* yacc.c:1646 */
++#line 3170 "awkgram.c" /* yacc.c:1646 */
break;
case 111:
- /* Line 1787 of yacc.c */
- #line 1269 "awkgram.y"
- { (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1268 "awkgram.y" /* yacc.c:1646 */
++#line 1269 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3175 "awkgram.c" /* yacc.c:1646 */
++#line 3176 "awkgram.c" /* yacc.c:1646 */
break;
case 112:
- /* Line 1787 of yacc.c */
- #line 1271 "awkgram.y"
- { (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1270 "awkgram.y" /* yacc.c:1646 */
++#line 1271 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3181 "awkgram.c" /* yacc.c:1646 */
++#line 3182 "awkgram.c" /* yacc.c:1646 */
break;
case 113:
- /* Line 1787 of yacc.c */
- #line 1273 "awkgram.y"
-#line 1272 "awkgram.y" /* yacc.c:1646 */
++#line 1273 "awkgram.y" /* yacc.c:1646 */
{
- if ((yyvsp[(1) - (3)])->lasti->opcode == Op_match_rec)
- warning_ln((yyvsp[(2) - (3)])->source_line,
+ if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
+ warning_ln((yyvsp[-1])->source_line,
_("regular expression on left of `~' or `!~'
operator"));
- if ((yyvsp[(3) - (3)])->lasti == (yyvsp[(3) - (3)])->nexti &&
(yyvsp[(3) - (3)])->nexti->opcode == Op_match_rec) {
- (yyvsp[(2) - (3)])->memory = (yyvsp[(3) -
(3)])->nexti->memory;
- bcfree((yyvsp[(3) - (3)])->nexti); /* Op_match_rec
*/
- bcfree((yyvsp[(3) - (3)])); /*
Op_list */
- (yyval) = list_append((yyvsp[(1) - (3)]), (yyvsp[(2) -
(3)]));
+ if ((yyvsp[0])->lasti == (yyvsp[0])->nexti &&
(yyvsp[0])->nexti->opcode == Op_match_rec) {
+ (yyvsp[-1])->memory = (yyvsp[0])->nexti->memory;
+ bcfree((yyvsp[0])->nexti); /* Op_match_rec */
+ bcfree((yyvsp[0])); /* Op_list */
+ (yyval) = list_append((yyvsp[-2]), (yyvsp[-1]));
} else {
- (yyvsp[(2) - (3)])->memory =
make_regnode(Node_dynregex, NULL);
- (yyval) = list_append(list_merge((yyvsp[(1) - (3)]),
(yyvsp[(3) - (3)])), (yyvsp[(2) - (3)]));
+ (yyvsp[-1])->memory = make_regnode(Node_dynregex, NULL);
+ (yyval) = list_append(list_merge((yyvsp[-2]),
(yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3201 "awkgram.c" /* yacc.c:1646 */
++#line 3202 "awkgram.c" /* yacc.c:1646 */
break;
case 114:
- /* Line 1787 of yacc.c */
- #line 1289 "awkgram.y"
-#line 1288 "awkgram.y" /* yacc.c:1646 */
++#line 1289 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old)
- warning_ln((yyvsp[(2) - (3)])->source_line,
+ warning_ln((yyvsp[-1])->source_line,
_("old awk does not support the keyword `in'
except after `for'"));
- (yyvsp[(3) - (3)])->nexti->opcode = Op_push_array;
- (yyvsp[(2) - (3)])->opcode = Op_in_array;
- (yyvsp[(2) - (3)])->expr_count = 1;
- (yyval) = list_append(list_merge((yyvsp[(1) - (3)]), (yyvsp[(3)
- (3)])), (yyvsp[(2) - (3)]));
+ (yyvsp[0])->nexti->opcode = Op_push_array;
+ (yyvsp[-1])->opcode = Op_in_array;
+ (yyvsp[-1])->expr_count = 1;
+ (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])),
(yyvsp[-1]));
}
-#line 3215 "awkgram.c" /* yacc.c:1646 */
++#line 3216 "awkgram.c" /* yacc.c:1646 */
break;
case 115:
- /* Line 1787 of yacc.c */
- #line 1299 "awkgram.y"
-#line 1298 "awkgram.y" /* yacc.c:1646 */
++#line 1299 "awkgram.y" /* yacc.c:1646 */
{
- if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode ==
Op_match_rec)
- lintwarn_ln((yyvsp[(2) - (3)])->source_line,
+ if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec)
+ lintwarn_ln((yyvsp[-1])->source_line,
_("regular expression on right of comparison"));
- (yyval) = list_append(list_merge((yyvsp[(1) - (3)]), (yyvsp[(3)
- (3)])), (yyvsp[(2) - (3)]));
+ (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])),
(yyvsp[-1]));
}
-#line 3226 "awkgram.c" /* yacc.c:1646 */
++#line 3227 "awkgram.c" /* yacc.c:1646 */
break;
case 116:
- /* Line 1787 of yacc.c */
- #line 1306 "awkgram.y"
- { (yyval) = mk_condition((yyvsp[(1) - (5)]), (yyvsp[(2) - (5)]),
(yyvsp[(3) - (5)]), (yyvsp[(4) - (5)]), (yyvsp[(5) - (5)])); }
-#line 1305 "awkgram.y" /* yacc.c:1646 */
++#line 1306 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]),
(yyvsp[-1]), (yyvsp[0])); }
-#line 3232 "awkgram.c" /* yacc.c:1646 */
++#line 3233 "awkgram.c" /* yacc.c:1646 */
break;
case 117:
- /* Line 1787 of yacc.c */
- #line 1308 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1307 "awkgram.y" /* yacc.c:1646 */
++#line 1308 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3238 "awkgram.c" /* yacc.c:1646 */
++#line 3239 "awkgram.c" /* yacc.c:1646 */
break;
case 118:
- /* Line 1787 of yacc.c */
- #line 1313 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1312 "awkgram.y" /* yacc.c:1646 */
++#line 1313 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3244 "awkgram.c" /* yacc.c:1646 */
++#line 3245 "awkgram.c" /* yacc.c:1646 */
break;
case 119:
- /* Line 1787 of yacc.c */
- #line 1315 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1314 "awkgram.y" /* yacc.c:1646 */
++#line 1315 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3250 "awkgram.c" /* yacc.c:1646 */
++#line 3251 "awkgram.c" /* yacc.c:1646 */
break;
case 120:
- /* Line 1787 of yacc.c */
- #line 1317 "awkgram.y"
-#line 1316 "awkgram.y" /* yacc.c:1646 */
++#line 1317 "awkgram.y" /* yacc.c:1646 */
{
- (yyvsp[(2) - (2)])->opcode = Op_assign_quotient;
- (yyval) = (yyvsp[(2) - (2)]);
+ (yyvsp[0])->opcode = Op_assign_quotient;
+ (yyval) = (yyvsp[0]);
}
-#line 3259 "awkgram.c" /* yacc.c:1646 */
++#line 3260 "awkgram.c" /* yacc.c:1646 */
break;
case 121:
- /* Line 1787 of yacc.c */
- #line 1325 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1324 "awkgram.y" /* yacc.c:1646 */
++#line 1325 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3265 "awkgram.c" /* yacc.c:1646 */
++#line 3266 "awkgram.c" /* yacc.c:1646 */
break;
case 122:
- /* Line 1787 of yacc.c */
- #line 1327 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1326 "awkgram.y" /* yacc.c:1646 */
++#line 1327 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3271 "awkgram.c" /* yacc.c:1646 */
++#line 3272 "awkgram.c" /* yacc.c:1646 */
break;
case 123:
- /* Line 1787 of yacc.c */
- #line 1332 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1331 "awkgram.y" /* yacc.c:1646 */
++#line 1332 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3277 "awkgram.c" /* yacc.c:1646 */
++#line 3278 "awkgram.c" /* yacc.c:1646 */
break;
case 124:
- /* Line 1787 of yacc.c */
- #line 1334 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1333 "awkgram.y" /* yacc.c:1646 */
++#line 1334 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3283 "awkgram.c" /* yacc.c:1646 */
++#line 3284 "awkgram.c" /* yacc.c:1646 */
break;
case 125:
- /* Line 1787 of yacc.c */
- #line 1339 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1338 "awkgram.y" /* yacc.c:1646 */
++#line 1339 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3289 "awkgram.c" /* yacc.c:1646 */
++#line 3290 "awkgram.c" /* yacc.c:1646 */
break;
case 126:
- /* Line 1787 of yacc.c */
- #line 1341 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1340 "awkgram.y" /* yacc.c:1646 */
++#line 1341 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3295 "awkgram.c" /* yacc.c:1646 */
++#line 3296 "awkgram.c" /* yacc.c:1646 */
break;
case 127:
- /* Line 1787 of yacc.c */
- #line 1343 "awkgram.y"
-#line 1342 "awkgram.y" /* yacc.c:1646 */
++#line 1343 "awkgram.y" /* yacc.c:1646 */
{
int count = 2;
bool is_simple_var = false;
@@@ -3548,47 -3342,47 +3343,47 @@@
max_args = count;
}
}
-#line 3346 "awkgram.c" /* yacc.c:1646 */
++#line 3347 "awkgram.c" /* yacc.c:1646 */
break;
case 129:
- /* Line 1787 of yacc.c */
- #line 1395 "awkgram.y"
- { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1394 "awkgram.y" /* yacc.c:1646 */
++#line 1395 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3352 "awkgram.c" /* yacc.c:1646 */
++#line 3353 "awkgram.c" /* yacc.c:1646 */
break;
case 130:
- /* Line 1787 of yacc.c */
- #line 1397 "awkgram.y"
- { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1396 "awkgram.y" /* yacc.c:1646 */
++#line 1397 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3358 "awkgram.c" /* yacc.c:1646 */
++#line 3359 "awkgram.c" /* yacc.c:1646 */
break;
case 131:
- /* Line 1787 of yacc.c */
- #line 1399 "awkgram.y"
- { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1398 "awkgram.y" /* yacc.c:1646 */
++#line 1399 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3364 "awkgram.c" /* yacc.c:1646 */
++#line 3365 "awkgram.c" /* yacc.c:1646 */
break;
case 132:
- /* Line 1787 of yacc.c */
- #line 1401 "awkgram.y"
- { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1400 "awkgram.y" /* yacc.c:1646 */
++#line 1401 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3370 "awkgram.c" /* yacc.c:1646 */
++#line 3371 "awkgram.c" /* yacc.c:1646 */
break;
case 133:
- /* Line 1787 of yacc.c */
- #line 1403 "awkgram.y"
- { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1402 "awkgram.y" /* yacc.c:1646 */
++#line 1403 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3376 "awkgram.c" /* yacc.c:1646 */
++#line 3377 "awkgram.c" /* yacc.c:1646 */
break;
case 134:
- /* Line 1787 of yacc.c */
- #line 1405 "awkgram.y"
- { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1404 "awkgram.y" /* yacc.c:1646 */
++#line 1405 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3382 "awkgram.c" /* yacc.c:1646 */
++#line 3383 "awkgram.c" /* yacc.c:1646 */
break;
case 135:
- /* Line 1787 of yacc.c */
- #line 1407 "awkgram.y"
-#line 1406 "awkgram.y" /* yacc.c:1646 */
++#line 1407 "awkgram.y" /* yacc.c:1646 */
{
/*
* In BEGINFILE/ENDFILE, allow `getline var < file'
@@@ -3606,124 -3400,124 +3401,124 @@@
_("`getline' invalid inside
`%s' rule"), ruletab[rule]);
}
}
- if (do_lint && rule == END && (yyvsp[(3) - (3)]) == NULL)
- lintwarn_ln((yyvsp[(1) - (3)])->source_line,
+ if (do_lint && rule == END && (yyvsp[0]) == NULL)
+ lintwarn_ln((yyvsp[-2])->source_line,
_("non-redirected `getline' undefined inside
END action"));
- (yyval) = mk_getline((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]),
(yyvsp[(3) - (3)]), redirect_input);
+ (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]),
redirect_input);
}
-#line 3409 "awkgram.c" /* yacc.c:1646 */
++#line 3410 "awkgram.c" /* yacc.c:1646 */
break;
case 136:
- /* Line 1787 of yacc.c */
- #line 1430 "awkgram.y"
-#line 1429 "awkgram.y" /* yacc.c:1646 */
++#line 1430 "awkgram.y" /* yacc.c:1646 */
{
- (yyvsp[(2) - (2)])->opcode = Op_postincrement;
- (yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) -
(2)]));
+ (yyvsp[0])->opcode = Op_postincrement;
+ (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3418 "awkgram.c" /* yacc.c:1646 */
++#line 3419 "awkgram.c" /* yacc.c:1646 */
break;
case 137:
- /* Line 1787 of yacc.c */
- #line 1435 "awkgram.y"
-#line 1434 "awkgram.y" /* yacc.c:1646 */
++#line 1435 "awkgram.y" /* yacc.c:1646 */
{
- (yyvsp[(2) - (2)])->opcode = Op_postdecrement;
- (yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) -
(2)]));
+ (yyvsp[0])->opcode = Op_postdecrement;
+ (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3427 "awkgram.c" /* yacc.c:1646 */
++#line 3428 "awkgram.c" /* yacc.c:1646 */
break;
case 138:
- /* Line 1787 of yacc.c */
- #line 1440 "awkgram.y"
-#line 1439 "awkgram.y" /* yacc.c:1646 */
++#line 1440 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old) {
- warning_ln((yyvsp[(4) - (5)])->source_line,
+ warning_ln((yyvsp[-1])->source_line,
_("old awk does not support the keyword `in'
except after `for'"));
- warning_ln((yyvsp[(4) - (5)])->source_line,
+ warning_ln((yyvsp[-1])->source_line,
_("old awk does not support multidimensional
arrays"));
}
- (yyvsp[(5) - (5)])->nexti->opcode = Op_push_array;
- (yyvsp[(4) - (5)])->opcode = Op_in_array;
- if ((yyvsp[(2) - (5)]) == NULL) { /* error */
+ (yyvsp[0])->nexti->opcode = Op_push_array;
+ (yyvsp[-1])->opcode = Op_in_array;
+ if ((yyvsp[-3]) == NULL) { /* error */
errcount++;
- (yyvsp[(4) - (5)])->expr_count = 0;
- (yyval) = list_merge((yyvsp[(5) - (5)]), (yyvsp[(4) -
(5)]));
+ (yyvsp[-1])->expr_count = 0;
+ (yyval) = list_merge((yyvsp[0]), (yyvsp[-1]));
} else {
- INSTRUCTION *t = (yyvsp[(2) - (5)]);
- (yyvsp[(4) - (5)])->expr_count = count_expressions(&t,
false);
- (yyval) = list_append(list_merge(t, (yyvsp[(5) -
(5)])), (yyvsp[(4) - (5)]));
+ INSTRUCTION *t = (yyvsp[-3]);
+ (yyvsp[-1])->expr_count = count_expressions(&t, false);
+ (yyval) = list_append(list_merge(t, (yyvsp[0])),
(yyvsp[-1]));
}
}
-#line 3451 "awkgram.c" /* yacc.c:1646 */
++#line 3452 "awkgram.c" /* yacc.c:1646 */
break;
case 139:
- /* Line 1787 of yacc.c */
- #line 1465 "awkgram.y"
-#line 1464 "awkgram.y" /* yacc.c:1646 */
++#line 1465 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = mk_getline((yyvsp[(3) - (4)]), (yyvsp[(4) - (4)]),
(yyvsp[(1) - (4)]), (yyvsp[(2) - (4)])->redir_type);
- bcfree((yyvsp[(2) - (4)]));
+ (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]),
(yyvsp[-2])->redir_type);
+ bcfree((yyvsp[-2]));
}
-#line 3460 "awkgram.c" /* yacc.c:1646 */
++#line 3461 "awkgram.c" /* yacc.c:1646 */
break;
case 140:
- /* Line 1787 of yacc.c */
- #line 1471 "awkgram.y"
- { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1470 "awkgram.y" /* yacc.c:1646 */
++#line 1471 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3466 "awkgram.c" /* yacc.c:1646 */
++#line 3467 "awkgram.c" /* yacc.c:1646 */
break;
case 141:
- /* Line 1787 of yacc.c */
- #line 1473 "awkgram.y"
- { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1472 "awkgram.y" /* yacc.c:1646 */
++#line 1473 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3472 "awkgram.c" /* yacc.c:1646 */
++#line 3473 "awkgram.c" /* yacc.c:1646 */
break;
case 142:
- /* Line 1787 of yacc.c */
- #line 1475 "awkgram.y"
- { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1474 "awkgram.y" /* yacc.c:1646 */
++#line 1475 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3478 "awkgram.c" /* yacc.c:1646 */
++#line 3479 "awkgram.c" /* yacc.c:1646 */
break;
case 143:
- /* Line 1787 of yacc.c */
- #line 1477 "awkgram.y"
- { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1476 "awkgram.y" /* yacc.c:1646 */
++#line 1477 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3484 "awkgram.c" /* yacc.c:1646 */
++#line 3485 "awkgram.c" /* yacc.c:1646 */
break;
case 144:
- /* Line 1787 of yacc.c */
- #line 1479 "awkgram.y"
- { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1478 "awkgram.y" /* yacc.c:1646 */
++#line 1479 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3490 "awkgram.c" /* yacc.c:1646 */
++#line 3491 "awkgram.c" /* yacc.c:1646 */
break;
case 145:
- /* Line 1787 of yacc.c */
- #line 1481 "awkgram.y"
- { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
-#line 1480 "awkgram.y" /* yacc.c:1646 */
++#line 1481 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3496 "awkgram.c" /* yacc.c:1646 */
++#line 3497 "awkgram.c" /* yacc.c:1646 */
break;
case 146:
- /* Line 1787 of yacc.c */
- #line 1486 "awkgram.y"
-#line 1485 "awkgram.y" /* yacc.c:1646 */
++#line 1486 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = list_create((yyvsp[(1) - (1)]));
+ (yyval) = list_create((yyvsp[0]));
}
-#line 3504 "awkgram.c" /* yacc.c:1646 */
++#line 3505 "awkgram.c" /* yacc.c:1646 */
break;
case 147:
- /* Line 1787 of yacc.c */
- #line 1490 "awkgram.y"
-#line 1489 "awkgram.y" /* yacc.c:1646 */
++#line 1490 "awkgram.y" /* yacc.c:1646 */
{
- if ((yyvsp[(2) - (2)])->opcode == Op_match_rec) {
- (yyvsp[(2) - (2)])->opcode = Op_nomatch;
- (yyvsp[(1) - (2)])->opcode = Op_push_i;
- (yyvsp[(1) - (2)])->memory = make_number(0.0);
- (yyval) =
list_append(list_append(list_create((yyvsp[(1) - (2)])),
- instruction(Op_field_spec)),
(yyvsp[(2) - (2)]));
+ if ((yyvsp[0])->opcode == Op_match_rec) {
+ (yyvsp[0])->opcode = Op_nomatch;
+ (yyvsp[-1])->opcode = Op_push_i;
+ (yyvsp[-1])->memory = make_number(0.0);
+ (yyval) =
list_append(list_append(list_create((yyvsp[-1])),
+ instruction(Op_field_spec)),
(yyvsp[0]));
} else {
- if (do_optimize && (yyvsp[(2) - (2)])->nexti ==
(yyvsp[(2) - (2)])->lasti
- && (yyvsp[(2) - (2)])->nexti->opcode ==
Op_push_i
- && ((yyvsp[(2) -
(2)])->nexti->memory->flags & (MPFN|MPZN)) == 0
+ if (do_optimize && (yyvsp[0])->nexti ==
(yyvsp[0])->lasti
+ && (yyvsp[0])->nexti->opcode ==
Op_push_i
+ && ((yyvsp[0])->nexti->memory->flags &
(MPFN|MPZN)) == 0
) {
- NODE *n = (yyvsp[(2) - (2)])->nexti->memory;
+ NODE *n = (yyvsp[0])->nexti->memory;
if ((n->flags & (STRCUR|STRING)) != 0) {
n->numbr = (AWKNUM) (n->stlen == 0);
n->flags &= ~(STRCUR|STRING);
@@@ -3742,37 -3536,37 +3537,37 @@@
}
}
}
-#line 3540 "awkgram.c" /* yacc.c:1646 */
++#line 3541 "awkgram.c" /* yacc.c:1646 */
break;
case 148:
- /* Line 1787 of yacc.c */
- #line 1522 "awkgram.y"
- { (yyval) = (yyvsp[(2) - (3)]); }
-#line 1521 "awkgram.y" /* yacc.c:1646 */
++#line 1522 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[-1]); }
-#line 3546 "awkgram.c" /* yacc.c:1646 */
++#line 3547 "awkgram.c" /* yacc.c:1646 */
break;
case 149:
- /* Line 1787 of yacc.c */
- #line 1524 "awkgram.y"
-#line 1523 "awkgram.y" /* yacc.c:1646 */
++#line 1524 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)]));
+ (yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3556 "awkgram.c" /* yacc.c:1646 */
++#line 3557 "awkgram.c" /* yacc.c:1646 */
break;
case 150:
- /* Line 1787 of yacc.c */
- #line 1530 "awkgram.y"
-#line 1529 "awkgram.y" /* yacc.c:1646 */
++#line 1530 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)]));
+ (yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3566 "awkgram.c" /* yacc.c:1646 */
++#line 3567 "awkgram.c" /* yacc.c:1646 */
break;
case 151:
- /* Line 1787 of yacc.c */
- #line 1536 "awkgram.y"
-#line 1535 "awkgram.y" /* yacc.c:1646 */
++#line 1536 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
@@@ -3785,87 -3579,87 +3580,87 @@@
if ((yyval) == NULL)
YYABORT;
}
-#line 3583 "awkgram.c" /* yacc.c:1646 */
++#line 3584 "awkgram.c" /* yacc.c:1646 */
break;
case 154:
- /* Line 1787 of yacc.c */
- #line 1551 "awkgram.y"
-#line 1550 "awkgram.y" /* yacc.c:1646 */
++#line 1551 "awkgram.y" /* yacc.c:1646 */
{
- (yyvsp[(1) - (2)])->opcode = Op_preincrement;
- (yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) -
(2)]));
+ (yyvsp[-1])->opcode = Op_preincrement;
+ (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 3592 "awkgram.c" /* yacc.c:1646 */
++#line 3593 "awkgram.c" /* yacc.c:1646 */
break;
case 155:
- /* Line 1787 of yacc.c */
- #line 1556 "awkgram.y"
-#line 1555 "awkgram.y" /* yacc.c:1646 */
++#line 1556 "awkgram.y" /* yacc.c:1646 */
{
- (yyvsp[(1) - (2)])->opcode = Op_predecrement;
- (yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) -
(2)]));
+ (yyvsp[-1])->opcode = Op_predecrement;
+ (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 3601 "awkgram.c" /* yacc.c:1646 */
++#line 3602 "awkgram.c" /* yacc.c:1646 */
break;
case 156:
- /* Line 1787 of yacc.c */
- #line 1561 "awkgram.y"
-#line 1560 "awkgram.y" /* yacc.c:1646 */
++#line 1561 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = list_create((yyvsp[(1) - (1)]));
+ (yyval) = list_create((yyvsp[0]));
}
-#line 3609 "awkgram.c" /* yacc.c:1646 */
++#line 3610 "awkgram.c" /* yacc.c:1646 */
break;
case 157:
- /* Line 1787 of yacc.c */
- #line 1565 "awkgram.y"
-#line 1564 "awkgram.y" /* yacc.c:1646 */
++#line 1565 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = list_create((yyvsp[(1) - (1)]));
+ (yyval) = list_create((yyvsp[0]));
}
-#line 3617 "awkgram.c" /* yacc.c:1646 */
++#line 3618 "awkgram.c" /* yacc.c:1646 */
break;
case 158:
- /* Line 1787 of yacc.c */
- #line 1569 "awkgram.y"
-#line 1568 "awkgram.y" /* yacc.c:1646 */
++#line 1569 "awkgram.y" /* yacc.c:1646 */
{
- if ((yyvsp[(2) - (2)])->lasti->opcode == Op_push_i
- && ((yyvsp[(2) - (2)])->lasti->memory->flags &
(STRCUR|STRING)) == 0
+ if ((yyvsp[0])->lasti->opcode == Op_push_i
+ && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING))
== 0
) {
- NODE *n = (yyvsp[(2) - (2)])->lasti->memory;
+ NODE *n = (yyvsp[0])->lasti->memory;
(void) force_number(n);
negate_num(n);
- (yyval) = (yyvsp[(2) - (2)]);
- bcfree((yyvsp[(1) - (2)]));
+ (yyval) = (yyvsp[0]);
+ bcfree((yyvsp[-1]));
} else {
- (yyvsp[(1) - (2)])->opcode = Op_unary_minus;
- (yyval) = list_append((yyvsp[(2) - (2)]), (yyvsp[(1) -
(2)]));
+ (yyvsp[-1])->opcode = Op_unary_minus;
+ (yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
}
-#line 3636 "awkgram.c" /* yacc.c:1646 */
++#line 3637 "awkgram.c" /* yacc.c:1646 */
break;
case 159:
- /* Line 1787 of yacc.c */
- #line 1584 "awkgram.y"
-#line 1583 "awkgram.y" /* yacc.c:1646 */
++#line 1584 "awkgram.y" /* yacc.c:1646 */
{
/*
* was: $$ = $2
* POSIX semantics: force a conversion to numeric type
*/
- (yyvsp[(1) - (2)])->opcode = Op_plus_i;
- (yyvsp[(1) - (2)])->memory = make_number(0.0);
- (yyval) = list_append((yyvsp[(2) - (2)]), (yyvsp[(1) - (2)]));
+ (yyvsp[-1])->opcode = Op_plus_i;
+ (yyvsp[-1])->memory = make_number(0.0);
+ (yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
-#line 3650 "awkgram.c" /* yacc.c:1646 */
++#line 3651 "awkgram.c" /* yacc.c:1646 */
break;
case 160:
- /* Line 1787 of yacc.c */
- #line 1597 "awkgram.y"
-#line 1596 "awkgram.y" /* yacc.c:1646 */
++#line 1597 "awkgram.y" /* yacc.c:1646 */
{
- func_use((yyvsp[(1) - (1)])->lasti->func_name, FUNC_USE);
- (yyval) = (yyvsp[(1) - (1)]);
+ func_use((yyvsp[0])->lasti->func_name, FUNC_USE);
+ (yyval) = (yyvsp[0]);
}
-#line 3659 "awkgram.c" /* yacc.c:1646 */
++#line 3660 "awkgram.c" /* yacc.c:1646 */
break;
case 161:
- /* Line 1787 of yacc.c */
- #line 1602 "awkgram.y"
-#line 1601 "awkgram.y" /* yacc.c:1646 */
++#line 1602 "awkgram.y" /* yacc.c:1646 */
{
/* indirect function call */
INSTRUCTION *f, *t;
@@@ -3896,71 -3690,71 +3691,71 @@@
* @f(f="real_fun")
*/
- (yyval) = list_prepend((yyvsp[(2) - (2)]), t);
+ (yyval) = list_prepend((yyvsp[0]), t);
}
-#line 3696 "awkgram.c" /* yacc.c:1646 */
++#line 3697 "awkgram.c" /* yacc.c:1646 */
break;
case 162:
- /* Line 1787 of yacc.c */
- #line 1638 "awkgram.y"
-#line 1637 "awkgram.y" /* yacc.c:1646 */
++#line 1638 "awkgram.y" /* yacc.c:1646 */
{
- param_sanity((yyvsp[(3) - (4)]));
- (yyvsp[(1) - (4)])->opcode = Op_func_call;
- (yyvsp[(1) - (4)])->func_body = NULL;
- if ((yyvsp[(3) - (4)]) == NULL) { /* no argument or error
*/
- ((yyvsp[(1) - (4)]) + 1)->expr_count = 0;
- (yyval) = list_create((yyvsp[(1) - (4)]));
+ param_sanity((yyvsp[-1]));
+ (yyvsp[-3])->opcode = Op_func_call;
+ (yyvsp[-3])->func_body = NULL;
+ if ((yyvsp[-1]) == NULL) { /* no argument or error */
+ ((yyvsp[-3]) + 1)->expr_count = 0;
+ (yyval) = list_create((yyvsp[-3]));
} else {
- INSTRUCTION *t = (yyvsp[(3) - (4)]);
- ((yyvsp[(1) - (4)]) + 1)->expr_count =
count_expressions(&t, true);
- (yyval) = list_append(t, (yyvsp[(1) - (4)]));
+ INSTRUCTION *t = (yyvsp[-1]);
+ ((yyvsp[-3]) + 1)->expr_count = count_expressions(&t,
true);
+ (yyval) = list_append(t, (yyvsp[-3]));
}
}
-#line 3714 "awkgram.c" /* yacc.c:1646 */
++#line 3715 "awkgram.c" /* yacc.c:1646 */
break;
case 163:
- /* Line 1787 of yacc.c */
- #line 1655 "awkgram.y"
-#line 1654 "awkgram.y" /* yacc.c:1646 */
++#line 1655 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3720 "awkgram.c" /* yacc.c:1646 */
++#line 3721 "awkgram.c" /* yacc.c:1646 */
break;
case 164:
- /* Line 1787 of yacc.c */
- #line 1657 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1656 "awkgram.y" /* yacc.c:1646 */
++#line 1657 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3726 "awkgram.c" /* yacc.c:1646 */
++#line 3727 "awkgram.c" /* yacc.c:1646 */
break;
case 165:
- /* Line 1787 of yacc.c */
- #line 1662 "awkgram.y"
-#line 1661 "awkgram.y" /* yacc.c:1646 */
++#line 1662 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3732 "awkgram.c" /* yacc.c:1646 */
++#line 3733 "awkgram.c" /* yacc.c:1646 */
break;
case 166:
- /* Line 1787 of yacc.c */
- #line 1664 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (2)]); }
-#line 1663 "awkgram.y" /* yacc.c:1646 */
++#line 1664 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[-1]); }
-#line 3738 "awkgram.c" /* yacc.c:1646 */
++#line 3739 "awkgram.c" /* yacc.c:1646 */
break;
case 167:
- /* Line 1787 of yacc.c */
- #line 1669 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1668 "awkgram.y" /* yacc.c:1646 */
++#line 1669 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3744 "awkgram.c" /* yacc.c:1646 */
++#line 3745 "awkgram.c" /* yacc.c:1646 */
break;
case 168:
- /* Line 1787 of yacc.c */
- #line 1671 "awkgram.y"
-#line 1670 "awkgram.y" /* yacc.c:1646 */
++#line 1671 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
+ (yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 3752 "awkgram.c" /* yacc.c:1646 */
++#line 3753 "awkgram.c" /* yacc.c:1646 */
break;
case 169:
- /* Line 1787 of yacc.c */
- #line 1678 "awkgram.y"
-#line 1677 "awkgram.y" /* yacc.c:1646 */
++#line 1678 "awkgram.y" /* yacc.c:1646 */
{
- INSTRUCTION *ip = (yyvsp[(1) - (1)])->lasti;
+ INSTRUCTION *ip = (yyvsp[0])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated
expressions */
if (count > 1) {
/* change Op_subscript or Op_sub_array to Op_concat */
@@@ -3970,152 -3764,152 +3765,152 @@@
} else
ip->opcode = Op_no_op;
sub_counter++; /* count # of dimensions */
- (yyval) = (yyvsp[(1) - (1)]);
+ (yyval) = (yyvsp[0]);
}
-#line 3770 "awkgram.c" /* yacc.c:1646 */
++#line 3771 "awkgram.c" /* yacc.c:1646 */
break;
case 170:
- /* Line 1787 of yacc.c */
- #line 1695 "awkgram.y"
-#line 1694 "awkgram.y" /* yacc.c:1646 */
++#line 1695 "awkgram.y" /* yacc.c:1646 */
{
- INSTRUCTION *t = (yyvsp[(2) - (3)]);
- if ((yyvsp[(2) - (3)]) == NULL) {
- error_ln((yyvsp[(3) - (3)])->source_line,
+ INSTRUCTION *t = (yyvsp[-1]);
+ if ((yyvsp[-1]) == NULL) {
+ error_ln((yyvsp[0])->source_line,
_("invalid subscript expression"));
/* install Null string as subscript. */
t = list_create(instruction(Op_push_i));
t->nexti->memory = dupnode(Nnull_string);
- (yyvsp[(3) - (3)])->sub_count = 1;
+ (yyvsp[0])->sub_count = 1;
} else
- (yyvsp[(3) - (3)])->sub_count = count_expressions(&t,
false);
- (yyval) = list_append(t, (yyvsp[(3) - (3)]));
+ (yyvsp[0])->sub_count = count_expressions(&t, false);
+ (yyval) = list_append(t, (yyvsp[0]));
}
-#line 3788 "awkgram.c" /* yacc.c:1646 */
++#line 3789 "awkgram.c" /* yacc.c:1646 */
break;
case 171:
- /* Line 1787 of yacc.c */
- #line 1712 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
-#line 1711 "awkgram.y" /* yacc.c:1646 */
++#line 1712 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
-#line 3794 "awkgram.c" /* yacc.c:1646 */
++#line 3795 "awkgram.c" /* yacc.c:1646 */
break;
case 172:
- /* Line 1787 of yacc.c */
- #line 1714 "awkgram.y"
-#line 1713 "awkgram.y" /* yacc.c:1646 */
++#line 1714 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
+ (yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 3802 "awkgram.c" /* yacc.c:1646 */
++#line 3803 "awkgram.c" /* yacc.c:1646 */
break;
case 173:
- /* Line 1787 of yacc.c */
- #line 1721 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (2)]); }
-#line 1720 "awkgram.y" /* yacc.c:1646 */
++#line 1721 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[-1]); }
-#line 3808 "awkgram.c" /* yacc.c:1646 */
++#line 3809 "awkgram.c" /* yacc.c:1646 */
break;
case 174:
- /* Line 1787 of yacc.c */
- #line 1726 "awkgram.y"
-#line 1725 "awkgram.y" /* yacc.c:1646 */
++#line 1726 "awkgram.y" /* yacc.c:1646 */
{
- char *var_name = (yyvsp[(1) - (1)])->lextok;
+ char *var_name = (yyvsp[0])->lextok;
- (yyvsp[(1) - (1)])->opcode = Op_push;
- (yyvsp[(1) - (1)])->memory = variable((yyvsp[(1) -
(1)])->source_line, var_name, Node_var_new);
- (yyval) = list_create((yyvsp[(1) - (1)]));
+ (yyvsp[0])->opcode = Op_push;
+ (yyvsp[0])->memory = variable((yyvsp[0])->source_line,
var_name, Node_var_new);
+ (yyval) = list_create((yyvsp[0]));
}
-#line 3820 "awkgram.c" /* yacc.c:1646 */
++#line 3821 "awkgram.c" /* yacc.c:1646 */
break;
case 175:
- /* Line 1787 of yacc.c */
- #line 1734 "awkgram.y"
-#line 1733 "awkgram.y" /* yacc.c:1646 */
++#line 1734 "awkgram.y" /* yacc.c:1646 */
{
- char *arr = (yyvsp[(1) - (2)])->lextok;
- (yyvsp[(1) - (2)])->memory = variable((yyvsp[(1) -
(2)])->source_line, arr, Node_var_new);
- (yyvsp[(1) - (2)])->opcode = Op_push_array;
- (yyval) = list_prepend((yyvsp[(2) - (2)]), (yyvsp[(1) - (2)]));
+ char *arr = (yyvsp[-1])->lextok;
+ (yyvsp[-1])->memory = variable((yyvsp[-1])->source_line, arr,
Node_var_new);
+ (yyvsp[-1])->opcode = Op_push_array;
+ (yyval) = list_prepend((yyvsp[0]), (yyvsp[-1]));
}
-#line 3831 "awkgram.c" /* yacc.c:1646 */
++#line 3832 "awkgram.c" /* yacc.c:1646 */
break;
case 176:
- /* Line 1787 of yacc.c */
- #line 1744 "awkgram.y"
-#line 1743 "awkgram.y" /* yacc.c:1646 */
++#line 1744 "awkgram.y" /* yacc.c:1646 */
{
- INSTRUCTION *ip = (yyvsp[(1) - (1)])->nexti;
+ INSTRUCTION *ip = (yyvsp[0])->nexti;
if (ip->opcode == Op_push
&& ip->memory->type == Node_var
&& ip->memory->var_update
) {
- (yyval) = list_prepend((yyvsp[(1) - (1)]),
instruction(Op_var_update));
+ (yyval) = list_prepend((yyvsp[0]),
instruction(Op_var_update));
(yyval)->nexti->update_var = ip->memory->var_update;
} else
- (yyval) = (yyvsp[(1) - (1)]);
+ (yyval) = (yyvsp[0]);
}
-#line 3847 "awkgram.c" /* yacc.c:1646 */
++#line 3848 "awkgram.c" /* yacc.c:1646 */
break;
case 177:
- /* Line 1787 of yacc.c */
- #line 1756 "awkgram.y"
-#line 1755 "awkgram.y" /* yacc.c:1646 */
++#line 1756 "awkgram.y" /* yacc.c:1646 */
{
- (yyval) = list_append((yyvsp[(2) - (3)]), (yyvsp[(1) - (3)]));
- if ((yyvsp[(3) - (3)]) != NULL)
- mk_assignment((yyvsp[(2) - (3)]), NULL, (yyvsp[(3) -
(3)]));
+ (yyval) = list_append((yyvsp[-1]), (yyvsp[-2]));
+ if ((yyvsp[0]) != NULL)
+ mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3857 "awkgram.c" /* yacc.c:1646 */
++#line 3858 "awkgram.c" /* yacc.c:1646 */
break;
case 178:
- /* Line 1787 of yacc.c */
- #line 1765 "awkgram.y"
-#line 1764 "awkgram.y" /* yacc.c:1646 */
++#line 1765 "awkgram.y" /* yacc.c:1646 */
{
- (yyvsp[(1) - (1)])->opcode = Op_postincrement;
+ (yyvsp[0])->opcode = Op_postincrement;
}
-#line 3865 "awkgram.c" /* yacc.c:1646 */
++#line 3866 "awkgram.c" /* yacc.c:1646 */
break;
case 179:
- /* Line 1787 of yacc.c */
- #line 1769 "awkgram.y"
-#line 1768 "awkgram.y" /* yacc.c:1646 */
++#line 1769 "awkgram.y" /* yacc.c:1646 */
{
- (yyvsp[(1) - (1)])->opcode = Op_postdecrement;
+ (yyvsp[0])->opcode = Op_postdecrement;
}
-#line 3873 "awkgram.c" /* yacc.c:1646 */
++#line 3874 "awkgram.c" /* yacc.c:1646 */
break;
case 180:
- /* Line 1787 of yacc.c */
- #line 1772 "awkgram.y"
-#line 1771 "awkgram.y" /* yacc.c:1646 */
++#line 1772 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3879 "awkgram.c" /* yacc.c:1646 */
++#line 3880 "awkgram.c" /* yacc.c:1646 */
break;
case 182:
- /* Line 1787 of yacc.c */
- #line 1780 "awkgram.y"
-#line 1779 "awkgram.y" /* yacc.c:1646 */
++#line 1780 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 3885 "awkgram.c" /* yacc.c:1646 */
++#line 3886 "awkgram.c" /* yacc.c:1646 */
break;
case 183:
- /* Line 1787 of yacc.c */
- #line 1784 "awkgram.y"
-#line 1783 "awkgram.y" /* yacc.c:1646 */
++#line 1784 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 3891 "awkgram.c" /* yacc.c:1646 */
++#line 3892 "awkgram.c" /* yacc.c:1646 */
break;
case 186:
- /* Line 1787 of yacc.c */
- #line 1793 "awkgram.y"
-#line 1792 "awkgram.y" /* yacc.c:1646 */
++#line 1793 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 3897 "awkgram.c" /* yacc.c:1646 */
++#line 3898 "awkgram.c" /* yacc.c:1646 */
break;
case 187:
- /* Line 1787 of yacc.c */
- #line 1797 "awkgram.y"
- { (yyval) = (yyvsp[(1) - (1)]); yyerrok; }
-#line 1796 "awkgram.y" /* yacc.c:1646 */
++#line 1797 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); yyerrok; }
-#line 3903 "awkgram.c" /* yacc.c:1646 */
++#line 3904 "awkgram.c" /* yacc.c:1646 */
break;
case 188:
- /* Line 1787 of yacc.c */
- #line 1801 "awkgram.y"
-#line 1800 "awkgram.y" /* yacc.c:1646 */
++#line 1801 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 3909 "awkgram.c" /* yacc.c:1646 */
++#line 3910 "awkgram.c" /* yacc.c:1646 */
break;
- /* Line 1787 of yacc.c */
- #line 4119 "awkgram.c"
-#line 3913 "awkgram.c" /* yacc.c:1646 */
++#line 3914 "awkgram.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@@ -4341,13 -4135,9 +4136,9 @@@ yyreturn
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
#endif
- /* Make sure YYID is used. */
- return YYID (yyresult);
+ return yyresult;
}
-
-
- /* Line 2050 of yacc.c */
- #line 1803 "awkgram.y"
-#line 1802 "awkgram.y" /* yacc.c:1906 */
++#line 1803 "awkgram.y" /* yacc.c:1906 */
struct token {
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=612b31c0e68843be0d39fc7f97b081456a71cb25
commit 612b31c0e68843be0d39fc7f97b081456a71cb25
Merge: 866fc6f f934f21
Author: Arnold D. Robbins <address@hidden>
Date: Sun Jan 12 20:31:01 2014 +0200
Merge branch 'master' into async-events
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=866fc6f036a902da4a8648340a8308b74ef83a9a
commit 866fc6f036a902da4a8648340a8308b74ef83a9a
Merge: 8f3e09f 8aa14c5
Author: Arnold D. Robbins <address@hidden>
Date: Sun Sep 22 16:57:31 2013 +0300
Merge branch 'master' into async-events
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=8f3e09f427923c2f4b903261b388cae3527649d2
commit 8f3e09f427923c2f4b903261b388cae3527649d2
Merge: a8d13c8 b9a7f4a
Author: Arnold D. Robbins <address@hidden>
Date: Thu Jul 4 11:59:33 2013 +0300
Merge branch 'master' into async-events
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=a8d13c878fe50e22d34695ba352ce34d229f31eb
commit a8d13c878fe50e22d34695ba352ce34d229f31eb
Merge: b18d519 ddd5dad
Author: Arnold D. Robbins <address@hidden>
Date: Thu Jul 4 11:41:30 2013 +0300
Merge branch 'master' into async-events
diff --cc ChangeLog
index 631436f,c6a32d6..67f2b98
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,23 -1,16 +1,34 @@@
+ 2013-07-04 Arnold D. Robbins <address@hidden>
+
+ * builtin.c (format_tree): Fixes for %c with multibyte characters
+ and field width > 1. Bugs reported by Nethox <address@hidden>.
+
+ 2013-07-02 Arnold D. Robbins <address@hidden>
+
+ * profile.c (pp_string): Add a call to chksize and fix another.
+ Avoids valgrind errors on profile5 test. Thanks to Andrew
+ Schorr for the report.
+
2013-06-27 Arnold D. Robbins <address@hidden>
+ * awk.h (Op_end_stmt): New opcode.
+ (async_pending, run_async_handlers): Add declarations.
+ * awkgram.y (statements): Append Op_end_stmt op code at end of
statement.
+ * eval.c (optypetab): Add entry for Op_end_stmt.
+ * gawkapi.c (async_pending): New variable.
+ (api_register_async_callback, api_notify_async_event,
run_async_handlers):
+ New routines.
+ (api_impl): Add entries for new fields.
+ * gawkapi.h (GAWK_API_MINOR_VERSION): Bump up to 1.
+ (awk_async_callback_t): New type.
+ (struct gawk_api): Add two new fields: api_register_async_callback,
+ and api_notify_async_event.
+ (register_async_callback, notify_async_event): New macros.
+ * interpret.h (r_interpret): Add case for Op_end_stmt.
+ * profile.c (pprint): Ditto.
+
+2013-06-27 Arnold D. Robbins <address@hidden>
+
* awkgram.y: Minor whitespace cleanup, remove redundant ifdef.
2013-06-24 Arnold D. Robbins <address@hidden>
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=b18d519584d9a92d382bbb73825bed5fbb87a954
commit b18d519584d9a92d382bbb73825bed5fbb87a954
Merge: 8d2212b d128c19
Author: Arnold D. Robbins <address@hidden>
Date: Thu Jun 27 15:13:49 2013 +0300
Merge branch 'master' into async-events
diff --cc ChangeLog
index c570a1b,9cdaf0b..631436f
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,21 -1,6 +1,24 @@@
2013-06-27 Arnold D. Robbins <address@hidden>
+ * awk.h (Op_end_stmt): New opcode.
+ (async_pending, run_async_handlers): Add declarations.
+ * awkgram.y (statements): Append Op_end_stmt op code at end of
statement.
+ * eval.c (optypetab): Add entry for Op_end_stmt.
+ * gawkapi.c (async_pending): New variable.
+ (api_register_async_callback, api_notify_async_event,
run_async_handlers):
+ New routines.
+ (api_impl): Add entries for new fields.
+ * gawkapi.h (GAWK_API_MINOR_VERSION): Bump up to 1.
+ (awk_async_callback_t): New type.
+ (struct gawk_api): Add two new fields: api_register_async_callback,
+ and api_notify_async_event.
+ (register_async_callback, notify_async_event): New macros.
+ * interpret.h (r_interpret): Add case for Op_end_stmt.
+ * profile.c (pprint): Ditto.
+
++2013-06-27 Arnold D. Robbins <address@hidden>
++
+ * awkgram.y: Minor whitespace cleanup, remove redundant ifdef.
2013-06-24 Arnold D. Robbins <address@hidden>
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=8d2212b137df2193607a649d0f9239cf64a289de
commit 8d2212b137df2193607a649d0f9239cf64a289de
Author: Arnold D. Robbins <address@hidden>
Date: Thu Jun 27 12:14:53 2013 +0300
Add Op_end_stmt and async_event callbacks in API.
diff --git a/ChangeLog b/ChangeLog
index 33f2d31..c570a1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2013-06-27 Arnold D. Robbins <address@hidden>
+
+ * awk.h (Op_end_stmt): New opcode.
+ (async_pending, run_async_handlers): Add declarations.
+ * awkgram.y (statements): Append Op_end_stmt op code at end of
statement.
+ * eval.c (optypetab): Add entry for Op_end_stmt.
+ * gawkapi.c (async_pending): New variable.
+ (api_register_async_callback, api_notify_async_event,
run_async_handlers):
+ New routines.
+ (api_impl): Add entries for new fields.
+ * gawkapi.h (GAWK_API_MINOR_VERSION): Bump up to 1.
+ (awk_async_callback_t): New type.
+ (struct gawk_api): Add two new fields: api_register_async_callback,
+ and api_notify_async_event.
+ (register_async_callback, notify_async_event): New macros.
+ * interpret.h (r_interpret): Add case for Op_end_stmt.
+ * profile.c (pprint): Ditto.
+
+
2013-06-24 Arnold D. Robbins <address@hidden>
* dfa.c (copytoks): Rewrite to call addtok_mb() directly. Avoids
diff --git a/awk.h b/awk.h
index b9d3a1b..12af605 100644
--- a/awk.h
+++ b/awk.h
@@ -675,6 +675,7 @@ typedef enum opcodeval {
Op_exec_count,
Op_breakpoint,
+ Op_end_stmt, /* sync point, end of statement */
Op_lint,
Op_atexit,
Op_stop,
@@ -1491,6 +1492,8 @@ extern void update_ext_api(void);
extern NODE *awk_value_to_node(const awk_value_t *);
extern void run_ext_exit_handlers(int exitval);
extern void print_ext_versions(void);
+extern void run_async_handlers(void);
+extern volatile bool async_pending;
/* gawkmisc.c */
extern char *gawk_name(const char *filespec);
diff --git a/awkgram.c b/awkgram.c
index 10fd421..fac6702 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -747,22 +747,22 @@ static const yytype_uint16 yyrline[] =
0, 200, 200, 202, 207, 208, 214, 226, 230, 241,
247, 252, 260, 268, 270, 275, 283, 285, 291, 292,
294, 320, 331, 342, 348, 357, 367, 369, 371, 377,
- 382, 383, 387, 406, 405, 439, 441, 446, 447, 460,
- 465, 466, 470, 472, 474, 481, 571, 613, 655, 768,
- 775, 782, 792, 801, 810, 819, 830, 846, 845, 869,
- 881, 881, 979, 979, 1012, 1042, 1048, 1049, 1055, 1056,
- 1063, 1068, 1080, 1094, 1096, 1104, 1109, 1111, 1119, 1121,
- 1130, 1131, 1139, 1144, 1144, 1155, 1159, 1167, 1168, 1171,
- 1173, 1178, 1179, 1188, 1189, 1194, 1199, 1205, 1207, 1209,
- 1216, 1217, 1223, 1224, 1229, 1231, 1236, 1238, 1246, 1251,
- 1260, 1267, 1269, 1271, 1287, 1297, 1304, 1306, 1311, 1313,
- 1315, 1323, 1325, 1330, 1332, 1337, 1339, 1341, 1391, 1393,
- 1395, 1397, 1399, 1401, 1403, 1405, 1428, 1433, 1438, 1463,
- 1469, 1471, 1473, 1475, 1477, 1479, 1484, 1488, 1520, 1522,
- 1528, 1534, 1547, 1548, 1549, 1554, 1559, 1563, 1567, 1582,
- 1595, 1600, 1636, 1654, 1655, 1661, 1662, 1667, 1669, 1676,
- 1693, 1710, 1712, 1719, 1724, 1732, 1742, 1754, 1763, 1767,
- 1771, 1775, 1779, 1783, 1786, 1788, 1792, 1796, 1800
+ 382, 383, 387, 406, 405, 439, 441, 446, 447, 461,
+ 466, 467, 471, 473, 475, 482, 572, 614, 656, 769,
+ 776, 783, 793, 802, 811, 820, 831, 847, 846, 870,
+ 882, 882, 980, 980, 1013, 1043, 1049, 1050, 1056, 1057,
+ 1064, 1069, 1081, 1095, 1097, 1105, 1110, 1112, 1120, 1122,
+ 1131, 1132, 1140, 1145, 1145, 1156, 1160, 1168, 1169, 1172,
+ 1174, 1179, 1180, 1189, 1190, 1195, 1200, 1206, 1208, 1210,
+ 1217, 1218, 1224, 1225, 1230, 1232, 1237, 1239, 1247, 1252,
+ 1261, 1268, 1270, 1272, 1288, 1298, 1305, 1307, 1312, 1314,
+ 1316, 1324, 1326, 1331, 1333, 1338, 1340, 1342, 1392, 1394,
+ 1396, 1398, 1400, 1402, 1404, 1406, 1429, 1434, 1439, 1464,
+ 1470, 1472, 1474, 1476, 1478, 1480, 1485, 1489, 1521, 1523,
+ 1529, 1535, 1548, 1549, 1550, 1555, 1560, 1564, 1568, 1583,
+ 1596, 1601, 1637, 1655, 1656, 1662, 1663, 1668, 1670, 1677,
+ 1694, 1711, 1713, 1720, 1725, 1733, 1743, 1755, 1764, 1768,
+ 1772, 1776, 1780, 1784, 1787, 1789, 1793, 1797, 1801
};
#endif
@@ -2388,31 +2388,32 @@ yyreduce:
else
(yyval) = list_merge((yyvsp[(1) - (2)]),
(yyvsp[(2) - (2)]));
}
+ list_append((yyval), instruction(Op_end_stmt));
yyerrok;
}
break;
case 39:
/* Line 1787 of yacc.c */
-#line 461 "awkgram.y"
+#line 462 "awkgram.y"
{ (yyval) = NULL; }
break;
case 42:
/* Line 1787 of yacc.c */
-#line 471 "awkgram.y"
+#line 472 "awkgram.y"
{ (yyval) = NULL; }
break;
case 43:
/* Line 1787 of yacc.c */
-#line 473 "awkgram.y"
+#line 474 "awkgram.y"
{ (yyval) = (yyvsp[(2) - (3)]); }
break;
case 44:
/* Line 1787 of yacc.c */
-#line 475 "awkgram.y"
+#line 476 "awkgram.y"
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[(1) - (1)]),
instruction(Op_exec_count));
@@ -2423,7 +2424,7 @@ yyreduce:
case 45:
/* Line 1787 of yacc.c */
-#line 482 "awkgram.y"
+#line 483 "awkgram.y"
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@ -2517,7 +2518,7 @@ yyreduce:
case 46:
/* Line 1787 of yacc.c */
-#line 572 "awkgram.y"
+#line 573 "awkgram.y"
{
/*
* -----------------
@@ -2563,7 +2564,7 @@ yyreduce:
case 47:
/* Line 1787 of yacc.c */
-#line 614 "awkgram.y"
+#line 615 "awkgram.y"
{
/*
* -----------------
@@ -2609,7 +2610,7 @@ yyreduce:
case 48:
/* Line 1787 of yacc.c */
-#line 656 "awkgram.y"
+#line 657 "awkgram.y"
{
INSTRUCTION *ip;
char *var_name = (yyvsp[(3) - (8)])->lextok;
@@ -2726,7 +2727,7 @@ regular_loop:
case 49:
/* Line 1787 of yacc.c */
-#line 769 "awkgram.y"
+#line 770 "awkgram.y"
{
(yyval) = mk_for_loop((yyvsp[(1) - (12)]), (yyvsp[(3) - (12)]),
(yyvsp[(6) - (12)]), (yyvsp[(9) - (12)]), (yyvsp[(12) - (12)]));
@@ -2737,7 +2738,7 @@ regular_loop:
case 50:
/* Line 1787 of yacc.c */
-#line 776 "awkgram.y"
+#line 777 "awkgram.y"
{
(yyval) = mk_for_loop((yyvsp[(1) - (11)]), (yyvsp[(3) - (11)]),
(INSTRUCTION *) NULL, (yyvsp[(8) - (11)]), (yyvsp[(11) - (11)]));
@@ -2748,7 +2749,7 @@ regular_loop:
case 51:
/* Line 1787 of yacc.c */
-#line 783 "awkgram.y"
+#line 784 "awkgram.y"
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[(1) - (1)]),
instruction(Op_exec_count));
@@ -2759,7 +2760,7 @@ regular_loop:
case 52:
/* Line 1787 of yacc.c */
-#line 793 "awkgram.y"
+#line 794 "awkgram.y"
{
if (! break_allowed)
error_ln((yyvsp[(1) - (2)])->source_line,
@@ -2772,7 +2773,7 @@ regular_loop:
case 53:
/* Line 1787 of yacc.c */
-#line 802 "awkgram.y"
+#line 803 "awkgram.y"
{
if (! continue_allowed)
error_ln((yyvsp[(1) - (2)])->source_line,
@@ -2785,7 +2786,7 @@ regular_loop:
case 54:
/* Line 1787 of yacc.c */
-#line 811 "awkgram.y"
+#line 812 "awkgram.y"
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
@@ -2798,7 +2799,7 @@ regular_loop:
case 55:
/* Line 1787 of yacc.c */
-#line 820 "awkgram.y"
+#line 821 "awkgram.y"
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule == BEGIN || rule == END || rule == ENDFILE)
@@ -2813,7 +2814,7 @@ regular_loop:
case 56:
/* Line 1787 of yacc.c */
-#line 831 "awkgram.y"
+#line 832 "awkgram.y"
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@ -2832,7 +2833,7 @@ regular_loop:
case 57:
/* Line 1787 of yacc.c */
-#line 846 "awkgram.y"
+#line 847 "awkgram.y"
{
if (! in_function)
yyerror(_("`return' used outside function context"));
@@ -2841,7 +2842,7 @@ regular_loop:
case 58:
/* Line 1787 of yacc.c */
-#line 849 "awkgram.y"
+#line 850 "awkgram.y"
{
if ((yyvsp[(3) - (4)]) == NULL) {
(yyval) = list_create((yyvsp[(1) - (4)]));
@@ -2866,13 +2867,13 @@ regular_loop:
case 60:
/* Line 1787 of yacc.c */
-#line 881 "awkgram.y"
+#line 882 "awkgram.y"
{ in_print = true; in_parens = 0; }
break;
case 61:
/* Line 1787 of yacc.c */
-#line 882 "awkgram.y"
+#line 883 "awkgram.y"
{
/*
* Optimization: plain `print' has no expression list, so $3 is
null.
@@ -2973,13 +2974,13 @@ regular_print:
case 62:
/* Line 1787 of yacc.c */
-#line 979 "awkgram.y"
+#line 980 "awkgram.y"
{ sub_counter = 0; }
break;
case 63:
/* Line 1787 of yacc.c */
-#line 980 "awkgram.y"
+#line 981 "awkgram.y"
{
char *arr = (yyvsp[(2) - (4)])->lextok;
@@ -3016,7 +3017,7 @@ regular_print:
case 64:
/* Line 1787 of yacc.c */
-#line 1017 "awkgram.y"
+#line 1018 "awkgram.y"
{
static bool warned = false;
char *arr = (yyvsp[(3) - (4)])->lextok;
@@ -3046,31 +3047,31 @@ regular_print:
case 65:
/* Line 1787 of yacc.c */
-#line 1043 "awkgram.y"
+#line 1044 "awkgram.y"
{ (yyval) = optimize_assignment((yyvsp[(1) - (1)])); }
break;
case 66:
/* Line 1787 of yacc.c */
-#line 1048 "awkgram.y"
+#line 1049 "awkgram.y"
{ (yyval) = NULL; }
break;
case 67:
/* Line 1787 of yacc.c */
-#line 1050 "awkgram.y"
+#line 1051 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 68:
/* Line 1787 of yacc.c */
-#line 1055 "awkgram.y"
+#line 1056 "awkgram.y"
{ (yyval) = NULL; }
break;
case 69:
/* Line 1787 of yacc.c */
-#line 1057 "awkgram.y"
+#line 1058 "awkgram.y"
{
if ((yyvsp[(1) - (2)]) == NULL)
(yyval) = list_create((yyvsp[(2) - (2)]));
@@ -3081,13 +3082,13 @@ regular_print:
case 70:
/* Line 1787 of yacc.c */
-#line 1064 "awkgram.y"
+#line 1065 "awkgram.y"
{ (yyval) = NULL; }
break;
case 71:
/* Line 1787 of yacc.c */
-#line 1069 "awkgram.y"
+#line 1070 "awkgram.y"
{
INSTRUCTION *casestmt = (yyvsp[(5) - (5)]);
if ((yyvsp[(5) - (5)]) == NULL)
@@ -3103,7 +3104,7 @@ regular_print:
case 72:
/* Line 1787 of yacc.c */
-#line 1081 "awkgram.y"
+#line 1082 "awkgram.y"
{
INSTRUCTION *casestmt = (yyvsp[(4) - (4)]);
if ((yyvsp[(4) - (4)]) == NULL)
@@ -3118,13 +3119,13 @@ regular_print:
case 73:
/* Line 1787 of yacc.c */
-#line 1095 "awkgram.y"
+#line 1096 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 74:
/* Line 1787 of yacc.c */
-#line 1097 "awkgram.y"
+#line 1098 "awkgram.y"
{
NODE *n = (yyvsp[(2) - (2)])->memory;
(void) force_number(n);
@@ -3136,7 +3137,7 @@ regular_print:
case 75:
/* Line 1787 of yacc.c */
-#line 1105 "awkgram.y"
+#line 1106 "awkgram.y"
{
bcfree((yyvsp[(1) - (2)]));
(yyval) = (yyvsp[(2) - (2)]);
@@ -3145,13 +3146,13 @@ regular_print:
case 76:
/* Line 1787 of yacc.c */
-#line 1110 "awkgram.y"
+#line 1111 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 77:
/* Line 1787 of yacc.c */
-#line 1112 "awkgram.y"
+#line 1113 "awkgram.y"
{
(yyvsp[(1) - (1)])->opcode = Op_push_re;
(yyval) = (yyvsp[(1) - (1)]);
@@ -3160,19 +3161,19 @@ regular_print:
case 78:
/* Line 1787 of yacc.c */
-#line 1120 "awkgram.y"
+#line 1121 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 79:
/* Line 1787 of yacc.c */
-#line 1122 "awkgram.y"
+#line 1123 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 81:
/* Line 1787 of yacc.c */
-#line 1132 "awkgram.y"
+#line 1133 "awkgram.y"
{
(yyval) = (yyvsp[(2) - (3)]);
}
@@ -3180,7 +3181,7 @@ regular_print:
case 82:
/* Line 1787 of yacc.c */
-#line 1139 "awkgram.y"
+#line 1140 "awkgram.y"
{
in_print = false;
in_parens = 0;
@@ -3190,13 +3191,13 @@ regular_print:
case 83:
/* Line 1787 of yacc.c */
-#line 1144 "awkgram.y"
+#line 1145 "awkgram.y"
{ in_print = false; in_parens = 0; }
break;
case 84:
/* Line 1787 of yacc.c */
-#line 1145 "awkgram.y"
+#line 1146 "awkgram.y"
{
if ((yyvsp[(1) - (3)])->redir_type == redirect_twoway
&& (yyvsp[(3) - (3)])->lasti->opcode ==
Op_K_getline_redir
@@ -3208,7 +3209,7 @@ regular_print:
case 85:
/* Line 1787 of yacc.c */
-#line 1156 "awkgram.y"
+#line 1157 "awkgram.y"
{
(yyval) = mk_condition((yyvsp[(3) - (6)]), (yyvsp[(1) - (6)]),
(yyvsp[(6) - (6)]), NULL, NULL);
}
@@ -3216,7 +3217,7 @@ regular_print:
case 86:
/* Line 1787 of yacc.c */
-#line 1161 "awkgram.y"
+#line 1162 "awkgram.y"
{
(yyval) = mk_condition((yyvsp[(3) - (9)]), (yyvsp[(1) - (9)]),
(yyvsp[(6) - (9)]), (yyvsp[(7) - (9)]), (yyvsp[(9) - (9)]));
}
@@ -3224,13 +3225,13 @@ regular_print:
case 91:
/* Line 1787 of yacc.c */
-#line 1178 "awkgram.y"
+#line 1179 "awkgram.y"
{ (yyval) = NULL; }
break;
case 92:
/* Line 1787 of yacc.c */
-#line 1180 "awkgram.y"
+#line 1181 "awkgram.y"
{
bcfree((yyvsp[(1) - (2)]));
(yyval) = (yyvsp[(2) - (2)]);
@@ -3239,19 +3240,19 @@ regular_print:
case 93:
/* Line 1787 of yacc.c */
-#line 1188 "awkgram.y"
+#line 1189 "awkgram.y"
{ (yyval) = NULL; }
break;
case 94:
/* Line 1787 of yacc.c */
-#line 1190 "awkgram.y"
+#line 1191 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]) ; }
break;
case 95:
/* Line 1787 of yacc.c */
-#line 1195 "awkgram.y"
+#line 1196 "awkgram.y"
{
(yyvsp[(1) - (1)])->param_count = 0;
(yyval) = list_create((yyvsp[(1) - (1)]));
@@ -3260,7 +3261,7 @@ regular_print:
case 96:
/* Line 1787 of yacc.c */
-#line 1200 "awkgram.y"
+#line 1201 "awkgram.y"
{
(yyvsp[(3) - (3)])->param_count = (yyvsp[(1) -
(3)])->lasti->param_count + 1;
(yyval) = list_append((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));
@@ -3270,55 +3271,55 @@ regular_print:
case 97:
/* Line 1787 of yacc.c */
-#line 1206 "awkgram.y"
+#line 1207 "awkgram.y"
{ (yyval) = NULL; }
break;
case 98:
/* Line 1787 of yacc.c */
-#line 1208 "awkgram.y"
+#line 1209 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (2)]); }
break;
case 99:
/* Line 1787 of yacc.c */
-#line 1210 "awkgram.y"
+#line 1211 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (3)]); }
break;
case 100:
/* Line 1787 of yacc.c */
-#line 1216 "awkgram.y"
+#line 1217 "awkgram.y"
{ (yyval) = NULL; }
break;
case 101:
/* Line 1787 of yacc.c */
-#line 1218 "awkgram.y"
+#line 1219 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 102:
/* Line 1787 of yacc.c */
-#line 1223 "awkgram.y"
+#line 1224 "awkgram.y"
{ (yyval) = NULL; }
break;
case 103:
/* Line 1787 of yacc.c */
-#line 1225 "awkgram.y"
+#line 1226 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 104:
/* Line 1787 of yacc.c */
-#line 1230 "awkgram.y"
+#line 1231 "awkgram.y"
{ (yyval) = mk_expression_list(NULL, (yyvsp[(1) - (1)])); }
break;
case 105:
/* Line 1787 of yacc.c */
-#line 1232 "awkgram.y"
+#line 1233 "awkgram.y"
{
(yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) -
(3)]));
yyerrok;
@@ -3327,13 +3328,13 @@ regular_print:
case 106:
/* Line 1787 of yacc.c */
-#line 1237 "awkgram.y"
+#line 1238 "awkgram.y"
{ (yyval) = NULL; }
break;
case 107:
/* Line 1787 of yacc.c */
-#line 1239 "awkgram.y"
+#line 1240 "awkgram.y"
{
/*
* Returning the expression list instead of NULL lets
@@ -3345,7 +3346,7 @@ regular_print:
case 108:
/* Line 1787 of yacc.c */
-#line 1247 "awkgram.y"
+#line 1248 "awkgram.y"
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) -
(3)]));
@@ -3354,7 +3355,7 @@ regular_print:
case 109:
/* Line 1787 of yacc.c */
-#line 1252 "awkgram.y"
+#line 1253 "awkgram.y"
{
/* Ditto */
(yyval) = (yyvsp[(1) - (3)]);
@@ -3363,7 +3364,7 @@ regular_print:
case 110:
/* Line 1787 of yacc.c */
-#line 1261 "awkgram.y"
+#line 1262 "awkgram.y"
{
if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode ==
Op_match_rec)
lintwarn_ln((yyvsp[(2) - (3)])->source_line,
@@ -3374,19 +3375,19 @@ regular_print:
case 111:
/* Line 1787 of yacc.c */
-#line 1268 "awkgram.y"
+#line 1269 "awkgram.y"
{ (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
break;
case 112:
/* Line 1787 of yacc.c */
-#line 1270 "awkgram.y"
+#line 1271 "awkgram.y"
{ (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2)
- (3)])); }
break;
case 113:
/* Line 1787 of yacc.c */
-#line 1272 "awkgram.y"
+#line 1273 "awkgram.y"
{
if ((yyvsp[(1) - (3)])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[(2) - (3)])->source_line,
@@ -3406,7 +3407,7 @@ regular_print:
case 114:
/* Line 1787 of yacc.c */
-#line 1288 "awkgram.y"
+#line 1289 "awkgram.y"
{
if (do_lint_old)
warning_ln((yyvsp[(2) - (3)])->source_line,
@@ -3420,7 +3421,7 @@ regular_print:
case 115:
/* Line 1787 of yacc.c */
-#line 1298 "awkgram.y"
+#line 1299 "awkgram.y"
{
if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode ==
Op_match_rec)
lintwarn_ln((yyvsp[(2) - (3)])->source_line,
@@ -3431,31 +3432,31 @@ regular_print:
case 116:
/* Line 1787 of yacc.c */
-#line 1305 "awkgram.y"
+#line 1306 "awkgram.y"
{ (yyval) = mk_condition((yyvsp[(1) - (5)]), (yyvsp[(2) - (5)]),
(yyvsp[(3) - (5)]), (yyvsp[(4) - (5)]), (yyvsp[(5) - (5)])); }
break;
case 117:
/* Line 1787 of yacc.c */
-#line 1307 "awkgram.y"
+#line 1308 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 118:
/* Line 1787 of yacc.c */
-#line 1312 "awkgram.y"
+#line 1313 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 119:
/* Line 1787 of yacc.c */
-#line 1314 "awkgram.y"
+#line 1315 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 120:
/* Line 1787 of yacc.c */
-#line 1316 "awkgram.y"
+#line 1317 "awkgram.y"
{
(yyvsp[(2) - (2)])->opcode = Op_assign_quotient;
(yyval) = (yyvsp[(2) - (2)]);
@@ -3464,43 +3465,43 @@ regular_print:
case 121:
/* Line 1787 of yacc.c */
-#line 1324 "awkgram.y"
+#line 1325 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 122:
/* Line 1787 of yacc.c */
-#line 1326 "awkgram.y"
+#line 1327 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 123:
/* Line 1787 of yacc.c */
-#line 1331 "awkgram.y"
+#line 1332 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 124:
/* Line 1787 of yacc.c */
-#line 1333 "awkgram.y"
+#line 1334 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 125:
/* Line 1787 of yacc.c */
-#line 1338 "awkgram.y"
+#line 1339 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 126:
/* Line 1787 of yacc.c */
-#line 1340 "awkgram.y"
+#line 1341 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 127:
/* Line 1787 of yacc.c */
-#line 1342 "awkgram.y"
+#line 1343 "awkgram.y"
{
int count = 2;
bool is_simple_var = false;
@@ -3551,43 +3552,43 @@ regular_print:
case 129:
/* Line 1787 of yacc.c */
-#line 1394 "awkgram.y"
+#line 1395 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) -
(3)])); }
break;
case 130:
/* Line 1787 of yacc.c */
-#line 1396 "awkgram.y"
+#line 1397 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) -
(3)])); }
break;
case 131:
/* Line 1787 of yacc.c */
-#line 1398 "awkgram.y"
+#line 1399 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) -
(3)])); }
break;
case 132:
/* Line 1787 of yacc.c */
-#line 1400 "awkgram.y"
+#line 1401 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) -
(3)])); }
break;
case 133:
/* Line 1787 of yacc.c */
-#line 1402 "awkgram.y"
+#line 1403 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) -
(3)])); }
break;
case 134:
/* Line 1787 of yacc.c */
-#line 1404 "awkgram.y"
+#line 1405 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) -
(3)])); }
break;
case 135:
/* Line 1787 of yacc.c */
-#line 1406 "awkgram.y"
+#line 1407 "awkgram.y"
{
/*
* In BEGINFILE/ENDFILE, allow `getline var < file'
@@ -3614,7 +3615,7 @@ regular_print:
case 136:
/* Line 1787 of yacc.c */
-#line 1429 "awkgram.y"
+#line 1430 "awkgram.y"
{
(yyvsp[(2) - (2)])->opcode = Op_postincrement;
(yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) -
(2)]));
@@ -3623,7 +3624,7 @@ regular_print:
case 137:
/* Line 1787 of yacc.c */
-#line 1434 "awkgram.y"
+#line 1435 "awkgram.y"
{
(yyvsp[(2) - (2)])->opcode = Op_postdecrement;
(yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) -
(2)]));
@@ -3632,7 +3633,7 @@ regular_print:
case 138:
/* Line 1787 of yacc.c */
-#line 1439 "awkgram.y"
+#line 1440 "awkgram.y"
{
if (do_lint_old) {
warning_ln((yyvsp[(4) - (5)])->source_line,
@@ -3656,7 +3657,7 @@ regular_print:
case 139:
/* Line 1787 of yacc.c */
-#line 1464 "awkgram.y"
+#line 1465 "awkgram.y"
{
(yyval) = mk_getline((yyvsp[(3) - (4)]), (yyvsp[(4) - (4)]),
(yyvsp[(1) - (4)]), (yyvsp[(2) - (4)])->redir_type);
bcfree((yyvsp[(2) - (4)]));
@@ -3665,43 +3666,43 @@ regular_print:
case 140:
/* Line 1787 of yacc.c */
-#line 1470 "awkgram.y"
+#line 1471 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) -
(3)])); }
break;
case 141:
/* Line 1787 of yacc.c */
-#line 1472 "awkgram.y"
+#line 1473 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) -
(3)])); }
break;
case 142:
/* Line 1787 of yacc.c */
-#line 1474 "awkgram.y"
+#line 1475 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) -
(3)])); }
break;
case 143:
/* Line 1787 of yacc.c */
-#line 1476 "awkgram.y"
+#line 1477 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) -
(3)])); }
break;
case 144:
/* Line 1787 of yacc.c */
-#line 1478 "awkgram.y"
+#line 1479 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) -
(3)])); }
break;
case 145:
/* Line 1787 of yacc.c */
-#line 1480 "awkgram.y"
+#line 1481 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) -
(3)])); }
break;
case 146:
/* Line 1787 of yacc.c */
-#line 1485 "awkgram.y"
+#line 1486 "awkgram.y"
{
(yyval) = list_create((yyvsp[(1) - (1)]));
}
@@ -3709,7 +3710,7 @@ regular_print:
case 147:
/* Line 1787 of yacc.c */
-#line 1489 "awkgram.y"
+#line 1490 "awkgram.y"
{
if ((yyvsp[(2) - (2)])->opcode == Op_match_rec) {
(yyvsp[(2) - (2)])->opcode = Op_nomatch;
@@ -3745,13 +3746,13 @@ regular_print:
case 148:
/* Line 1787 of yacc.c */
-#line 1521 "awkgram.y"
+#line 1522 "awkgram.y"
{ (yyval) = (yyvsp[(2) - (3)]); }
break;
case 149:
/* Line 1787 of yacc.c */
-#line 1523 "awkgram.y"
+#line 1524 "awkgram.y"
{
(yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)]));
if ((yyval) == NULL)
@@ -3761,7 +3762,7 @@ regular_print:
case 150:
/* Line 1787 of yacc.c */
-#line 1529 "awkgram.y"
+#line 1530 "awkgram.y"
{
(yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)]));
if ((yyval) == NULL)
@@ -3771,7 +3772,7 @@ regular_print:
case 151:
/* Line 1787 of yacc.c */
-#line 1535 "awkgram.y"
+#line 1536 "awkgram.y"
{
static bool warned = false;
@@ -3788,7 +3789,7 @@ regular_print:
case 154:
/* Line 1787 of yacc.c */
-#line 1550 "awkgram.y"
+#line 1551 "awkgram.y"
{
(yyvsp[(1) - (2)])->opcode = Op_preincrement;
(yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) -
(2)]));
@@ -3797,7 +3798,7 @@ regular_print:
case 155:
/* Line 1787 of yacc.c */
-#line 1555 "awkgram.y"
+#line 1556 "awkgram.y"
{
(yyvsp[(1) - (2)])->opcode = Op_predecrement;
(yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) -
(2)]));
@@ -3806,7 +3807,7 @@ regular_print:
case 156:
/* Line 1787 of yacc.c */
-#line 1560 "awkgram.y"
+#line 1561 "awkgram.y"
{
(yyval) = list_create((yyvsp[(1) - (1)]));
}
@@ -3814,7 +3815,7 @@ regular_print:
case 157:
/* Line 1787 of yacc.c */
-#line 1564 "awkgram.y"
+#line 1565 "awkgram.y"
{
(yyval) = list_create((yyvsp[(1) - (1)]));
}
@@ -3822,7 +3823,7 @@ regular_print:
case 158:
/* Line 1787 of yacc.c */
-#line 1568 "awkgram.y"
+#line 1569 "awkgram.y"
{
if ((yyvsp[(2) - (2)])->lasti->opcode == Op_push_i
&& ((yyvsp[(2) - (2)])->lasti->memory->flags &
(STRCUR|STRING)) == 0
@@ -3841,7 +3842,7 @@ regular_print:
case 159:
/* Line 1787 of yacc.c */
-#line 1583 "awkgram.y"
+#line 1584 "awkgram.y"
{
/*
* was: $$ = $2
@@ -3855,7 +3856,7 @@ regular_print:
case 160:
/* Line 1787 of yacc.c */
-#line 1596 "awkgram.y"
+#line 1597 "awkgram.y"
{
func_use((yyvsp[(1) - (1)])->lasti->func_name, FUNC_USE);
(yyval) = (yyvsp[(1) - (1)]);
@@ -3864,7 +3865,7 @@ regular_print:
case 161:
/* Line 1787 of yacc.c */
-#line 1601 "awkgram.y"
+#line 1602 "awkgram.y"
{
/* indirect function call */
INSTRUCTION *f, *t;
@@ -3901,7 +3902,7 @@ regular_print:
case 162:
/* Line 1787 of yacc.c */
-#line 1637 "awkgram.y"
+#line 1638 "awkgram.y"
{
param_sanity((yyvsp[(3) - (4)]));
(yyvsp[(1) - (4)])->opcode = Op_func_call;
@@ -3919,37 +3920,37 @@ regular_print:
case 163:
/* Line 1787 of yacc.c */
-#line 1654 "awkgram.y"
+#line 1655 "awkgram.y"
{ (yyval) = NULL; }
break;
case 164:
/* Line 1787 of yacc.c */
-#line 1656 "awkgram.y"
+#line 1657 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 165:
/* Line 1787 of yacc.c */
-#line 1661 "awkgram.y"
+#line 1662 "awkgram.y"
{ (yyval) = NULL; }
break;
case 166:
/* Line 1787 of yacc.c */
-#line 1663 "awkgram.y"
+#line 1664 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (2)]); }
break;
case 167:
/* Line 1787 of yacc.c */
-#line 1668 "awkgram.y"
+#line 1669 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 168:
/* Line 1787 of yacc.c */
-#line 1670 "awkgram.y"
+#line 1671 "awkgram.y"
{
(yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
}
@@ -3957,7 +3958,7 @@ regular_print:
case 169:
/* Line 1787 of yacc.c */
-#line 1677 "awkgram.y"
+#line 1678 "awkgram.y"
{
INSTRUCTION *ip = (yyvsp[(1) - (1)])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated
expressions */
@@ -3975,7 +3976,7 @@ regular_print:
case 170:
/* Line 1787 of yacc.c */
-#line 1694 "awkgram.y"
+#line 1695 "awkgram.y"
{
INSTRUCTION *t = (yyvsp[(2) - (3)]);
if ((yyvsp[(2) - (3)]) == NULL) {
@@ -3993,13 +3994,13 @@ regular_print:
case 171:
/* Line 1787 of yacc.c */
-#line 1711 "awkgram.y"
+#line 1712 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 172:
/* Line 1787 of yacc.c */
-#line 1713 "awkgram.y"
+#line 1714 "awkgram.y"
{
(yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
}
@@ -4007,13 +4008,13 @@ regular_print:
case 173:
/* Line 1787 of yacc.c */
-#line 1720 "awkgram.y"
+#line 1721 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (2)]); }
break;
case 174:
/* Line 1787 of yacc.c */
-#line 1725 "awkgram.y"
+#line 1726 "awkgram.y"
{
char *var_name = (yyvsp[(1) - (1)])->lextok;
@@ -4025,7 +4026,7 @@ regular_print:
case 175:
/* Line 1787 of yacc.c */
-#line 1733 "awkgram.y"
+#line 1734 "awkgram.y"
{
char *arr = (yyvsp[(1) - (2)])->lextok;
(yyvsp[(1) - (2)])->memory = variable((yyvsp[(1) -
(2)])->source_line, arr, Node_var_new);
@@ -4036,7 +4037,7 @@ regular_print:
case 176:
/* Line 1787 of yacc.c */
-#line 1743 "awkgram.y"
+#line 1744 "awkgram.y"
{
INSTRUCTION *ip = (yyvsp[(1) - (1)])->nexti;
if (ip->opcode == Op_push
@@ -4052,7 +4053,7 @@ regular_print:
case 177:
/* Line 1787 of yacc.c */
-#line 1755 "awkgram.y"
+#line 1756 "awkgram.y"
{
(yyval) = list_append((yyvsp[(2) - (3)]), (yyvsp[(1) - (3)]));
if ((yyvsp[(3) - (3)]) != NULL)
@@ -4062,7 +4063,7 @@ regular_print:
case 178:
/* Line 1787 of yacc.c */
-#line 1764 "awkgram.y"
+#line 1765 "awkgram.y"
{
(yyvsp[(1) - (1)])->opcode = Op_postincrement;
}
@@ -4070,7 +4071,7 @@ regular_print:
case 179:
/* Line 1787 of yacc.c */
-#line 1768 "awkgram.y"
+#line 1769 "awkgram.y"
{
(yyvsp[(1) - (1)])->opcode = Op_postdecrement;
}
@@ -4078,43 +4079,43 @@ regular_print:
case 180:
/* Line 1787 of yacc.c */
-#line 1771 "awkgram.y"
+#line 1772 "awkgram.y"
{ (yyval) = NULL; }
break;
case 182:
/* Line 1787 of yacc.c */
-#line 1779 "awkgram.y"
+#line 1780 "awkgram.y"
{ yyerrok; }
break;
case 183:
/* Line 1787 of yacc.c */
-#line 1783 "awkgram.y"
+#line 1784 "awkgram.y"
{ yyerrok; }
break;
case 186:
/* Line 1787 of yacc.c */
-#line 1792 "awkgram.y"
+#line 1793 "awkgram.y"
{ yyerrok; }
break;
case 187:
/* Line 1787 of yacc.c */
-#line 1796 "awkgram.y"
+#line 1797 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); yyerrok; }
break;
case 188:
/* Line 1787 of yacc.c */
-#line 1800 "awkgram.y"
+#line 1801 "awkgram.y"
{ yyerrok; }
break;
/* Line 1787 of yacc.c */
-#line 4118 "awkgram.c"
+#line 4119 "awkgram.c"
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4346,7 +4347,7 @@ yyreturn:
/* Line 2050 of yacc.c */
-#line 1802 "awkgram.y"
+#line 1803 "awkgram.y"
struct token {
diff --git a/awkgram.y b/awkgram.y
index 6864722..e5ffe9e 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -455,6 +455,7 @@ statements
else
$$ = list_merge($1, $2);
}
+ list_append($$, instruction(Op_end_stmt));
yyerrok;
}
| statements error
diff --git a/eval.c b/eval.c
index cf2264b..a1910a2 100644
--- a/eval.c
+++ b/eval.c
@@ -362,6 +362,7 @@ static struct optypetab {
{ "Op_func", NULL },
{ "Op_exec_count", NULL },
{ "Op_breakpoint", NULL },
+ { "Op_end_stmt", NULL },
{ "Op_lint", NULL },
{ "Op_atexit", NULL },
{ "Op_stop", NULL },
diff --git a/gawkapi.c b/gawkapi.c
index 61f91e8..4651b37 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -1057,6 +1057,55 @@ api_register_ext_version(awk_ext_id_t id, const char
*version)
vi_head = info;
}
+volatile bool async_pending = false;
+
+struct async_list {
+ awk_ext_id_t id;
+ awk_async_callback_t *callback;
+ struct async_list *next;
+};
+
+static struct async_list *async_head = NULL;
+
+/* api_register_async_callback --- register an asynchronous callback function
*/
+static void
+api_register_async_callback(awk_ext_id_t id, awk_async_callback_t *callback)
+{
+ struct async_list *lp;
+
+ if (callback == NULL)
+ return;
+
+ emalloc(lp, struct async_list *, sizeof(struct async_list),
"register_async_callback");
+ lp->id = id; // for future use
+ lp->callback = callback;
+ lp->next = async_head;
+ async_head = lp;
+}
+
+/* api_notify_async_event --- tell gawk that something happened */
+
+static void
+api_notify_async_event(awk_ext_id_t id)
+{
+ async_pending = true;
+}
+
+/* run_aysnc_handlers --- execute the async handlers */
+
+void
+run_async_handlers(void)
+{
+ struct async_list *lp;
+
+ for (lp = async_head; lp != NULL; lp = lp->next) {
+ if (lp->callback->needs_calling) {
+ lp->callback->needs_calling = false;
+ lp->callback->callback_fn(lp->callback->data);
+ }
+ }
+}
+
/* the struct api */
gawk_api_t api_impl = {
/* data */
@@ -1107,6 +1156,10 @@ gawk_api_t api_impl = {
api_clear_array,
api_flatten_array,
api_release_flattened_array,
+
+ /* Asynchronous callbacks */
+ api_register_async_callback,
+ api_notify_async_event,
};
/* init_ext_api --- init the extension API */
diff --git a/gawkapi.h b/gawkapi.h
index cc50bba..6ee8917 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -264,7 +264,7 @@ typedef struct awk_two_way_processor {
/* Current version of the API. */
enum {
GAWK_API_MAJOR_VERSION = 1,
- GAWK_API_MINOR_VERSION = 0
+ GAWK_API_MINOR_VERSION = 1
};
/* A number of typedefs related to different types of values. */
@@ -381,6 +381,13 @@ typedef struct awk_ext_func {
typedef void *awk_ext_id_t; /* opaque type for extension id */
+/* Information for asynchronous callbacks */
+typedef struct awk_async_callback {
+ awk_bool_t needs_calling;
+ void *data;
+ void (*callback_fn)(void *data);
+} awk_async_callback_t;
+
/*
* The API into gawk. Lots of functions here. We hope that they are
* logically organized.
@@ -665,6 +672,13 @@ typedef struct gawk_api {
awk_bool_t (*api_release_flattened_array)(awk_ext_id_t id,
awk_array_t a_cookie,
awk_flat_array_t *data);
+
+ /* Handling async events */
+ /* Register a call back */
+ void (*api_register_async_callback)(awk_ext_id_t id,
awk_async_callback_t *callback);
+
+ /* Tell gawk that something happened, it will call us when it's ready */
+ void (*api_notify_async_event)(awk_ext_id_t id);
} gawk_api_t;
#ifndef GAWK /* these are not for the gawk code itself! */
@@ -745,6 +759,12 @@ typedef struct gawk_api {
#define register_ext_version(version) \
(api->api_register_ext_version(ext_id, version))
+#define register_async_callback(callback) \
+ (api->api_register_async_callback)(ext_id, callback)
+
+#define notify_async_event() \
+ (api->api_notify_async_event)(awk_ext_id_t)
+
#define emalloc(pointer, type, size, message) \
do { \
if ((pointer = (type) malloc(size)) == 0) \
diff --git a/interpret.h b/interpret.h
index ba70cf0..2da7d97 100644
--- a/interpret.h
+++ b/interpret.h
@@ -1358,6 +1358,13 @@ match_re:
case Op_cond_exp:
break;
+ case Op_end_stmt:
+ if (async_pending) {
+ async_pending = false;
+ run_async_handlers();
+ }
+ break;
+
default:
fatal(_("Sorry, don't know how to interpret `%s'"),
opcode2str(op));
}
diff --git a/profile.c b/profile.c
index 223a4e3..e7b3dbc 100644
--- a/profile.c
+++ b/profile.c
@@ -501,6 +501,7 @@ cleanup:
case Op_cond_pair:
case Op_after_beginfile:
case Op_after_endfile:
+ case Op_end_stmt:
break;
case Op_sub_builtin:
-----------------------------------------------------------------------
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, async-events, created. gawk-4.1.0-361-g8e303ac,
Arnold Robbins <=