summaryrefslogtreecommitdiffstats
path: root/src/create_cmdidxs.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-01 18:08:42 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-01 18:08:42 +0200
commitb731689e85b4153af7edc8f0a6b9f99d36d8b011 (patch)
tree368b1e876335c781e6653e36faa1e1ac17e2f924 /src/create_cmdidxs.vim
parentd96dbd6f95ea22f609042cc9c6272f14a21ff1a5 (diff)
patch 8.1.1241: Ex command info contains confusing informationv8.1.1241
Problem: Ex command info contains confusing information. Solution: When using the NOTADR flag use ADDR_OTHER for the address type. Cleanup code using NOTADR. Check for errors in create_cmdidxs.vim. Adjust Makefile to see the errors.
Diffstat (limited to 'src/create_cmdidxs.vim')
-rw-r--r--src/create_cmdidxs.vim27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/create_cmdidxs.vim b/src/create_cmdidxs.vim
index c306ccb872..1d73c5faaf 100644
--- a/src/create_cmdidxs.vim
+++ b/src/create_cmdidxs.vim
@@ -10,7 +10,10 @@
let cmds = []
let skipped_cmds = 0
-for line in readfile('ex_cmds.h')
+let lines = readfile('ex_cmds.h')
+let idx = 0
+while idx < len(lines)
+ let line = lines[idx]
if line =~ '^EX(CMD_'
let m = matchlist(line, '^EX(CMD_\S*,\s*"\([a-z][^"]*\)"')
if len(m) >= 2
@@ -18,8 +21,28 @@ for line in readfile('ex_cmds.h')
else
let skipped_cmds += 1
endif
+
+ let idx += 1
+ let flags = lines[idx]
+ let idx += 1
+ let addr_type = lines[idx]
+
+ if flags =~ '\<RANGE\>'
+ if addr_type =~ 'ADDR_NONE'
+ echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Using RANGE with ADDR_NONE: ' .. line
+ endif
+ else
+ if addr_type !~ 'ADDR_NONE'
+ echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Missing ADDR_NONE: ' .. line
+ endif
+ endif
+
+ if flags =~ '\<DFLALL\>' && (addr_type =~ 'ADDR_OTHER' || addr_type =~ 'ADDR_NONE')
+ echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Missing misplaced DFLALL: ' .. line
+ endif
endif
-endfor
+ let idx += 1
+endwhile
let cmdidxs1 = {}
let cmdidxs2 = {}