mirror of
https://github.com/postgres/postgres.git
synced 2026-05-28 04:35:45 -04:00
Make ecpg parse.pl more robust with braces
When parse.pl processes braces, it does not take into account that
braces could also be their own token if single quoted ('{', '}').
This is not currently used but a future patch wants to make use of it.
This fixes that by using lookaround assertions to detect the quotes.
To make sure all Perl versions in play support this and to avoid
surprises later on, let's give this a spin on the buildfarm now. It
can exist independently of future work.
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/a855795d-e697-4fa5-8698-d20122126567@eisentraut.org
This commit is contained in:
parent
804046b39a
commit
7f88553cea
1 changed files with 3 additions and 3 deletions
|
|
@ -256,9 +256,9 @@ sub main
|
|||
$has_if_command = 1 if /^\s*if/;
|
||||
}
|
||||
|
||||
# Make sure any braces are split into separate fields
|
||||
s/{/ { /g;
|
||||
s/}/ } /g;
|
||||
# Make sure any (unquoted) braces are split into separate fields
|
||||
s/(?<!')\{(?!')/ { /g;
|
||||
s/(?<!')\}(?!')/ } /g;
|
||||
|
||||
# Likewise for comment start/end markers
|
||||
s|\/\*| /* |g;
|
||||
|
|
|
|||
Loading…
Reference in a new issue