Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0465c52

Browse files
committed
Arrange that the string "syntax error" generated by bison is translated.
1 parent 14ba9fd commit 0465c52

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/interfaces/ecpg/preproc/ecpg.header

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.6 2009/06/03 20:24:51 tgl Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.7 2009/06/10 23:11:52 petere Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -22,6 +22,12 @@
2222
*/
2323
#define base_yylex filtered_base_yylex
2424

25+
/*
26+
* This is only here so the string gets into the POT. Bison uses it
27+
* internally.
28+
*/
29+
#define bison_gettext_dummy gettext_noop("syntax error")
30+
2531
/*
2632
* Variables containing simple states.
2733
*/

src/interfaces/ecpg/preproc/ecpg.trailer

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.8 2009/06/03 20:24:51 tgl Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.9 2009/06/10 23:11:52 petere Exp $ */
22

33
statements: /*EMPTY*/
44
| statements statement
@@ -1987,8 +1987,9 @@ ecpg_into: INTO into_list { $$ = EMPTY; }
19871987

19881988
void base_yyerror(const char *error)
19891989
{
1990+
/* translator: %s is typically the translation of "syntax error" */
19901991
mmerror(PARSE_ERROR, ET_ERROR, "%s at or near \"%s\"",
1991-
error, token_start ? token_start : yytext);
1992+
_(error), token_start ? token_start : yytext);
19921993
}
19931994

19941995
void parser_init(void)

0 commit comments

Comments
 (0)