chiark / gitweb /
Revert "support for L3, although it doesn't work"
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 2 Mar 2019 08:40:50 +0000 (08:40 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 2 Mar 2019 08:40:50 +0000 (08:40 +0000)
perl errors

This reverts commit 09e6c63f4182d01afaa4d6ec56354346f5aa078a.

Parse.pm
generate-board

index 6bd3047e346ecb741ad663ae12e75ad85c78443f..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?)(?: \[(\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\d?)(?: (\+\+?))?$}) {
+    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;
@@ -109,7 +109,6 @@ sub unique_aref ($$) {
 sub region_cmp {
   ($a eq 'L' ) <=> ($b eq 'L' ) or
   ($a eq 'L2') <=> ($b eq 'L2') or
-  ($a eq 'L3') <=> ($b eq 'L3') or
   ($a eq 'NZ') <=> ($b eq 'NZ') or
    $a          cmp  $b
 }
index b3f3fd6094250591a7552ca178613a11d060f881..deed43f594f5a441fa88a924e9999815b65113a5 100755 (executable)
@@ -41,7 +41,7 @@ our $sre = qr{(?:(\")|(?=\w))(.*)\1$}; # 2 captures, $2 is the name
 
 sub prs2r ($) {
   # bodgery for the sea and land
-  return 'NZ' if m/ \| / && !grep { !m{^(?:NZ|L\d?)$} } split / \| /, $_[0];
+  return 'NZ' if m/ \| / && !grep { !m{^(?:NZ|L2?)$} } split / \| /, $_[0];
   $prs2region{$_[0]} // confess "@_ ?"
 }
 sub prs2rr ($) { $region{prs2r($_[0])} }
@@ -68,7 +68,7 @@ sub read_faces () {
     my $last_ai;
     if ($rr->{Name} eq 'NZ') {
       # We combined L and NZ; now we must split them again
-      # in fact, we just throw away L* entirely.
+      # in fact, we just throw away L and L2 entirely.
       # Here, when processing NZ, we keep only vertices that
       # are part of NZ.
       @edges = grep {
@@ -126,7 +126,7 @@ sub read_faces () {
   }
   $process_rr->();
 
-  $region{$_}{Special} = 1 foreach qw(NZ L L2 L3);
+  $region{$_}{Special} = 1 foreach qw(NZ L L2);
 }
 
 #----- geometry mangling -----
@@ -310,7 +310,7 @@ sub facepscolour ($) {
 sub fill_faces() {
   o("clippath ", facepscolour('land'), " fill\n");
   foreach my $rr (values %region) {
-    next if $rr->{Name} =~ m/^L\d?$/;
+    next if $rr->{Name} =~ m/^L2?$/;
     face_path($rr);
     o(" ", facepscolour($rr->{Colour}), " eofill\n");
   }
@@ -319,7 +319,7 @@ sub fill_faces() {
 sub some_edge_faces (@) {
   o("5 setlinewidth 1 setlinejoin 0 setgray\n");
   foreach my $rr (@_) {
-    next if $rr->{Name} =~ m/^L\d?$/;
+    next if $rr->{Name} =~ m/^L2?$/;
     face_path($rr);
     o("    stroke\n");
   }
@@ -348,7 +348,7 @@ sub edge_faces() {
   some_edge_faces($region{'NZ'});
   afsluitdijk();
   some_edge_faces(grep {
-    $_->{Name} !~ m{^(?:L\d?|NZ|ZZ)$}
+    $_->{Name} !~ m{^(?:L2?|NZ|ZZ)$}
   } values %region);
 }