diff options
Diffstat (limited to 'src/create_cmdidxs.vim')
-rw-r--r-- | src/create_cmdidxs.vim | 27 |
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 = {} |