[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, feature/fixtype, updated. gawk-4.1.0-181
From: |
Andrew J. Schorr |
Subject: |
[gawk-diffs] [SCM] gawk branch, feature/fixtype, updated. gawk-4.1.0-1815-gb54c54d |
Date: |
Tue, 14 Jun 2016 02:57:31 +0000 (UTC) |
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, feature/fixtype has been updated
via b54c54d30fe20cfb5f0794cd85eeec7783800866 (commit)
from 18c6b0f85db6683f1d0789e800acfdd35da3ce07 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=b54c54d30fe20cfb5f0794cd85eeec7783800866
commit b54c54d30fe20cfb5f0794cd85eeec7783800866
Author: Andrew J. Schorr <address@hidden>
Date: Mon Jun 13 22:57:15 2016 -0400
Eliminate more STRCUR tests in awkgram.y
diff --git a/ChangeLog b/ChangeLog
index 9a3636b..692f2a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-13 Andrew J. Schorr <address@hidden>
+
+ * awkgram.y: Eliminate STRCUR tests. Must use STRING to test whether
+ a scalar is a string.
+
2016-06-12 Andrew J. Schorr <address@hidden>
* awk.h: Improve comment about STRING and NUMBER type assignment.
diff --git a/awkgram.c b/awkgram.c
index c40217c..df654c7 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -3822,7 +3822,7 @@ regular_print:
&& ((yyvsp[0])->nexti->memory->flags &
(MPFN|MPZN)) == 0
) {
NODE *n = (yyvsp[0])->nexti->memory;
- if ((n->flags & (STRCUR|STRING)) != 0) {
+ if ((n->flags & STRING) != 0) {
n->numbr = (AWKNUM) (n->stlen == 0);
n->flags &= ~(STRCUR|STRING);
n->flags |= (NUMCUR|NUMBER);
@@ -3924,7 +3924,7 @@ regular_print:
#line 1791 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->lasti->opcode == Op_push_i
- && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING))
== 0
+ && ((yyvsp[0])->lasti->memory->flags & STRING) == 0
) {
NODE *n = (yyvsp[0])->lasti->memory;
(void) force_number(n);
@@ -6908,7 +6908,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
} else if (do_intl /* --gen-po */
&& r->builtin == do_dcgettext /*
dcgettext(...) */
&& subn->nexti->lasti->opcode == Op_push_i /* 1st
arg is constant */
- && (subn->nexti->lasti->memory->flags & STRCUR) != 0) {
/* it's a string constant */
+ && (subn->nexti->lasti->memory->flags & STRING) != 0) {
/* it's a string constant */
/* ala xgettext, dcgettext("some string" ...) dumps the string
*/
NODE *str = subn->nexti->lasti->memory;
@@ -6920,9 +6920,9 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
} else if (do_intl /* --gen-po */
&& r->builtin == do_dcngettext /*
dcngettext(...) */
&& subn->nexti->lasti->opcode == Op_push_i /* 1st
arg is constant */
- && (subn->nexti->lasti->memory->flags & STRCUR) != 0
/* it's a string constant */
+ && (subn->nexti->lasti->memory->flags & STRING) != 0
/* it's a string constant */
&& subn->nexti->lasti->nexti->lasti->opcode ==
Op_push_i /* 2nd arg is constant too */
- && (subn->nexti->lasti->nexti->lasti->memory->flags &
STRCUR) != 0) { /* it's a string constant */
+ && (subn->nexti->lasti->nexti->lasti->memory->flags &
STRING) != 0) { /* it's a string constant */
/* ala xgettext, dcngettext("some string", "some plural" ...)
dumps the string */
NODE *str1 = subn->nexti->lasti->memory;
NODE *str2 = subn->nexti->lasti->nexti->lasti->memory;
diff --git a/awkgram.y b/awkgram.y
index 81c6945..87d7a59 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1722,7 +1722,7 @@ non_post_simp_exp
&& ($2->nexti->memory->flags &
(MPFN|MPZN)) == 0
) {
NODE *n = $2->nexti->memory;
- if ((n->flags & (STRCUR|STRING)) != 0) {
+ if ((n->flags & STRING) != 0) {
n->numbr = (AWKNUM) (n->stlen == 0);
n->flags &= ~(STRCUR|STRING);
n->flags |= (NUMCUR|NUMBER);
@@ -1790,7 +1790,7 @@ non_post_simp_exp
| '-' simp_exp %prec UNARY
{
if ($2->lasti->opcode == Op_push_i
- && ($2->lasti->memory->flags & (STRCUR|STRING)) == 0
+ && ($2->lasti->memory->flags & STRING) == 0
) {
NODE *n = $2->lasti->memory;
(void) force_number(n);
@@ -4488,7 +4488,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
} else if (do_intl /* --gen-po */
&& r->builtin == do_dcgettext /*
dcgettext(...) */
&& subn->nexti->lasti->opcode == Op_push_i /* 1st
arg is constant */
- && (subn->nexti->lasti->memory->flags & STRCUR) != 0) {
/* it's a string constant */
+ && (subn->nexti->lasti->memory->flags & STRING) != 0) {
/* it's a string constant */
/* ala xgettext, dcgettext("some string" ...) dumps the string
*/
NODE *str = subn->nexti->lasti->memory;
@@ -4500,9 +4500,9 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
} else if (do_intl /* --gen-po */
&& r->builtin == do_dcngettext /*
dcngettext(...) */
&& subn->nexti->lasti->opcode == Op_push_i /* 1st
arg is constant */
- && (subn->nexti->lasti->memory->flags & STRCUR) != 0
/* it's a string constant */
+ && (subn->nexti->lasti->memory->flags & STRING) != 0
/* it's a string constant */
&& subn->nexti->lasti->nexti->lasti->opcode ==
Op_push_i /* 2nd arg is constant too */
- && (subn->nexti->lasti->nexti->lasti->memory->flags &
STRCUR) != 0) { /* it's a string constant */
+ && (subn->nexti->lasti->nexti->lasti->memory->flags &
STRING) != 0) { /* it's a string constant */
/* ala xgettext, dcngettext("some string", "some plural" ...)
dumps the string */
NODE *str1 = subn->nexti->lasti->memory;
NODE *str2 = subn->nexti->lasti->nexti->lasti->memory;
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 5 +++++
awkgram.c | 10 +++++-----
awkgram.y | 10 +++++-----
3 files changed, 15 insertions(+), 10 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, feature/fixtype, updated. gawk-4.1.0-1815-gb54c54d,
Andrew J. Schorr <=