diff options
author | Brad King <brad.king@kitware.com> | 2018-10-18 11:46:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-10-18 11:53:55 (GMT) |
commit | 3aa258db0e90cf242852a5f62e4a44953b3f74b1 (patch) | |
tree | 577d742ab35a9d10a6c16c69e31b50b82e744cf6 /Auxiliary/vim/extract-upper-case.pl | |
parent | a8a485715afe3017a514bc5fbd3a19a96d493aed (diff) | |
parent | c9493939ea4d294ffdb3cfce680f7da9be018db5 (diff) | |
download | CMake-3aa258db0e90cf242852a5f62e4a44953b3f74b1.zip CMake-3aa258db0e90cf242852a5f62e4a44953b3f74b1.tar.gz CMake-3aa258db0e90cf242852a5f62e4a44953b3f74b1.tar.bz2 |
Merge branch 'upstream-vim-cmake-syntax' into update-vim-syntax
* upstream-vim-cmake-syntax:
vim-cmake-syntax 2018-10-18 (64ff4bd7)
Diffstat (limited to 'Auxiliary/vim/extract-upper-case.pl')
-rwxr-xr-x | Auxiliary/vim/extract-upper-case.pl | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/Auxiliary/vim/extract-upper-case.pl b/Auxiliary/vim/extract-upper-case.pl index 6dbb678..bd62ade 100755 --- a/Auxiliary/vim/extract-upper-case.pl +++ b/Auxiliary/vim/extract-upper-case.pl @@ -103,25 +103,25 @@ while(<IN>) my @tmp = grep { ! exists $conditional{$_} and ! exists $loop{$_} and ! exists $deprecated{$_} } @commands; - print OUT " " x 12 , "\\ ", join(" ", @tmp), "\n"; + print_list(\*OUT, @tmp); } elsif ($1 eq "VARIABLE_LIST") { - print OUT " " x 12 , "\\ ", join(" ", sort keys %variables), "\n"; + print_list(\*OUT, keys %variables); } elsif ($1 eq "MODULES") { - print OUT " " x 12 , "\\ ", join("\n", @modules), "\n"; + print_list(\*OUT, @modules); } elsif ($1 eq "GENERATOR_EXPRESSIONS") { - print OUT " " x 12 , "\\ ", join(" ", @generator_expr), "\n"; + print_list(\*OUT, @generator_expr); } elsif ($1 eq "CONDITIONALS") { - print OUT " " x 12 , "\\ ", join(" ", sort keys %conditional), "\n"; + print_list(\*OUT, keys %conditional); } elsif ($1 eq "LOOPS") { - print OUT " " x 12 , "\\ ", join(" ", sort keys %loop), "\n"; + print_list(\*OUT, keys %loop); } elsif ($1 eq "DEPRECATED") { - print OUT " " x 12 , "\\ ", join(" ", sort keys %deprecated), "\n"; + print_list(\*OUT, keys %deprecated); } elsif ($1 eq "PROPERTIES") { - print OUT " " x 12 , "\\ ", join(" ", sort keys %properties), "\n"; + print_list(\*OUT, keys %properties); } elsif ($1 eq "KEYWORDS") { foreach my $k (sort keys %keywords) { print OUT "syn keyword cmakeKW$k contained\n"; - print OUT " " x 12, "\\ ", join(" ", @{$keywords{$k}}), "\n"; + print_list(\*OUT, @{$keywords{$k}}); print OUT "\n"; push @keyword_hi, "hi def link cmakeKW$k ModeMsg"; } @@ -164,3 +164,10 @@ sub extract_upper return @word; } + +sub print_list +{ + my $O = shift; + my $indent = " " x 12 . "\\ "; + print $O $indent, join("\n" . $indent, sort @_), "\n"; +} |