#!/usr/bin/env perl ##### # asy-list.pl # # Build asy-keywords.el from list of asy global functions and variables # ##### use strict; use warnings; open(my $keywords, "> asy-keywords.el") || die("Couldn't open asy-keywords.el for writing."); print $keywords <) { if (/^%%\s*$/) { last; # Break out of the loop. } } while (<$camp>) { if (/^%%\s*$/) { last; # A second %% indicates the end of definitions. } if (/^(\w+)\s*\{/) { add($1); } } openlist(); my @types; my @functions; my @variables; while (<$asylist>) { if (/^(\w*)[^ ]* (\w*)\(.*/) { push @types, $1; push @functions, $2; } if (/^([^ ]*) (\w*);/) { push @variables, $2; } } my %saw; @saw{@types} = (); @types = sort keys %saw; undef %saw; @saw{@functions} = (); @functions = sort keys %saw; undef %saw; @saw{@variables} = (); @variables = sort keys %saw; undef %saw; print $keywords <