chiark / gitweb /
preoptimse: support 2nd L area, L2
[pandemic-rising-tide.git] / Parse.pm
index 565a322417b1ae48504a54e06873798f7c71f139..147ecd344819e71263359bed4921d235885e0ef2 100644 (file)
--- a/Parse.pm
+++ b/Parse.pm
@@ -42,7 +42,7 @@ sub read_in () {
       $ccolour = $&;
       next;
     }
-    if (my ($name, $water) = m{^\t(\S.*\w|L)(?: \[(\d+)\])?$}) {
+    if (my ($name, $water) = m{^\t(\S.*\w|L2?)(?: \[(\d+)\])?$}) {
       confess unless defined $ccolour;
       my $dname = $c{DisplayNames}{$name} // $name;
       $name =~ s{/}{}g;
@@ -59,7 +59,7 @@ sub read_in () {
       $cregion = $name;
       next;
     }
-    if (my ($aref, $adikes) = m{^\t\t(\S.*[A-Za-z.]|L)(?: (\+\+?))?$}) {
+    if (my ($aref, $adikes) = m{^\t\t(\S.*[A-Za-z.]|L2?)(?: (\+\+?))?$}) {
       my $adj = { Dikes => (length $adikes // 0), L => $. };
       if ($aref =~ m{\.}) {
        $adj->{Pattern} = $aref;
@@ -108,6 +108,7 @@ sub unique_aref ($$) {
 
 sub region_cmp {
   ($a eq 'L' ) <=> ($b eq 'L' ) or
+  ($a eq 'L2') <=> ($b eq 'L2') or
   ($a eq 'NZ') <=> ($b eq 'NZ') or
    $a          cmp  $b
 }