aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2014-06-14 17:02:05 +0400
committerZyX <kp-pav@yandex.ru>2014-08-20 20:21:37 +0400
commit1e11de538578897bf19478caf1a4c667ce3d6b75 (patch)
tree53a8814f219ea62d61b0292c8a7ba665658ffd2b /scripts
parentb8a32b66033335a27eb928ccf73caecccfacea2a (diff)
downloadrneovim-1e11de538578897bf19478caf1a4c667ce3d6b75.tar.gz
rneovim-1e11de538578897bf19478caf1a4c667ce3d6b75.tar.bz2
rneovim-1e11de538578897bf19478caf1a4c667ce3d6b75.zip
Fix problem with test47: addition is not bitwise OR
:diffsplit command used to include some flag value twice. If I was using bitwise OR it would be OK, but I had addition here. Changed to use bitwise OR.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/transform_ex_cmds_defs.pl70
1 files changed, 0 insertions, 70 deletions
diff --git a/scripts/transform_ex_cmds_defs.pl b/scripts/transform_ex_cmds_defs.pl
deleted file mode 100755
index b340265992..0000000000
--- a/scripts/transform_ex_cmds_defs.pl
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-no utf8;
-
-my $srcfname = shift @ARGV;
-my $tgtfname = shift @ARGV;
-
-if ($srcfname eq "--help") {
- print << "EOF";
-$0 path/to/ex_cmds_defs.h path/to/ex_cmds.lua
-
- Translate Ex commands defines from old format to new one.
-EOF
-}
-
-my $flag_const = qr((?:[A-Z]+[A-Z1-9]));
-
-my $F;
-open $F, "<", "$srcfname"
- or die "Failed to open $srcfname";
-
-my $T;
-open $T, ">", "$tgtfname"
- or die "Failed to open $tgtfname";
-
-my ($enum_name, $cmd_name, $cmd_func);
-my ($flags);
-my $did_header = 0;
-while (<$F>) {
- if (/^#define\s+($flag_const)\s+(.*)/) {
- my $const_name = $1;
- my $const_value = $2;
- $const_value =~ s@/\*.*|//.*@@g;
- $const_value =~ s/\s+//g;
- $const_value =~ s/\|/+/g;
- $const_value =~ s/(?<=\d)L//g;
- print $T "local $const_name = $const_value\n";
- } elsif (/^\{/../^\}/) {
- if (/^\s*EX\(\s*CMD_(\w+)\s*,\s*"((?:\\.|[^"\\])+)"\s*,\s*(\w+)\s*,\s*$/) {
- $enum_name = $1;
- $cmd_name = $2;
- $cmd_func = $3;
- } elsif (defined $enum_name and /^\s*($flag_const(?:\|$flag_const)*|0)/) {
- if (not $did_header) {
- print $T "return {\n";
- $did_header = 1;
- }
- $flags = $1;
- $flags =~ s/\|/+/g;
- local $\ = "\n";
- print $T " {";
- print $T " command='$cmd_name',";
- print $T " enum='CMD_$enum_name',"
- if ($cmd_name ne $enum_name);
- print $T " flags=$flags,";
- print $T " func='$cmd_func',";
- print $T " },";
- undef $enum_name;
- undef $cmd_name;
- undef $cmd_func;
- undef $flags;
- } else {
- next;
- }
- }
-}
-
-print $T "}\n";