-
Thomas Wood authored
Freeze lambda ml files, remove .ml from clean steps of Makefile and tidy dependency generation. Include ExtrOcamlBasic so Coq_bool is extracted to bool (and lists, etc) This partially reverts commit 32dab984b1e0450013018f6565768409fa4697cd.
Thomas Wood authoredFreeze lambda ml files, remove .ml from clean steps of Makefile and tidy dependency generation. Include ExtrOcamlBasic so Coq_bool is extracted to bool (and lists, etc) This partially reverts commit 32dab984b1e0450013018f6565768409fa4697cd.
ml-add-cstr-annots.pl 749 B
#!/usr/bin/perl
# An attempt at automatic annotation generation for OCaml files.
# Takes multiple filenames as input.
foreach $fname (@ARGV) {
open(FILE, "< $fname") or die("Could not open $fname\n");
open(NEW, "> $fname.temp");
while($line = <FILE>) {
if ($line =~ m/^(?!.*\[.*?\])(?!.*->)(\s*\|.*?)(of (.*))?$/) {
$no = split(/\*/, $3);
$annot = " [\@f";
for (my $i=0; $i < $no; $i++) {
$annot = $annot . " label" . $i;
if ($i < $no -1) {
$annot = $annot . ",";
}
}
$annot = $annot . "] ";
print NEW $1 . $annot . $2 . " (** Auto Generated Attributes **)\n";
} else {
print NEW $line;
}
}
close(FILE);
close(NEW);
rename("$fname.temp", $fname) or die "can't rename $fname.temp to $fname: $!";
}