Commits

ZyX_I committed d68db9a

@/autocommands: Made augroup.add use FWC to check its arguments, forced {nested} list item

Comments (0)

Files changed (22)

             + unload
         Creates an autocommand group with name FraworAugroup_{agid} containing 
         events defined in {events} list. Each item in {events} list must be 
-        a list with three or four values: ({type}, {pattern}, {command}[, 
-        {nested}]). {type} is a list (either actual |List| or comma-separated 
+        a list with three or four values: ({type}, {pattern}, {nested}, 
+        {command}). {type} is a list (either actual |List| or comma-separated 
         string) of event types (see |autocmd-events|), {pattern} is a string 
-        described in |autocmd-patterns|, {nested} indicates that autocommand 
-        is nested (see |autocmd-nested|) (value is ignored, only presense of 
-        additional item matters) and {command} is one of the following:
+        described in |autocmd-patterns|, {nested} determines whether 
+        autocommand is nested (see |autocmd-nested|) and {command} is one of 
+        the following:
         1. List with at least one item. First item must be either a dictionary 
            that describes a function (see |frawor-t-funcdescr|) or a function 
            reference. The following items are arguments that will be passed to 

plugin/frawor/autocommands.vim

             \exists('g:frawor__donotload')
     finish
 endif
-execute frawor#Setup('0.0', {}, 1)
+execute frawor#Setup('0.0', {'@/functions': '0.0',
+            \             '@/fwc/compiler': '0.0'}, 1)
 "▶1 Define messages
 if v:lang=~?'ru'
     let s:_messages={
-                \   'agidnstr': 'Ошибка создания группы событий '.
-                \               'для дополнения %s: название группы '.
-                \               'не является строкой',
                 \    'invagid': 'Ошибка создания группы событий '.
                 \               'для дополнения %s: строка «%s» не может '.
                 \               'являться названием группы',
             \}
     call extend(s:_messages, map({
                 \    'agiddef': 'группа уже определена дополнением %s',
-                \    'agenlst': 'список событий не является списком',
-                \   'noevents': 'отсутствуют события в списке',
-                \      'enlst': 'одно из событий не является списком',
-                \     'en3lst': 'одно из событий содержит не три элемента',
             \},'"Ошибка создания группы событий %s для дополнения %s: ".v:val'))
     call extend(s:_messages, map({
                 \ 'etypenslst': 'тип события не является строкой или списком',
                 \  'invetypes': 'часть типов событий не верна',
-                \    'ptrnstr': 'шаблон не является строкой',
                 \   'emptycmd': 'список аргументов пуст',
                 \ 'nowrapfunc': 'отсутствует функция _f.wrapfunc '.
                 \               '(дополнение должно зависеть от '.
             \   'для дополнения %s: ".v:val'))
 else
     let s:_messages={
-                \   'agidnstr': 'Error while creating augroup for plugin %s: '.
-                \               'group ID is not a String',
                 \    'invagid': 'Error while creating augroup for plugin %s: '.
                 \               'string `%s'' is not a valid group ID',
                 \   'loadfail': 'Failed to load plugin %s',
             \}
     call extend(s:_messages, map({
                 \    'agiddef': 'group was already defined by plugin %s',
-                \    'agenlst': 'event list is not a List',
-                \   'noevents': 'no events in list',
-                \      'enlst': 'one of events is not a List',
-                \     'en3lst': 'one of events contains not 3 elements',
             \}, '"Error while creating augroup %s for plugin %s: ".v:val'))
     call extend(s:_messages, map({
                 \ 'etypenslst': 'event type is neither String nor List',
                 \  'invetypes': 'some event types are not valid',
-                \    'ptrnstr': 'event pattern is not a String',
                 \   'emptycmd': 'arguments list is empty',
                 \ 'nowrapfunc': 'function _f.wrapfunc is absent '.
                 \               '(plugin must depend on '.
 "▶2 augroup.del  :: {f}[, agid] → + :autocmd
 function s:F.augroup.del(plugdict, fdict, ...)
     if a:0
-        if type(a:1)!=type("")
+        if type(a:1)!=type('')
             call s:_f.throw('dagidnstr', a:plugdict.id)
         elseif !has_key(a:fdict, a:1)
             call s:_f.throw('uknagid', a:1, a:plugdict.id)
 endfunction
 "▶2 augroup.add  :: {f}, agid, [event] → + :autocmd, s:augroups
 function s:F.augroup.add(plugdict, fdict, agid, events)
-    "▶3 Check arguments
-    if type(a:agid)!=type('')
-        call s:_f.throw('agidnstr', a:plugdict.id)
-    elseif a:agid!~#'^\w\+$'
-        call s:_f.throw('invagid', a:plugdict.id, a:agid)
-    elseif has_key(s:augroups,a:agid) && s:augroups[a:agid].plid!=#a:plugdict.id
-        call s:_f.throw('agiddef', a:agid,a:plugdict.id,s:augroups[a:agid].plid)
-    elseif type(a:events)!=type([])
-        call s:_f.throw('agenlst', a:agid, a:plugdict.id)
-    elseif empty(a:events)
-        call s:_f.throw('noevents', a:agid, a:plugdict.id)
-    elseif !empty(filter(copy(a:events), 'type(v:val)!='.type([])))
-        call s:_f.throw('enlst', a:agid, a:plugdict.id)
-    elseif !empty(filter(copy(a:events), 'len(v:val)!=3 && len(v:val)!=4'))
-        call s:_f.throw('en3lst', a:agid, a:plugdict.id)
-    endif
-    "▲3
     if has_key(s:augroups, a:agid)
         let augroup=s:augroups[a:agid]
     else
     endif
     let i=len(augroup.events)
     let d={}
-    for [d.event, d.pattern, d.command; nested] in a:events
+    for [d.event, d.pattern, d.nested, d.command] in a:events
         let epc=[]
         if type(d.event)==type("")
             call add(epc, split(d.event, ','))
         elseif type(d.event)==type([])
             call add(epc, d.event)
-        "▶3 Invalid event types
-        else
-            call s:_f.throw('etypenslst', i, a:agid, a:plugdict.id)
         endif
+        "▶3 Invalid events
         if !empty(filter(copy(epc[0]), 'type(v:val)!='.type("").' || '.
                     \                  'v:val=~#"\\_[^a-zA-Z]" || '.
                     \                  '!exists("##".v:val)'))
         endif
         "▲3
         let epc[0]=join(epc[0], ",")
-        "▶3 Check pattern
-        if type(d.pattern)!=type("")
-            call s:_f.throw("ptrnstr", i, a:agid, a:plugdict.id)
-        endif
-        "▲3
         call add(epc, escape(d.pattern, ' '))
-        if !empty(nested)
+        if d.nested
             call add(epc, 'nested')
         endif
         if type(d.command)==type([])
-            "▶3 Check d.command
-            if empty(d.command)
-                call s:_f.throw('emptycmd', i, a:agid, a:plugdict.id)
-            endif
-            "▲3
             let augroup.args[i]=d.command[1:]
             let d.command=d.command[0]
         endif
         elseif !has_key(augroup.args, i) && type(d.command)==type("")
             call add(epc, substitute(d.command, '<SID>',
                         \            '<SNR>'.a:plugdict.sid.'_', 'g'))
-        "▶3 Unknown d.command
-        else
-            call s:_f.throw('ukncmd', i, a:agid, a:plugdict.id)
         endif
-        "▲3
         call add(augroup.events, join(epc))
         let i+=1
         unlet d.event d.pattern d.command
     let a:fdict[augroup.id]=augroup
     call s:F.createau(augroup)
 endfunction
+let s:F.augroup.add=s:_f.wrapfunc({'function': s:F.augroup.add,
+            \                          '@FWC': ['_ _'.
+            \'(#invagid(@^.0.id, .) match/\v^\w+$/ #^'.
+            \ 'either not key augroups, '.
+            \        '#agiddef(., @^.0.id, augroups.(@).plid) '.
+            \           'value @^.0.id is augroups.(@^^.2).plid)'.
+            \'list tuple ((type "", []), (type ""), bool, '.
+            \            '(either ((type string, function, dictionary),'.
+            \                     '(type [] #emptycmd(%, @<, @<<<.id) '.
+            \                              '?=!empty(@.@)))))',
+            \'check']})
 "▶2 Define feature
 call s:_f.newfeature('augroup', {'cons': s:F.augroup,
             \                  'unload': s:F.augroup.del,})

plugin/frawor/mappings.vim

     endif
 endfunction
 "▶1 Create autocommands
-call s:_f.augroup.add('Mappings', [["BufEnter",  '*', s:F.bufentered   ],
-            \                      ["BufDelete", '*', s:F.delbuffermaps],
-            \                      ["Filetype",  '*', s:F.ftmap        ]])
+call s:_f.augroup.add('Mappings', [["BufEnter",  '*', 0, s:F.bufentered   ],
+            \                      ["BufDelete", '*', 0, s:F.delbuffermaps],
+            \                      ["Filetype",  '*', 0, s:F.ftmap        ]])
 "▶1 map resource
 call s:_f.postresource('map', {'maparg': s:F.savemap,
             \                     'map': s:F.map,

test/invalid-augroup.add.ok

-.1: plugin/frawor/autocommands:agidnstr
-.2: plugin/frawor/autocommands:invagid
-.3: plugin/frawor/autocommands:noevents
-.4: plugin/frawor/autocommands:en3lst
-.5: plugin/frawor/autocommands:etypenslst
-.6: plugin/frawor/autocommands:en3lst
-.7: plugin/frawor/autocommands:etypenslst
-.8: plugin/frawor/autocommands:invetypes
-.9: plugin/frawor/autocommands:invetypes
-.10: plugin/frawor/autocommands:ukncmd
-.11: plugin/frawor/autocommands:ptrnstr
-.12: plugin/frawor/autocommands:ukncmd
-.13: plugin/frawor/autocommands:emptycmd
-.14: plugin/frawor/autocommands:ukncmd
-.15: plugin/frawor/autocommands:nowrapfunc
-.16: plugin/frawor/autocommands:invagid
-.17: plugin/frawor/autocommands:agenlst
-.19: plugin/frawor/autocommands:agiddef
-.20: plugin/frawor/autocommands:enlst
+.1: plugin/frawor/fwc/compiler:FWCfail
+>>> .1: messages
+plugin/frawor/fwc/compiler:typefail
+plugin/frawor/autocommands:invagid
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.2: plugin/frawor/fwc/compiler:FWCfail
+>>> .2: messages
+plugin/frawor/fwc/compiler:nregmatch
+plugin/frawor/autocommands:invagid
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.4: plugin/frawor/fwc/compiler:FWCfail
+>>> .4: messages
+plugin/frawor/fwc/compiler:notfail
+plugin/frawor/fwc/compiler:isnot
+plugin/frawor/fwc/compiler:eitherfail
+plugin/frawor/autocommands:agiddef
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.5: plugin/frawor/fwc/compiler:FWCfail
+>>> .5: messages
+plugin/frawor/fwc/compiler:notfail
+plugin/frawor/fwc/compiler:isnot
+plugin/frawor/fwc/compiler:eitherfail
+plugin/frawor/autocommands:agiddef
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.6: plugin/frawor/fwc/compiler:FWCfail
+>>> .6: messages
+plugin/frawor/fwc/compiler:notfail
+plugin/frawor/fwc/compiler:isnot
+plugin/frawor/fwc/compiler:eitherfail
+plugin/frawor/autocommands:agiddef
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.7: plugin/frawor/fwc/compiler:FWCfail
+>>> .7: messages
+plugin/frawor/fwc/compiler:notfail
+plugin/frawor/fwc/compiler:isnot
+plugin/frawor/fwc/compiler:eitherfail
+plugin/frawor/autocommands:agiddef
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.8: plugin/frawor/fwc/compiler:FWCfail
+>>> .8: messages
+plugin/frawor/fwc/compiler:notfail
+plugin/frawor/fwc/compiler:isnot
+plugin/frawor/fwc/compiler:eitherfail
+plugin/frawor/autocommands:agiddef
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.9: plugin/frawor/fwc/compiler:FWCfail
+>>> .9: messages
+plugin/frawor/fwc/compiler:notfail
+plugin/frawor/fwc/compiler:isnot
+plugin/frawor/fwc/compiler:eitherfail
+plugin/frawor/autocommands:agiddef
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.10: plugin/frawor/fwc/compiler:FWCfail
+>>> .10: messages
+plugin/frawor/fwc/compiler:notfail
+plugin/frawor/fwc/compiler:isnot
+plugin/frawor/fwc/compiler:eitherfail
+plugin/frawor/autocommands:agiddef
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.11: plugin/frawor/fwc/compiler:FWCfail
+>>> .11: messages
+plugin/frawor/fwc/compiler:notfail
+plugin/frawor/fwc/compiler:isnot
+plugin/frawor/fwc/compiler:eitherfail
+plugin/frawor/autocommands:agiddef
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.12: plugin/frawor/fwc/compiler:FWCfail
+>>> .12: messages
+plugin/frawor/fwc/compiler:notfail
+plugin/frawor/fwc/compiler:isnot
+plugin/frawor/fwc/compiler:eitherfail
+plugin/frawor/autocommands:agiddef
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.13: plugin/frawor/fwc/compiler:FWCfail
+>>> .13: messages
+plugin/frawor/fwc/compiler:notfail
+plugin/frawor/fwc/compiler:isnot
+plugin/frawor/fwc/compiler:eitherfail
+plugin/frawor/autocommands:agiddef
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.14: plugin/frawor/fwc/compiler:FWCfail
+>>> .14: messages
+plugin/frawor/fwc/compiler:notfail
+plugin/frawor/fwc/compiler:isnot
+plugin/frawor/fwc/compiler:eitherfail
+plugin/frawor/autocommands:agiddef
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.15: plugin/frawor/fwc/compiler:FWCfail
+>>> .15: messages
+plugin/frawor/fwc/compiler:notfail
+plugin/frawor/fwc/compiler:isnot
+plugin/frawor/fwc/compiler:eitherfail
+plugin/frawor/autocommands:agiddef
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.16: plugin/frawor/fwc/compiler:FWCfail
+>>> .16: messages
+plugin/frawor/fwc/compiler:nregmatch
+plugin/frawor/autocommands:invagid
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.17: plugin/frawor/fwc/compiler:FWCfail
+>>> .17: messages
+plugin/frawor/fwc/compiler:typefail
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.19: plugin/frawor/fwc/compiler:FWCfail
+>>> .19: messages
+plugin/frawor/fwc/compiler:notfail
+plugin/frawor/fwc/compiler:isnot
+plugin/frawor/fwc/compiler:eitherfail
+plugin/frawor/autocommands:agiddef
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages
+.20: plugin/frawor/fwc/compiler:FWCfail
+>>> .20: messages
+plugin/frawor/fwc/compiler:typefail
+plugin/frawor/fwc/compiler:FWCfail
+<<< messages

test/reload-frawor.ok

 load: plugin/writefile-feature
 unloadpre: autoload/frawor
 unloadpre: plugin/frawor/commands
-unloadpre: plugin/frawor/functions
 unloadpre: plugin/frawor/lua
 unloadpre: plugin/frawor/mappings
 unloadpre: plugin/frawor/perl
 unloadpre: plugin/frawor/tcl
 unloadpre: plugin/ignoredeps-feature
 unloadpre: plugin/frawor/autocommands
+unloadpre: plugin/frawor/functions
 unloadpre: plugin/frawor/options
 unloadpre: plugin/writefile-feature
 unloadpre: plugin/frawor/decorators/altervars
 unloadpre: plugin/frawor/checks
 unloadpre: plugin/frawor/fwc/compiler
+unloadpre: plugin/frawor/decorators
+unloadpre: plugin/frawor/os
 unloadpre: plugin/frawor/fwc/constructor
 unloadpre: plugin/frawor/fwc/parser
-unloadpre: plugin/frawor/decorators
-unloadpre: plugin/frawor/os
 unloadpre: plugin/frawor/resources
 unloadpre: plugin/frawor
 unload: autoload/frawor
 unload: plugin/frawor/commands
-unload: plugin/frawor/functions
 unload: plugin/frawor/lua
 unload: plugin/frawor/mappings
 unload: plugin/frawor/perl
 unload: plugin/frawor/tcl
 unload: plugin/ignoredeps-feature
 _unload
+register: plugin/frawor/autocommands
+load: plugin/frawor/autocommands
+register: plugin/frawor/checks
+load: plugin/frawor/checks
+register: plugin/frawor/fwc/parser
+load: plugin/frawor/fwc/parser
+register: plugin/frawor
+load: plugin/frawor
 register: plugin/frawor/decorators
 load: plugin/frawor/decorators
-register: plugin/frawor/autocommands
-load: plugin/frawor/autocommands
+register: plugin/frawor/os
+load: plugin/frawor/os
+register: plugin/frawor/resources
+load: plugin/frawor/resources
 register: plugin/ignoredeps-feature
 load: plugin/ignoredeps-feature
 register: plugin/frawor/fwc/constructor
 load: plugin/frawor/fwc/constructor
-register: plugin/frawor/os
-load: plugin/frawor/os
 register: autoload/frawor
 load: autoload/frawor
+register: plugin/frawor/decorators/altervars
+load: plugin/frawor/decorators/altervars
+register: plugin/frawor/options
+load: plugin/frawor/options
+register: plugin/frawor/functions
+load: plugin/frawor/functions
+register: plugin/frawor/fwc/compiler
+load: plugin/frawor/fwc/compiler
 register: plugin/writefile-feature
 load: plugin/writefile-feature
-register: plugin/frawor/options
-load: plugin/frawor/options
-register: plugin/frawor/fwc/parser
-load: plugin/frawor/fwc/parser
-register: plugin/frawor
-load: plugin/frawor
-register: plugin/frawor/fwc/compiler
-load: plugin/frawor/fwc/compiler
-register: plugin/frawor/resources
-load: plugin/frawor/resources
-register: plugin/frawor/checks
-load: plugin/frawor/checks
-register: plugin/frawor/decorators/altervars
-load: plugin/frawor/decorators/altervars
 register: plugin/frawor/tcl
 load: plugin/frawor/tcl
 register: plugin/frawor/ruby
 load: plugin/frawor/mappings
 register: plugin/frawor/lua
 load: plugin/frawor/lua
-register: plugin/frawor/functions
-load: plugin/frawor/functions
 register: plugin/frawor/commands
 load: plugin/frawor/commands

test/rtp/plugin/augroup-twoload.vim

     execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',
                 \                   'plugin/frawor/functions': '0.0'}, 0)
     let s:ecmd={}
-    call s:_f.augroup.add('Au1', [['BufEnter', '*', s:ecmd]])
+    call s:_f.augroup.add('Au1', [['BufEnter', '*', 0, s:ecmd]])
     finish
 endif
 function s:ecmd.function()
     call WriteFile('entered '.expand('<amatch>'))
     call s:_f.augroup.del('Au1')
-    call s:_f.augroup.add('Au1', [['BufWipeout', '*', 'call WriteFile("wiped ".expand("<amatch>"))']])
+    call s:_f.augroup.add('Au1', [['BufWipeout', '*', 0, 'call WriteFile("wiped ".expand("<amatch>"))']])
 endfunction

test/rtp/plugin/augroup.vim

 endfunction
 let s:ef=s:F.entered
 let s:wf={'function': s:ef}
-call s:_f.augroup.add('Au1', [["BufEnter", "*", "call WriteFile('entered '.expand('<amatch>'))"],
-            \                 ["BufEnter", "*", "call <SID>Entered('2')"],
-            \                 ["BufEnter", "*", "if empty(expand('<amatch>'))"],
-            \                 ["BufEnter", "*", "    call <SID>Entered('empty')"],
-            \                 ["BufEnter", "*", "else"],
-            \                 ["BufEnter", "*", "    call <SID>Entered('non-empty')"],
-            \                 ["BufEnter", "*", "endif"],
+call s:_f.augroup.add('Au1', [["BufEnter", "*", 0, "call WriteFile('entered '.expand('<amatch>'))"],
+            \                 ["BufEnter", "*", 0, "call <SID>Entered('2')"],
+            \                 ["BufEnter", "*", 0, "if empty(expand('<amatch>'))"],
+            \                 ["BufEnter", "*", 0, "    call <SID>Entered('empty')"],
+            \                 ["BufEnter", "*", 0, "else"],
+            \                 ["BufEnter", "*", 0, "    call <SID>Entered('non-empty')"],
+            \                 ["BufEnter", "*", 0, "endif"],
             \])
-call s:_f.augroup.add('Au1', [["BufEnter", "def", "new ghi", 1],
-            \                 ["BufEnter", "ghi", "new jkl"],
-            \                 ["BufEnter", "abc", s:ef],
-            \                 ["BufEnter", "abc", [s:ef, 1, 2]],
-            \                 ["BufEnter", "abc", [s:ef]],
-            \                 ["BufEnter", "abc", [s:wf, 1, 2]],
-            \                 ["BufEnter", "abc", [s:wf]],
+call s:_f.augroup.add('Au1', [["BufEnter", "def", 1, "new ghi"],
+            \                 ["BufEnter", "ghi", 0, "new jkl"],
+            \                 ["BufEnter", "abc", 0, s:ef],
+            \                 ["BufEnter", "abc", 0, [s:ef, 1, 2]],
+            \                 ["BufEnter", "abc", 0, [s:ef]],
+            \                 ["BufEnter", "abc", 0, [s:wf, 1, 2]],
+            \                 ["BufEnter", "abc", 0, [s:wf]],
             \])
 augroup TestEnter
     autocmd BufAdd * call s:Entered('testenter')

test/rtp/plugin/invalid-augroup.add.10.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('test', [["BufAdd", "*", "echo 'Foo'"],
-            \                  ["BufAdd", "*", 0]])
+call s:_f.augroup.add('test', [["BufAdd", "*", 0, "echo 'Foo'"],
+            \                  ["BufAdd", "*", 0, 0]])

test/rtp/plugin/invalid-augroup.add.11.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('test', [["BufAdd", "*", "echo 'Foo'"],
-            \                  ["BufAdd", 0, "echo 'Foo'"]])
+call s:_f.augroup.add('test', [["BufAdd", "*", 0, "echo 'Foo'"],
+            \                  ["BufAdd", 0,   0, "echo 'Foo'"]])

test/rtp/plugin/invalid-augroup.add.12.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('test', [["BufAdd", "*", "echo 'Foo'"],
-            \                  ["BufAdd", "*", function("s:Eval")]])
+call s:_f.augroup.add('test', [["BufAdd", "*", 0, "echo 'Foo'"],
+            \                  ["BufAdd", "*", 0, function("s:Eval")]])

test/rtp/plugin/invalid-augroup.add.13.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('test', [["BufAdd", "*", "echo 'Foo'"],
-            \                  ["BufAdd", "*", []]])
+call s:_f.augroup.add('test', [["BufAdd", "*", 0, "echo 'Foo'"],
+            \                  ["BufAdd", "*", 0, []]])

test/rtp/plugin/invalid-augroup.add.14.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('test', [["BufAdd", "*", "echo 'Foo'"],
-            \                  ["BufAdd", "*", [function("s:Eval")]]])
+call s:_f.augroup.add('test', [["BufAdd", "*", 0, "echo 'Foo'"],
+            \                  ["BufAdd", "*", 0, [function("s:Eval")]]])

test/rtp/plugin/invalid-augroup.add.15.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('test', [["BufAdd", "*", "echo 'Foo'"],
-            \                  ["BufAdd", "*", {'function': function("s:Eval")}]])
+call s:_f.augroup.add('test', [["BufAdd", "*", 0, "echo 'Foo'"],
+            \                  ["BufAdd", "*", 0, {'function': function("s:Eval")}]])

test/rtp/plugin/invalid-augroup.add.16.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('', [["BufAdd", "*", "echo 'Foo'"],
-            \              ["BufAdd", "*", {'function': function("s:Eval")}]])
+call s:_f.augroup.add('', [["BufAdd", "*", 0, "echo 'Foo'"],
+            \              ["BufAdd", "*", 0, {'function': function("s:Eval")}]])

test/rtp/plugin/invalid-augroup.add.18.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('aug', [['BufNew', '*', 'echo "abc"']])
+call s:_f.augroup.add('aug', [['BufNew', '*', 0, 'echo "abc"']])

test/rtp/plugin/invalid-augroup.add.19.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('aug', [['BufNew', '*', 'echo "abc"']])
+call s:_f.augroup.add('aug', [['BufNew', '*', 0, 'echo "abc"']])

test/rtp/plugin/invalid-augroup.add.20.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('aug2', [['BufNew', '*', 'echo "abc"'], 0])
+call s:_f.augroup.add('aug2', [['BufNew', '*', 0, 'echo "abc"'], 0])

test/rtp/plugin/invalid-augroup.add.5.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('test', [["BufAdd", "*", "echo 'Foo'"],
-            \                  [0, 0, 0]])
+call s:_f.augroup.add('test', [["BufAdd", "*", 0, "echo 'Foo'"],
+            \                  [0, 0, 0, 0]])

test/rtp/plugin/invalid-augroup.add.6.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('test', [["BufAdd", "*", "echo 'Foo'"],
+call s:_f.augroup.add('test', [["BufAdd", "*", 0, "echo 'Foo'"],
             \                  []])

test/rtp/plugin/invalid-augroup.add.7.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('test', [["BufAdd", "*", "echo 'Foo'"],
-            \                  [0, "*", "echo 'Foo'"]])
+call s:_f.augroup.add('test', [["BufAdd", "*", 0, "echo 'Foo'"],
+            \                  [0, "*", 0, "echo 'Foo'"]])

test/rtp/plugin/invalid-augroup.add.8.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('test', [["BufAdd", "*", "echo 'Foo'"],
-            \                  [["BufAdd", "xxx"], "*", "echo 'Foo'"]])
+call s:_f.augroup.add('test', [["BufAdd", "*", 0, "echo 'Foo'"],
+            \                  [["BufAdd", "xxx"], "*", 0, "echo 'Foo'"]])

test/rtp/plugin/invalid-augroup.add.9.vim

 execute frawor#Setup('0.0', {'plugin/frawor/autocommands': '0.0',}, 1)
-call s:_f.augroup.add('test', [["BufAdd", "*", "echo 'Foo'"],
-            \                  ["BufAdd,xxx", "*", "echo 'Foo'"]])
+call s:_f.augroup.add('test', [["BufAdd", "*", 0, "echo 'Foo'"],
+            \                  ["BufAdd,xxx", "*", 0, "echo 'Foo'"]])