lib/scripts/fixseq.pl
author wenzelm
Thu, 29 Apr 2004 06:04:01 +0200
changeset 14687 e089757b952a
parent 9789 7e5e6c47c0b5
child 14981 e73f8140af78
permissions -rw-r--r--
added is_keyword;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4268
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     1
#
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     2
# $Id$
9789
wenzelm
parents: 4268
diff changeset
     3
# Author: Markus Wenzel, TU Muenchen
wenzelm
parents: 4268
diff changeset
     4
# License: GPL (GNU GENERAL PUBLIC LICENSE)
4268
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     5
#
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     6
# fixseq.pl - fix references to obsolete Pure/Sequence structure
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     7
#
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     8
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     9
sub fixseq {
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    10
    my ($file) = @_;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    11
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    12
    open (FILE, $file) || die $!;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    13
    undef $/; $text = <FILE>; $/ = "\n";         # slurp whole file
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    14
    close FILE || die $!;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    15
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    16
    $_ = $text;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    17
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    18
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    19
    s/Sequence\.tl/Seq.tl/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    20
    s/Sequence\.single/Seq.single/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    21
    s/Sequence\.seqof/Seq.make/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    22
    s/Sequence\.seq/Seq.seq/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    23
    s/Sequence\.s_of_list/Seq.of_list/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    24
    s/Sequence\.pull/Seq.pull/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    25
    s/Sequence\.prints/Seq.print/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    26
    s/Sequence\.null/Seq.empty/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    27
    s/Sequence\.maps/Seq.map/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    28
    s/Sequence\.mapp/Seq.mapp/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    29
    s/Sequence\.list_of_s/Seq.list_of/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    30
    s/Sequence\.its_right/Seq.it_right/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    31
    s/Sequence\.interleave/Seq.interleave/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    32
    s/Sequence\.hd/Seq.hd/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    33
    s/Sequence\.flats/Seq.flat/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    34
    s/Sequence\.filters/Seq.filter/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    35
    s/Sequence\.cons/Seq.cons/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    36
    s/Sequence\.chop/Seq.chop/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    37
    s/Sequence\.append/Seq.append/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    38
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    39
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    40
    $result = $_;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    41
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    42
    if ($text ne $result) {
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    43
	print STDERR "fixing $file\n";
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    44
        if (! -f "$file~~") {
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    45
	    rename $file, "$file~~" || die $!;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    46
        }
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    47
	open (FILE, "> $file") || die $!;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    48
	print FILE $result;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    49
	close FILE || die $!;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    50
    }
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    51
}
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    52
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    53
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    54
## main
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    55
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    56
foreach $file (@ARGV) {
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    57
  eval { &fixseq($file); };
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    58
  if ($@) { print STDERR "*** fixseq $file: ", $@, "\n"; }
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    59
}