comparison src/create_cmdidxs.vim @ 16475:854fb0ad4be6 v8.1.1241

patch 8.1.1241: Ex command info contains confusing information commit https://github.com/vim/vim/commit/b731689e85b4153af7edc8f0a6b9f99d36d8b011 Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 1 18:08:42 2019 +0200 patch 8.1.1241: Ex command info contains confusing information 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.
author Bram Moolenaar <Bram@vim.org>
date Wed, 01 May 2019 18:15:07 +0200
parents 889da8649221
children 72ce5ca82a75
comparison
equal deleted inserted replaced
16474:a85112628edc 16475:854fb0ad4be6
8 " from the src/vim directory, since it reads commands from "ex_cmds.h". 8 " from the src/vim directory, since it reads commands from "ex_cmds.h".
9 9
10 let cmds = [] 10 let cmds = []
11 let skipped_cmds = 0 11 let skipped_cmds = 0
12 12
13 for line in readfile('ex_cmds.h') 13 let lines = readfile('ex_cmds.h')
14 let idx = 0
15 while idx < len(lines)
16 let line = lines[idx]
14 if line =~ '^EX(CMD_' 17 if line =~ '^EX(CMD_'
15 let m = matchlist(line, '^EX(CMD_\S*,\s*"\([a-z][^"]*\)"') 18 let m = matchlist(line, '^EX(CMD_\S*,\s*"\([a-z][^"]*\)"')
16 if len(m) >= 2 19 if len(m) >= 2
17 let cmds += [ m[1] ] 20 let cmds += [ m[1] ]
18 else 21 else
19 let skipped_cmds += 1 22 let skipped_cmds += 1
20 endif 23 endif
24
25 let idx += 1
26 let flags = lines[idx]
27 let idx += 1
28 let addr_type = lines[idx]
29
30 if flags =~ '\<RANGE\>'
31 if addr_type =~ 'ADDR_NONE'
32 echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Using RANGE with ADDR_NONE: ' .. line
33 endif
34 else
35 if addr_type !~ 'ADDR_NONE'
36 echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Missing ADDR_NONE: ' .. line
37 endif
38 endif
39
40 if flags =~ '\<DFLALL\>' && (addr_type =~ 'ADDR_OTHER' || addr_type =~ 'ADDR_NONE')
41 echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Missing misplaced DFLALL: ' .. line
42 endif
21 endif 43 endif
22 endfor 44 let idx += 1
45 endwhile
23 46
24 let cmdidxs1 = {} 47 let cmdidxs1 = {}
25 let cmdidxs2 = {} 48 let cmdidxs2 = {}
26 49
27 for i in range(len(cmds) - 1, 0, -1) 50 for i in range(len(cmds) - 1, 0, -1)