diff options
author | Hans Hagen <pragma@wxs.nl> | 2004-11-23 00:00:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2004-11-23 00:00:00 +0100 |
commit | e29b089d86c3cb25289ddb0fc7c98cf6c102b9ba (patch) | |
tree | cbf65265ce272f36d0099eca08692071e67570a8 /scripts | |
parent | 3b8aa7e031c996ed051083984e5fa7078ec7cffd (diff) | |
download | context-e29b089d86c3cb25289ddb0fc7c98cf6c102b9ba.tar.gz |
stable 2004.11.23
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/perl/texutil.pl | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/scripts/context/perl/texutil.pl b/scripts/context/perl/texutil.pl index fa3f78919..31c5c1874 100644 --- a/scripts/context/perl/texutil.pl +++ b/scripts/context/perl/texutil.pl @@ -2816,34 +2816,40 @@ sub FilterPages # temp feature / no reporting close(TUO) } } sub GenerateSciteApi # ugly, not generic, but fast, will become xsltproc based - { my $filename = $ARGV[0] ; + { my $interface = $ARGV[0] ; my $commands = 0 ; my $environments = 0 ; my %collection ; - return unless -f "$filename.xml" ; - print " scite api file : $filename-scite.api\n" ; - print " scite lexer file : $filename-scite.properties\n" ; - if (open(XML,"<$filename.xml")) + my %mappings ; + return unless -f "cont-en.xml" ; + print " scite api file : cont-$interface-scite.api\n" ; + print " scite lexer file : cont-$interface-scite.properties\n" ; + if (open(XML,"<keys-$interface.xml")) + { while (<XML>) + { if (/\<cd\:command\s+name=\"(.*?)\"\s+value=\"(.*?)\".*?\>/o) + { $mappings{"$1"} = $2 } } + close(XML) } + else + { print " missing file : keys-$interface.xml\n" ; + return } + if (open(XML,"<cont-en.xml")) { while (<XML>) { chomp ; if (/\<cd\:command\s+name=\"(.*?)\"\s+type=\"environment\".*?\>/o) { $environments++ ; - $collection{"start$1"} = '' ; - $collection{"stop$1"} = '' } + $collection{"start$mappings{$1}"} = '' ; + $collection{"stop$mappings{$1}"} = '' } elsif (/\<cd\:command\s+name=\"(.*?)\".*?\>/o) { $commands++ ; - $collection{"$1"} = '' } } + $collection{"$mappings{$1}"} = '' } } close(XML) ; - if (open(API,">$filename-scite.api")) + if (open(API,">cont-$interface-scite.api")) { foreach $name (keys %collection) { print API "\\$name\n" } print API "\n" ; close(API) } - if (open(API,">$filename-scite.properties")) + if (open(API,">cont-$interface-scite.properties")) { my $i = 0 ; - my $interface = 'en' ; - if ($filename =~ /cont\-(..)/o) - { $interface = $1 } print API "keywordclass.macros.context.$interface=" ; foreach $name (keys %collection) { if ($i==0) |