Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitef8b3b0

Browse files
author
Michael Meskes
committed
Fix ecpg parsing of sizeof().
The last fix used the wrong non-terminal to define valid types.
1 parent559d535 commitef8b3b0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

‎src/interfaces/ecpg/preproc/ecpg.trailer

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,20 +1856,20 @@ DeallocateStmt: DEALLOCATE prepared_name { $$ = $2; }
18561856
| DEALLOCATE PREPARE ALL { $$ = mm_strdup("all"); }
18571857
;
18581858

1859-
Iresult: Iconst{ $$ = $1; }
1860-
| '(' Iresult ')'{ $$ = cat_str(3, mm_strdup("("), $2, mm_strdup(")")); }
1861-
| Iresult '+' Iresult{ $$ = cat_str(3, $1, mm_strdup("+"), $3); }
1862-
| Iresult '-' Iresult{ $$ = cat_str(3, $1, mm_strdup("-"), $3); }
1863-
| Iresult '*' Iresult{ $$ = cat_str(3, $1, mm_strdup("*"), $3); }
1864-
| Iresult '/' Iresult{ $$ = cat_str(3, $1, mm_strdup("/"), $3); }
1865-
| Iresult '%' Iresult{ $$ = cat_str(3, $1, mm_strdup("%"), $3); }
1866-
| ecpg_sconst{ $$ = $1; }
1867-
| ColId{ $$ = $1; }
1868-
| ColId '('ColId ')' { if (pg_strcasecmp($1, "sizeof") != 0)
1869-
mmerror(PARSE_ERROR, ET_ERROR, "operator not allowed in variable definition");
1870-
else
1871-
$$ = cat_str(4,$1, mm_strdup("("), $3, mm_strdup(")"));
1872-
}
1859+
Iresult: Iconst{ $$ = $1; }
1860+
| '(' Iresult ')'{ $$ = cat_str(3, mm_strdup("("), $2, mm_strdup(")")); }
1861+
| Iresult '+' Iresult{ $$ = cat_str(3, $1, mm_strdup("+"), $3); }
1862+
| Iresult '-' Iresult{ $$ = cat_str(3, $1, mm_strdup("-"), $3); }
1863+
| Iresult '*' Iresult{ $$ = cat_str(3, $1, mm_strdup("*"), $3); }
1864+
| Iresult '/' Iresult{ $$ = cat_str(3, $1, mm_strdup("/"), $3); }
1865+
| Iresult '%' Iresult{ $$ = cat_str(3, $1, mm_strdup("%"), $3); }
1866+
| ecpg_sconst{ $$ = $1; }
1867+
| ColId{ $$ = $1; }
1868+
| ColId '('var_type ')' { if (pg_strcasecmp($1, "sizeof") != 0)
1869+
mmerror(PARSE_ERROR, ET_ERROR, "operator not allowed in variable definition");
1870+
else
1871+
$$ = cat_str(4,$1, mm_strdup("("), $3.type_str, mm_strdup(")"));
1872+
}
18731873
;
18741874

18751875
execute_rest: /* EMPTY */{ $$ = EMPTY; }

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp