Commit b862b5f0 authored by Ezekiel Dohmen's avatar Ezekiel Dohmen
Browse files

Doing duplicate node check with lower cased names, fixing #403

parent 1bd0c011
......@@ -140,7 +140,7 @@ sub parse {
# if the node is a block, add the name to the parent CHILD_BLOCKS hash
if ($cur_node->{NAME} eq "Block" && exists ${$cur_node->{FIELDS}}{Name}) {
my $parent = $cur_node->{PARENT_BLOCK};
my $name = ${$cur_node->{FIELDS}}{Name};
my $name = lc ${$cur_node->{FIELDS}}{Name};
if ( exists ${$parent->{CHILD_BLOCKS}}{$name} )
{
......@@ -224,7 +224,7 @@ sub add_child_block {
#check if child is a node with a name, if so, it should go in CHILD_BLOCKS hash
if ($child->{NAME} eq "Block") {
my $child_name = ${$child->{FIELDS}}{Name};
my $child_name = lc ${$child->{FIELDS}}{Name};
if (exists ${$parent->{CHILD_BLOCKS}}{$child_name}) {
print("Found duplicate name $child_name while adding a child\n");
print("Original node\n");
......@@ -232,11 +232,10 @@ sub add_child_block {
print("Duplicate node\n");
print_node($child);
$errormsg = "*** ERROR -- Found duplicate name $child_name while adding a child block
The RCG builds block names by prepending enclosing system names, using an '_' character as a separator.
Other blocks that have an '_' in their name can end up with the same name.
The RCG builds block names by prepending enclosing system names, using an '_' character as a separator.
Other blocks that have an '_' in their name can end up with the same name.
One of the identically named blocks needs to be renamed. Avoid this problem by not using '_' in block names.
";
One of the identically named blocks needs to be renamed. Avoid this problem by not using '_' in block names";
die $errormsg;
}
${$parent->{CHILD_BLOCKS}}{$child_name} = $child;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment