diff options
author | Tom Lane | 2025-04-22 17:56:31 +0000 |
---|---|---|
committer | Tom Lane | 2025-04-22 17:56:31 +0000 |
commit | eaf582806c0d6b19c081c5afecd9ddb7003e6f80 (patch) | |
tree | 7c196442d4c1bded90542b481df54846617abfbd | |
parent | e29df428a1dca4112aad640c889a9a54642759c9 (diff) |
gen_node_support.pl: improve error message for unclosed struct.
This error message was 'runaway "struct_name"', which isn't all
that clear; I think 'could not find closing brace for "struct_name"'
is better. Also, provide the location of the struct start using the
script's usual '$file:$lineno' style.
Bug: #18901
Reported-by: Clemens Ruck <[email protected]>
Author: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/[email protected]
-rw-r--r-- | src/backend/nodes/gen_node_support.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/nodes/gen_node_support.pl b/src/backend/nodes/gen_node_support.pl index f6229089cd1..77659b0f760 100644 --- a/src/backend/nodes/gen_node_support.pl +++ b/src/backend/nodes/gen_node_support.pl @@ -195,6 +195,7 @@ my $next_input_file = 0; foreach my $infile (@ARGV) { my $in_struct; + my $in_struct_lineno; my $subline; my $is_node_struct; my $supertype; @@ -543,6 +544,7 @@ foreach my $infile (@ARGV) if ($line =~ /^(?:typedef )?struct (\w+)$/ && $1 ne 'Node') { $in_struct = $1; + $in_struct_lineno = $lineno; $subline = 0; } # one node type typedef'ed directly from another @@ -570,7 +572,8 @@ foreach my $infile (@ARGV) if ($in_struct) { - die "runaway \"$in_struct\" in file \"$infile\"\n"; + die + "$infile:$in_struct_lineno: could not find closing brace for struct \"$in_struct\"\n"; } close $ifh; |