GraphViz2-Marpa-Extractor

 view release on metacpan or  search on metacpan

script/dtd4  view on Meta::CPAN


			next;
		}

		# Node declaration: node_id with optional bracketed attributes.
		if ($nm eq 'node_id' && $t eq 'node_id') {
			my $node_name = $n->{attributes}{name};

			# If this node_id is part of an edge (immediately before/after edge_id),
			# we still want its attributes, but we don't treat it as a standalone node block.
			my $is_edge_endpoint = 0;
			if ($i + 1 < @body && ($body[$i + 1]{name} // '') eq 'edge_id') {
				$is_edge_endpoint = 1;
			}
			if ($i > 0 && ($body[$i - 1]{name} // '') eq 'edge_id') {
				$is_edge_endpoint = 1;
			}

			my %node_attr;
			if ($n->{daughters} && @{ $n->{daughters} }) {
				for my $c (@{ $n->{daughters} }) {
					next unless ($c->{name} // '') eq 'attribute';
					my $ct  = $c->{attributes}{type} || $c->{attributes}{name};
					my $val = $c->{attributes}{value};
					$node_attr{$ct} = $val;
				}



( run in 2.940 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )