sub assemble_collapsing_parser {
my $args = shift;
+ # it may get unset further down
+ my $no_rowid_container = $args->{hri_style};
+
my ($top_node_key, $top_node_key_assembler);
if (scalar @{$args->{collapse_map}{-identifying_columns}}) {
-custom_node_key => $top_node_key,
};
+ $no_rowid_container = 0;
}
else {
die('Unexpected collapse map contents');
my ($data_assemblers, $stats) = __visit_infmap_collapse ($args);
- my @idcol_args = $args->{hri_style} ? ('', '') : (
+ my @idcol_args = $no_rowid_container ? ('', '') : (
', %cur_row_ids', # only declare the variable if we'll use it
sprintf( <<'EOS', join ', ', sort { $a <=> $b } keys %{ $stats->{idcols_seen} } ),
# !!! note - different var than the one above
# change the quoted placeholders to unquoted alias-references
$parser_src =~ s/ \' \xFF__VALPOS__(\d+)__\xFF \' /"\$cur_row_data->[$1]"/gex;
- $parser_src =~ s/ \' \xFF__IDVALPOS__(\d+)__\xFF \' /$args->{hri_style} ? "\$cur_row_data->[$1]" : "\$cur_row_ids{$1}" /gex;
+ $parser_src =~ s/
+ \' \xFF__IDVALPOS__(\d+)__\xFF \'
+ /
+ $no_rowid_container ? "\$cur_row_data->[$1]" : "\$cur_row_ids{$1}"
+ /gex;
$parser_src = " { use strict; use warnings FATAL => 'all';\n$parser_src\n }";
}