aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.y
diff options
context:
space:
mode:
Diffstat (limited to 'awkgram.y')
-rw-r--r--awkgram.y43
1 files changed, 22 insertions, 21 deletions
diff --git a/awkgram.y b/awkgram.y
index 8b9df5a5..c84529c4 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -2007,7 +2007,7 @@ func_call
f->opcode = Op_indirect_func_call;
name = estrdup(f->func_name, strlen(f->func_name));
if (is_std_var(name))
- yyerror(_("can not use special variable `%s' for indirect function call"), name);
+ yyerror(_("cannot use special variable `%s' for indirect function call"), name);
indirect_var = variable(f->source_line, name, Node_var_new);
t = instruction(Op_push);
t->memory = indirect_var;
@@ -2852,8 +2852,8 @@ add_srcfile(enum srctype stype, char *src, SRCFILE *thisfile, bool *already_incl
}
/* use full messages to ease translation */
fatal(stype != SRC_EXTLIB
- ? _("can't open source file `%s' for reading (%s)")
- : _("can't open shared library `%s' for reading (%s)"),
+ ? _("cannot open source file `%s' for reading: %s")
+ : _("cannot open shared library `%s' for reading: %s"),
src,
errno_val ? strerror(errno_val) : _("reason unknown"));
}
@@ -2864,7 +2864,7 @@ add_srcfile(enum srctype stype, char *src, SRCFILE *thisfile, bool *already_incl
if (stype == SRC_INC || stype == SRC_EXTLIB) {
/* eliminate duplicates */
if ((stype == SRC_INC) && (s->stype == SRC_FILE))
- fatal(_("can't include `%s' and use it as a program file"), src);
+ fatal(_("cannot include `%s' and use it as a program file"), src);
if (do_lint) {
int line = sourceline;
@@ -2888,7 +2888,7 @@ add_srcfile(enum srctype stype, char *src, SRCFILE *thisfile, bool *already_incl
} else {
/* duplicates are allowed for -f */
if (s->stype == SRC_INC)
- fatal(_("can't include `%s' and use it as a program file"), src);
+ fatal(_("cannot include `%s' and use it as a program file"), src);
/* no need to scan for further matches, since
* they must be of homogeneous type */
break;
@@ -2930,7 +2930,7 @@ include_source(INSTRUCTION *file, void **srcfile_p)
if (already_included)
return true;
error_ln(file->source_line,
- _("can't open source file `%s' for reading (%s)"),
+ _("cannot open source file `%s' for reading: %s"),
src, errcode ? strerror(errcode) : _("reason unknown"));
return false;
}
@@ -2990,7 +2990,7 @@ load_library(INSTRUCTION *file, void **srcfile_p)
if (already_included)
return true;
error_ln(file->source_line,
- _("can't open shared library `%s' for reading (%s)"),
+ _("cannot open shared library `%s' for reading: %s"),
src, errcode ? strerror(errcode) : _("reason unknown"));
return false;
}
@@ -3168,7 +3168,7 @@ get_src_buf()
/* suppress file name and line no. in error mesg */
in = source;
source = NULL;
- error(_("can't open source file `%s' for reading (%s)"),
+ error(_("cannot open source file `%s' for reading: %s"),
in, strerror(errno));
errcount++;
lexeof = true;
@@ -3236,7 +3236,7 @@ get_src_buf()
n = (*readfunc)(sourcefile->fd, lexptr, sourcefile->bufsize - savelen);
if (n == -1) {
- error(_("can't read sourcefile `%s' (%s)"),
+ error(_("cannot read source file `%s': %s"),
source, strerror(errno));
errcount++;
lexeof = true;
@@ -3306,7 +3306,8 @@ check_bad_char(int c)
}
if (iscntrl(c) && ! isspace(c))
- fatal(_("PEBKAC error: invalid character '\\%03o' in source code"), c & 0xFF);
+ // This is a PEBKAC error, but we'll be nice and not say so.
+ fatal(_("error: invalid character '\\%03o' in source code"), c & 0xFF);
}
/* nextc --- get the next input character */
@@ -3887,9 +3888,9 @@ retry:
if (! did_warn_assgn) {
did_warn_assgn = true;
if (do_lint)
- lintwarn(_("POSIX does not allow operator `**='"));
+ lintwarn(_("POSIX does not allow operator `%s'"), "**=");
if (do_lint_old)
- lintwarn(_("old awk does not support operator `**='"));
+ lintwarn(_("operator `%s' is not supported in old awk"), "**=");
}
yylval = GET_INSTRUCTION(Op_assign_exp);
return ASSIGNOP;
@@ -3898,9 +3899,9 @@ retry:
if (! did_warn_op) {
did_warn_op = true;
if (do_lint)
- lintwarn(_("POSIX does not allow operator `**'"));
+ lintwarn(_("POSIX does not allow operator `%s'"), "**");
if (do_lint_old)
- lintwarn(_("old awk does not support operator `**'"));
+ lintwarn(_("operator `%s' is not supported in old awk"), "**");
}
yylval = GET_INSTRUCTION(Op_exp);
return lasttok = '^';
@@ -3935,7 +3936,7 @@ retry:
if (nextc(true) == '=') {
if (do_lint_old && ! did_warn_assgn) {
did_warn_assgn = true;
- lintwarn(_("operator `^=' is not supported in old awk"));
+ lintwarn(_("operator `%s' is not supported in old awk"), "^=");
}
yylval = GET_INSTRUCTION(Op_assign_exp);
return lasttok = ASSIGNOP;
@@ -3943,7 +3944,7 @@ retry:
pushback();
if (do_lint_old && ! did_warn_op) {
did_warn_op = true;
- lintwarn(_("operator `^' is not supported in old awk"));
+ lintwarn(_("operator `%s' is not supported in old awk"), "^");
}
yylval = GET_INSTRUCTION(Op_exp);
return lasttok = '^';
@@ -4600,7 +4601,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
ip = arg->lasti;
if (ip->opcode == Op_push_i) {
if (do_lint)
- lintwarn(_("%s: string literal as last arg of substitute has no effect"),
+ lintwarn(_("%s: string literal as last argument of substitute has no effect"),
operator);
r->sub_flags |= LITERAL;
} else {
@@ -4917,7 +4918,7 @@ dump_vars(const char *fname)
else if (strcmp(fname, "-") == 0)
fp = stdout;
else if ((fp = fopen(fname, "w")) == NULL) {
- warning(_("could not open `%s' for writing (%s)"), fname, strerror(errno));
+ warning(_("could not open `%s' for writing: %s"), fname, strerror(errno));
warning(_("sending variable list to standard error"));
fp = stderr;
}
@@ -4926,7 +4927,7 @@ dump_vars(const char *fname)
print_vars(vars, fprintf, fp);
efree(vars);
if (fp != stdout && fp != stderr && fclose(fp) != 0)
- warning(_("%s: close failed (%s)"), fname, strerror(errno));
+ warning(_("%s: close failed: %s"), fname, strerror(errno));
}
/* dump_funcs --- print all functions */
@@ -5087,10 +5088,10 @@ check_params(char *fname, int pcount, INSTRUCTION *list)
if (strcmp(name, fname) == 0) {
/* check for function foo(foo) { ... }. bleah. */
error_ln(p->source_line,
- _("function `%s': can't use function name as parameter name"), fname);
+ _("function `%s': cannot use function name as parameter name"), fname);
} else if (is_std_var(name)) {
error_ln(p->source_line,
- _("function `%s': can't use special variable `%s' as a function parameter"),
+ _("function `%s': cannot use special variable `%s' as a function parameter"),
fname, name);
} else if (strchr(name, ':') != NULL)
error_ln(p->source_line,