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