mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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.
This commit is contained in:
parent
b8a32b6603
commit
1e11de5385
@ -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";
|
1012
src/nvim/ex_cmds.lua
1012
src/nvim/ex_cmds.lua
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user