diff options
| author | Arnold D. Robbins <arnold@skeeve.com> | 2023-12-22 10:55:51 +0200 |
|---|---|---|
| committer | Arnold D. Robbins <arnold@skeeve.com> | 2023-12-22 10:55:51 +0200 |
| commit | 1b2042ee0556dfbdfb0ed6132c1f4e7bfc915dbf (patch) | |
| tree | 300d0f288812d35be4853d973ab3dbce0e57126e | |
| parent | 8c6674cb1c2b28e69bdb3a3897aa4584c25afcc4 (diff) | |
| download | gawk-1b2042ee0556dfbdfb0ed6132c1f4e7bfc915dbf.tar.gz | |
Fixes after drop 7 (add error messages).
| -rw-r--r-- | awkgram.c | 2 | ||||
| -rw-r--r-- | awkgram.y | 2 | ||||
| -rw-r--r-- | re.c | 2 | ||||
| -rw-r--r-- | test/lintwarn.awk | 2 | ||||
| -rw-r--r-- | test/lintwarn.ok | 2 | ||||
| -rw-r--r-- | test/regexpbad.ok | 2 |
6 files changed, 5 insertions, 7 deletions
@@ -2383,7 +2383,7 @@ yyreduce: if (len == 0) lintwarn_ln(yyvsp[0]->source_line, _("regexp constant `//' looks like a C++ comment, but is not")); - else if (re[0] == '*' && re[len-1] == '*') + else if (use_gnu_matchers && re[0] == '*' && re[len-1] == '*') /* possible C comment */ lintwarn_ln(yyvsp[0]->source_line, _("regexp constant `/%s/' looks like a C comment, but is not"), re); @@ -562,7 +562,7 @@ regexp if (len == 0) lintwarn_ln($3->source_line, _("regexp constant `//' looks like a C++ comment, but is not")); - else if (re[0] == '*' && re[len-1] == '*') + else if (use_gnu_matchers && re[0] == '*' && re[len-1] == '*') /* possible C comment */ lintwarn_ln($3->source_line, _("regexp constant `/%s/' looks like a C comment, but is not"), re); @@ -328,7 +328,7 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) } else rp->dfareg = NULL; } else { - int flags = MINRX_REG_EXTENDED | MINRX_REG_ESCAPE_BRACK; + int flags = MINRX_REG_EXTENDED | MINRX_REG_BRACK_ESCAPE | MINRX_REG_BRACE_COMPAT; int ret; if (ignorecase) diff --git a/test/lintwarn.awk b/test/lintwarn.awk index cca53d8..eaf1ebd 100644 --- a/test/lintwarn.awk +++ b/test/lintwarn.awk @@ -26,7 +26,7 @@ BEGIN { a f(/pqr/) // - /* */ + # /* */ # not good with minrx } END { getline diff --git a/test/lintwarn.ok b/test/lintwarn.ok index 5a80599..b30a082 100644 --- a/test/lintwarn.ok +++ b/test/lintwarn.ok @@ -24,8 +24,6 @@ gawk: lintwarn.awk:26: warning: statement has no effect gawk: lintwarn.awk:27: warning: regexp constant for parameter #1 yields boolean value gawk: lintwarn.awk:28: warning: regexp constant `//' looks like a C++ comment, but is not gawk: lintwarn.awk:28: warning: statement has no effect -gawk: lintwarn.awk:29: warning: regexp constant `/* */' looks like a C comment, but is not -gawk: lintwarn.awk:29: warning: statement has no effect gawk: lintwarn.awk:32: warning: non-redirected `getline' undefined inside END action gawk: lintwarn.awk:34: error: function `zz': parameter #2, `aa', duplicates parameter #1 gawk: lintwarn.awk:38: warning: `include' is a gawk extension diff --git a/test/regexpbad.ok b/test/regexpbad.ok index f9b90b2..c33d81f 100644 --- a/test/regexpbad.ok +++ b/test/regexpbad.ok @@ -1,2 +1,2 @@ -gawk: regexpbad.awk:1: error: Invalid regular expression: /^[^[]\x5b/ +gawk: regexpbad.awk:1: error: unbalanced [: /^[^[]\x5b/ EXIT CODE: 1 |
