From: Ian Jackson Date: Sun, 13 Jan 2019 23:55:24 +0000 (+0000) Subject: wip X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=a87f245634dce94ee8276b29701140f320ec699f;p=pandemic-rising-tide.git wip --- diff --git a/parse-input-graph b/parse-input-graph index 36314ff..28178fb 100755 --- a/parse-input-graph +++ b/parse-input-graph @@ -2,6 +2,7 @@ use strict; use Carp; +use Data::Dumper; our %region; # $region{NAME}{Colour} @@ -22,15 +23,15 @@ sub read_in () { $ccolour = $&; next; } - if (my ($name, $water) = m{^\t+(\S.*\S)(?: \[(\d+)\])$}) { + if (my ($name, $water) = m{^\t(\S.*\S)(?: \[(\d+)\])?$}) { confess unless defined $ccolour; - confess if $region{$name}; + confess "$name ?" if $region{$name}; $region{$name}{Colour} = $ccolour; $region{$name}{Water} = $water; $cregion = $name; next; } - if (my ($aref, $adykes) = m{^\t\t(\S.*\S)(?: (\+\+?))$}) { + if (my ($aref, $adykes) = m{^\t\t(\S.*\S)(?: (\+\+?))?$}) { my $adj = { Dykes => length $adykes }; if ($aref =~ m{\.}) { $aref =~ s{\-}{[^- ]*-};