Commits

ZyX_I committed c796586

@/functions: Moved adddecorator feature to a separate plugin

Comments (0)

Files changed (22)

     3. Features                                   |frawor-features|
         3.1. Features defined in plugin/frawor    |frawor-f-plugin/frawor|
         3.2. plugin/frawor/functions features     |frawor-f-frawor/functions|
-        3.3. @/decorators/altervars features      |frawor-f-decorators/altervars|
-        3.4. plugin/frawor/options features       |frawor-f-frawor/options|
-        3.5. plugin/frawor/checks features        |frawor-f-frawor/checks|
-        3.6. plugin/frawor/mappings features      |frawor-f-frawor/mappings|
-        3.7. plugin/frawor/autocommands features  |frawor-f-frawor/autocommands|
-        3.8. plugin/frawor/commands features      |frawor-f-frawor/commands|
-        3.9. plugin/frawor/resources features     |frawor-f-frawor/resources|
-        3.10. plugin/frawor/python features       |frawor-f-frawor/python|
-        3.11. plugin/frawor/perl features         |frawor-f-frawor/perl|
-        3.12. plugin/frawor/lua features          |frawor-f-frawor/lua|
-        3.13. plugin/frawor/ruby features         |frawor-f-frawor/ruby|
-        3.14. plugin/frawor/tcl features          |frawor-f-frawor/tcl|
+        3.3. plugin/frawor/decorators features    |frawor-f-frawor/decorators|
+        3.4. @/decorators/altervars features      |frawor-f-decorators/altervars|
+        3.5. plugin/frawor/options features       |frawor-f-frawor/options|
+        3.6. plugin/frawor/checks features        |frawor-f-frawor/checks|
+        3.7. plugin/frawor/mappings features      |frawor-f-frawor/mappings|
+        3.8. plugin/frawor/autocommands features  |frawor-f-frawor/autocommands|
+        3.9. plugin/frawor/commands features      |frawor-f-frawor/commands|
+        3.10. plugin/frawor/resources features     |frawor-f-frawor/resources|
+        3.11. plugin/frawor/python features       |frawor-f-frawor/python|
+        3.12. plugin/frawor/perl features         |frawor-f-frawor/perl|
+        3.13. plugin/frawor/lua features          |frawor-f-frawor/lua|
+        3.14. plugin/frawor/ruby features         |frawor-f-frawor/ruby|
+        3.15. plugin/frawor/tcl features          |frawor-f-frawor/tcl|
     4. Resources                                  |frawor-resources|
         4.1. map resource                         |frawor-r-map|
         4.2. os resource                          |frawor-r-os|
         Creates a function out of given {funcdescr} (see 
         |frawor-t-funcdescr|). Is useful to wrap some function with 
         savers/setters without making it accessible outside of plugin.
+
+------------------------------------------------------------------------------
+3.3. plugin/frawor/decorators features            *frawor-f-frawor/decorators*
+
                                                        *frawor-f-adddecorator*
 adddecorator : function ({decid}, {decfunc})
              + unload
                     argument. Priority: 64. Defined in plugin/frawor/checks.
 
 ------------------------------------------------------------------------------
-3.3. @/decorators/altervars features           *frawor-f-decorators/altervars*
+3.4. @/decorators/altervars features           *frawor-f-decorators/altervars*
 
                                                       *frawor-f-addaltspecial*
 addaltspecial : function ({id}, {saver}, {setter}[, {opts}])
                      argument.
 
 ------------------------------------------------------------------------------
-3.4. plugin/frawor/options features                  *frawor-f-frawor/options*
+3.5. plugin/frawor/options features                  *frawor-f-frawor/options*
 
                                                           *frawor-f-getoption*
 getoption : function ({optname}[, {scopes}]) + s:_options, s:_oprefix
         |frawor-od-scopes|.
 
 ------------------------------------------------------------------------------
-3.5. plugin/frawor/checks features                    *frawor-f-frawor/checks*
+3.6. plugin/frawor/checks features                    *frawor-f-frawor/checks*
 
                                                         *frawor-f-conschecker*
 conschecker : function ({checker})
         Like |frawor-f-conschecker|, but for filters, see |frawor-t-filter|.
 
 ------------------------------------------------------------------------------
-3.6. plugin/frawor/mappings features                *frawor-f-frawor/mappings*
+3.7. plugin/frawor/mappings features                *frawor-f-frawor/mappings*
 
                                                         *frawor-f-addmapgroup*
 mapgroup.add : function ({mgid}, {mappings}[, {mgopts}])
         that one which defined this group.
 
 ------------------------------------------------------------------------------
-3.7. plugin/frawor/autocommands features        *frawor-f-frawor/autocommands*
+3.8. plugin/frawor/autocommands features        *frawor-f-frawor/autocommands*
 
 augroup.add : function ({agid}, {events})               *frawor-f-augroup.add*
             + unload
             let s:_augroups+=['FooBar']
 
 ------------------------------------------------------------------------------
-3.8. plugin/frawor/commands features                *frawor-f-frawor/commands*
+3.9. plugin/frawor/commands features                *frawor-f-frawor/commands*
 
 delcommands : unloadpre + s:_commands                   *frawor-f-delcommands*
               register + s:_commands
             let s:_commands+=["Foo"]
 
 ------------------------------------------------------------------------------
-3.9. plugin/frawor/resources features              *frawor-f-frawor/resources*
+3.10. plugin/frawor/resources features              *frawor-f-frawor/resources*
 
 postresource : function ({rid}, {resource})            *frawor-f-postresource*
              + register, unload
         so you don't need anything to get it working.
 
 ------------------------------------------------------------------------------
-3.10. plugin/frawor/python features                   *frawor-f-frawor/python*
+3.11. plugin/frawor/python features                   *frawor-f-frawor/python*
 
 All plugin/frawor/python features are available only if vim is compiled with 
 python support.
         feature, so you don't need to do anything to make it work.
 
 ------------------------------------------------------------------------------
-3.11. plugin/frawor/perl features                       *frawor-f-frawor/perl*
+3.12. plugin/frawor/perl features                       *frawor-f-frawor/perl*
 
 All plugin/frawor/perl features are available only if vim is compiled with 
 perl support.
         feature, so you don't need to do anything to make it work.
 
 ------------------------------------------------------------------------------
-3.12. plugin/frawor/lua features                        *frawor-f-frawor/lua*
+3.13. plugin/frawor/lua features                        *frawor-f-frawor/lua*
 
 All plugin/frawor/lua features are available only if vim is compiled with 
 lua support.
         need to do anything to make it work.
 
 ------------------------------------------------------------------------------
-3.13. plugin/frawor/ruby features                       *frawor-f-frawor/ruby*
+3.14. plugin/frawor/ruby features                       *frawor-f-frawor/ruby*
 
 All plugin/frawor/ruby features are available only if vim is compiled with 
 ruby support.
         feature, so you don't need to do anything to make it work.
 
 ------------------------------------------------------------------------------
-3.14. plugin/frawor/tcl features                        *frawor-f-frawor/tcl*
+3.15. plugin/frawor/tcl features                        *frawor-f-frawor/tcl*
 
 All plugin/frawor/tcl features are available only if vim is compiled with 
 tcl support.

plugin/frawor/checks.vim

     finish
 endif
 execute frawor#Setup('0.0', {'@/fwc': '0.0',
-            \          '@/functions': '0.0'}, 1)
+            \         '@/decorators': '0.0'}, 1)
 "▶1 _messages
 if v:lang=~?'ru'
     let s:_messages={

plugin/frawor/decorators.vim

+"▶1 Header
+scriptencoding utf-8
+if exists('s:_pluginloaded') || exists('g:fraworOptions._donotload') ||
+            \exists('g:frawor__donotload')
+    finish
+endif
+execute frawor#Setup('0.0', {'@/resources': '0.0'}, 1)
+"▶1 Define messages
+if v:lang=~?'ru'
+    let s:_messages={
+                \       'nodec': 'Обвязка «%s» не существует',
+                \    'deidnstr': 'Имя обвязки, создаваемой для дополнения %s, '.
+                \                'не является строкой',
+                \     'invdeid': 'Ошибка создания обвязки для дополнения %s: '.
+                \                'строка «%s» не может являться именем обвязки',
+            \}
+    call extend(s:_messages, map({
+                \     'deiddef': 'обвязка уже определена дополнением %s',
+                \     'decnfun': 'обвязка является не является ссылкой '.
+                \                'на функцию',
+                \      'deuref': 'обвязка является ссылкой '.
+                \                'на неизвестную функцию',
+            \},
+            \'"Ошибка создания обвязки %s для дополнения %s: ".v:val'))
+else
+    let s:_messages={
+                \       'nodec': 'Decorator `%s'' does not exist'
+                \    'deidnstr': 'Error while creating decorator '.
+                \                'for plugin %s: its identifier is not '.
+                \                'a String',
+                \     'invdeid': 'Error while creating decorator '.
+                \                'for plugin %s: String `%s'' is not a valid '.
+                \                'decorator identifier',
+            \}
+    call extend(s:_messages, map({
+                \     'deiddef': 'decorator already defined by plugin %s',
+                \     'decnfun': 'decorator is not a function reference',
+                \      'deuref': 'decorator is a reference to unknown function',
+            \},
+            \'"Error while creating decorator %s for plugin %s: ".v:val'))
+endif
+"▶1 rewritefname    :: sid, Funcref → funcname
+function s:F.rewritefname(sid, Fref)
+    let fstr=string(a:Fref)[10:-3]
+    if fstr[:1]==#'s:'
+        let fstr='<SNR>'.a:sid.'_'.fstr[2:]
+    endif
+    return fstr
+endfunction
+"▶1 refunction      :: sid, Funcref, throwargs → Funcref
+function s:F.refunction(sid, Fref, ...)
+    let fstr=s:F.rewritefname(a:sid, a:Fref)
+    if string(+fstr)==#fstr
+        return a:Fref
+    else
+        if !exists('*'.fstr)
+            call call(s:_f.throw, a:000, {})
+        endif
+        return function(fstr)
+    endif
+endfunction
+"▶1 adddecorator feature
+"▶2 adddecorator    :: {f}, deid, Decorator::Funcref → + fdict, s:decorators
+let s:decorators={}
+let s:lastdeid=0
+function s:F.adddecorator(plugdict, fdict, deid, Decorator)
+    "▶3 Check arguments
+    if type(a:deid)!=type("")
+        call s:_f.throw('deidnstr', a:plugdict.id)
+    elseif a:deid!~#'^\w\+$' && a:deid!=#'_'
+        call s:_f.throw('invdeid', a:plugdict.id, a:deid)
+    elseif has_key(s:decorators, a:deid)
+        call s:_f.throw('deiddef', a:deid, a:plugdict.id,
+                    \              s:decorators[a:deid].plid)
+    elseif type(a:Decorator)!=2
+        call s:_f.throw('decnfun', a:deid, a:plugdict.id)
+    endif
+    "▲3
+    let d={}
+    let decorator={'id': a:deid,
+                \'plid': a:plugdict.id,
+                \'pref': printf('v%x_%s', s:lastdeid, a:deid),
+                \'func': s:F.refunction(a:plugdict.sid, a:Decorator,
+                \                       'deuref', a:deid, a:plugdict.id),}
+    let s:lastdeid+=1
+    let a:fdict[decorator.id]=decorator
+    let s:decorators[decorator.id]=decorator
+endfunction
+"▶2 deldecorators
+function s:F.deldecorators(plugdict, fdict)
+    for decorator in values(a:fdict)
+        unlet s:decorators[decorator.id]
+        unlet a:fdict[decorator.id]
+    endfor
+endfunction
+"▶2 Register feature
+call s:_f.newfeature('adddecorator', {'cons': s:F.adddecorator,
+            \                       'unload': s:F.deldecorators,})
+"▶1 getdecorator
+function s:F.getdecorator(id)
+    if !has_key(s:decorators, a:id)
+        call s:_f.throw('nodec', a:id)
+    endif
+    return s:decorators[a:id]
+endfunction
+call s:_f.postresource('getdecorator', s:F.getdecorator)
+"▶1
+call frawor#Lockvar(s:, 'decorators,lastdeid')
+" vim: fmr=▶,▲ sw=4 ts=4 sts=4 et tw=80

plugin/frawor/decorators/altervars.vim

             \exists('g:frawor__donotload')
     finish
 endif
-execute frawor#Setup('0.0', {'@/functions': '0.0',
-            \                   '@/checks': '0.0',
-            \     '@/decorators/altervars': '0.0'}, 1)
+execute frawor#Setup('0.0', {'@/decorators': '0.0',
+            \                    '@/checks': '0.0',
+            \      '@/decorators/altervars': '0.0'}, 1)
 "▶1 Define messages
 if v:lang=~?'ru'
     let s:_messages={

plugin/frawor/functions.vim

             \exists('g:frawor__donotload')
     finish
 endif
-execute frawor#Setup('0.0', {}, 1)
+execute frawor#Setup('0.0', {'@/decorators': '0.0'}, 1)
 "▶1 _messages
 if v:lang=~?'ru'
     let s:_messages={
                 \                '%s для функции %s дополнения %s: %s',
                 \     'oexcept': 'Ошибка при установке настройки %s '.
                 \                'для функции %s дополнения %s: %s',
-                \    'deidnstr': 'Имя обвязки, создаваемой для дополнения %s, '.
-                \                'не является строкой',
-                \     'invdeid': 'Ошибка создания обвязки для дополнения %s: '.
-                \                'строка «%s» не может являться именем обвязки',
                 \    'deceqpri': 'Приоритет декораторов %s и %s совпадает',
             \})
-    call extend(s:_messages, map({
-                \     'deiddef': 'обвязка уже определена дополнением %s',
-                \     'decnfun': 'обвязка является не является ссылкой '.
-                \                'на функцию',
-                \      'deuref': 'обвязка является ссылкой '.
-                \                'на неизвестную функцию',
-            \},
-            \'"Ошибка создания обвязки %s для дополнения %s: ".v:val'))
 else
     let s:_messages={
                 \    'fnotdict': 'functions argument must be a dictionary',
                 \                '%s',
                 \     'oexcept': 'Error while setting option %s '.
                 \                'for function %s of a plugin %s: %s',
-                \    'deidnstr': 'Error while creating decorator '.
-                \                'for plugin %s: its identifier is not '.
-                \                'a String',
-                \     'invdeid': 'Error while creating decorator '.
-                \                'for plugin %s: String `%s'' is not a valid '.
-                \                'decorator identifier',
                 \    'deceqpri': 'Decorators %s and %s have equal priority',
             \})
-    call extend(s:_messages, map({
-                \     'deiddef': 'decorator already defined by plugin %s',
-                \     'decnfun': 'decorator is not a function reference',
-                \      'deuref': 'decorator is a reference to unknown function',
-            \},
-            \'"Error while creating decorator %s for plugin %s: ".v:val'))
 endif
 "▶1 rewritefname    :: sid, Funcref → funcname
 function s:F.rewritefname(sid, Fref)
     let func=["function ".fname."(...)",
                 \'let _={"d": {}, "F": '.fpref.'.function}',
                 \]
-    let decs=map(filter(keys(a:funopts),
-                \       'v:val[0]==#"@" && has_key(s:decorators, v:val[1:])'),
-                \'s:decorators[v:val[1:]]')
+    let decs=map(filter(keys(a:funopts), 'v:val[0] is "@"'),
+                \'s:_r.getdecorator(v:val[1:])')
     let fblocks=[]
     let addedrval=0
     for decorator in decs
             \                   'unload': s:F.delfunctions,
             \                     'init': {'fundictsname': 'wrappedfuncs',
             \                                  'fundicts': {}}})
-"▶1 adddecorator feature
-"▶2 adddecorator    :: {f}, deid, Decorator::Funcref → + fdict, s:decorators
-let s:decorators={}
-let s:lastdeid=0
-function s:F.adddecorator(plugdict, fdict, deid, Decorator)
-    "▶3 Check arguments
-    if type(a:deid)!=type("")
-        call s:_f.throw('deidnstr', a:plugdict.id)
-    elseif a:deid!~#'^\w\+$' && a:deid!=#'_'
-        call s:_f.throw('invdeid', a:plugdict.id, a:deid)
-    elseif has_key(s:decorators, a:deid)
-        call s:_f.throw('deiddef', a:deid, a:plugdict.id,
-                    \              s:decorators[a:deid].plid)
-    elseif type(a:Decorator)!=2
-        call s:_f.throw('decnfun', a:deid, a:plugdict.id)
-    endif
-    "▲3
-    let d={}
-    let decorator={'id': a:deid,
-                \'plid': a:plugdict.id,
-                \'pref': printf('v%x_%s', s:lastdeid, a:deid),
-                \'func': s:F.refunction(a:plugdict.sid, a:Decorator,
-                \                       'deuref', a:deid, a:plugdict.id),}
-    let s:lastdeid+=1
-    let a:fdict[decorator.id]=decorator
-    let s:decorators[decorator.id]=decorator
-endfunction
-"▶2 deldecorators
-function s:F.deldecorators(plugdict, fdict)
-    for decorator in values(a:fdict)
-        unlet s:decorators[decorator.id]
-        unlet a:fdict[decorator.id]
-    endfor
-endfunction
-"▶2 Register feature
-call s:_f.newfeature('adddecorator', {'cons': s:F.adddecorator,
-            \                       'unload': s:F.deldecorators,})
 "▶1
-call frawor#Lockvar(s:, 'decorators,extfunctions,wrappedfuncs,lastdeid,'.
-            \           '_checkers,_filters')
+call frawor#Lockvar(s:, 'extfunctions,wrappedfuncs')
 " vim: fmr=▶,▲ sw=4 ts=4 sts=4 et tw=80

test/global-functions-reload.ok

 1      echo 1
    endfunction
 
-   function <SNR>22_testFunction()
+   function <SNR>23_testFunction()
 1      echo 2
    endfunction
 
 1      echo 1
    endfunction
 
-   function <SNR>22_testFunction()
+   function <SNR>23_testFunction()
 1      echo 2
    endfunction

test/ignoredeps-feature.ok

 load: plugin/frawor/fwc/parser
 register: plugin/frawor
 load: plugin/frawor
+register: plugin/frawor/decorators
+load: plugin/frawor/decorators
 register: plugin/frawor/mappings
 load: plugin/frawor/mappings
 register: plugin/frawor/os

test/invalid-adddecorator.ok

-.1: plugin/frawor/functions:deidnstr
-.2: plugin/frawor/functions:deiddef
-.3: plugin/frawor/functions:invdeid
-.4: plugin/frawor/functions:decnfun
-.5: plugin/frawor/functions:deuref
+.1: plugin/frawor/decorators:deidnstr
+.2: plugin/frawor/decorators:deiddef
+.3: plugin/frawor/decorators:invdeid
+.4: plugin/frawor/decorators:decnfun
+.5: plugin/frawor/decorators:deuref
 .6: plugin/frawor/functions:invdecret

test/invalid-addextfunctions.ok

 .26: plugin/frawor/decorators/altervars:spmisarg
 .27: plugin/frawor/decorators/altervars:acheckfailed
 .28: plugin/frawor/decorators/altervars:spmisarg
-.29: plugin/frawor/functions:decndep
+.29: plugin/frawor/functions:decndep
+.30: plugin/frawor/decorators:nodec

test/reload-frawor.ok

 load: plugin/frawor/fwc/parser
 register: plugin/frawor
 load: plugin/frawor
+register: plugin/frawor/decorators
+load: plugin/frawor/decorators
 register: plugin/frawor/mappings
 load: plugin/frawor/mappings
 register: plugin/frawor/os
 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/writefile-feature
 unloadpre: plugin/frawor/decorators/altervars
 unloadpre: plugin/frawor/checks
-unloadpre: plugin/frawor/functions
+unloadpre: plugin/frawor/decorators
 unloadpre: plugin/frawor/fwc
 unloadpre: plugin/frawor/fwc/compiler
 unloadpre: plugin/frawor/fwc/parser
 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/options
-load: plugin/frawor/options
+register: plugin/frawor/decorators
+load: plugin/frawor/decorators
 register: plugin/frawor/fwc
 load: plugin/frawor/fwc
 register: plugin/ignoredeps-feature
 load: plugin/ignoredeps-feature
-register: plugin/frawor/functions
-load: plugin/frawor/functions
+register: plugin/frawor/checks
+load: plugin/frawor/checks
 register: plugin/frawor/os
 load: plugin/frawor/os
 register: autoload/frawor
 load: autoload/frawor
-register: plugin/writefile-feature
-load: plugin/writefile-feature
 register: plugin/frawor/autocommands
 load: plugin/frawor/autocommands
+register: plugin/frawor/options
+load: plugin/frawor/options
 register: plugin/frawor/fwc/parser
 load: plugin/frawor/fwc/parser
 register: plugin/frawor
 load: plugin/frawor/fwc/compiler
 register: plugin/frawor/resources
 load: plugin/frawor/resources
-register: plugin/frawor/checks
-load: plugin/frawor/checks
+register: plugin/writefile-feature
+load: plugin/writefile-feature
 register: plugin/frawor/decorators/altervars
 load: plugin/frawor/decorators/altervars
 register: plugin/frawor/tcl
 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/reload-ignoredeps.ok

 load: plugin/frawor/fwc/parser
 register: plugin/frawor
 load: plugin/frawor
+register: plugin/frawor/decorators
+load: plugin/frawor/decorators
 register: plugin/frawor/mappings
 load: plugin/frawor/mappings
 register: plugin/frawor/os
 load: plugin/frawor/fwc/parser
 register: plugin/frawor
 load: plugin/frawor
+register: plugin/frawor/decorators
+load: plugin/frawor/decorators
 register: plugin/frawor/mappings
 load: plugin/frawor/mappings
 register: plugin/frawor/os

test/reload-writefile.ok

 load: plugin/frawor/fwc/parser
 register: plugin/frawor
 load: plugin/frawor
+register: plugin/frawor/decorators
+load: plugin/frawor/decorators
 register: plugin/frawor/mappings
 load: plugin/frawor/mappings
 register: plugin/frawor/os
 load: plugin/frawor/fwc/parser
 register: plugin/frawor
 load: plugin/frawor
+register: plugin/frawor/decorators
+load: plugin/frawor/decorators
 register: plugin/frawor/mappings
 load: plugin/frawor/mappings
 register: plugin/frawor/os

test/rtp/plugin/adddecorator.vim

 execute frawor#Setup('0.0', {'@/functions': '0.0',
             \              '@adddecorator': '0.0',
+            \               '@/decorators': '0.0',
             \     '@/decorators/altervars': '0.0',
             \                   '@/checks': '0.0'}, 1)
 function s:F.testdecorator(plugdict, ...)

test/rtp/plugin/invalid-adddecorator.1.vim

-execute frawor#Setup('0.0', {'plugin/frawor/functions': '0.0'}, 1)
+execute frawor#Setup('0.0', {'@/decorators': '0.0'}, 1)
 call s:_f.adddecorator(0, 0)

test/rtp/plugin/invalid-adddecorator.2.vim

-execute frawor#Setup('0.0', {'plugin/frawor/functions': '0.0'}, 1)
+execute frawor#Setup('0.0', {'@/decorators': '0.0'}, 1)
 call s:_f.adddecorator("altervars", 0)

test/rtp/plugin/invalid-adddecorator.3.vim

-execute frawor#Setup('0.0', {'plugin/frawor/functions': '0.0'}, 1)
+execute frawor#Setup('0.0', {'@/decorators': '0.0'}, 1)
 call s:_f.adddecorator("-abc", 0)

test/rtp/plugin/invalid-adddecorator.4.vim

-execute frawor#Setup('0.0', {'plugin/frawor/functions': '0.0'}, 1)
+execute frawor#Setup('0.0', {'@/decorators': '0.0'}, 1)
 call s:_f.adddecorator("abc", 0)

test/rtp/plugin/invalid-adddecorator.5.vim

-execute frawor#Setup('0.0', {'plugin/frawor/functions': '0.0'}, 1)
+execute frawor#Setup('0.0', {'@/decorators': '0.0'}, 1)
 let Decfunc=function('s:Eval')
 delfunction s:Eval
 call s:_f.adddecorator("abc", Decfunc)

test/rtp/plugin/invalid-adddecorator.6.vim

-execute frawor#Setup('0.0', {'plugin/frawor/functions': '0.0',
-            \          'plugin/invalid-adddecorator.6': '0.0'}, 1)
+execute frawor#Setup('0.0', {'@/decorators': '0.0',
+            \                 '@/functions': '0.0',
+            \     '@invalid-adddecorator.6': '0.0'}, 1)
 function s:InvalidDecorator(...)
     return 0
 endfunction

test/rtp/plugin/invalid-addextfunctions.29.vim

-execute frawor#Setup('0.0', {'@/functions': '0.0'}, 1)
+execute frawor#Setup('0.0', {'@/functions': '0.0',
+            \               '@/decorators': '0.0'}, 1)
 call s:_f.adddecorator('test', function('string'))
 call s:_f.addextfunctions({'Function': {'function': function('tr'),
             \                              '@test': 0}})

test/rtp/plugin/invalid-addextfunctions.30.vim

+execute frawor#Setup('0.0', {'@/functions': '0.0'}, 1)
+call s:_f.addextfunctions({'Function': {'function': function('tr'),
+            \             '@xxx_unknown_decorator': 0}})

test/unload-self.ok

 load: plugin/frawor/fwc/parser
 register: plugin/frawor
 load: plugin/frawor
+register: plugin/frawor/decorators
+load: plugin/frawor/decorators
 register: plugin/frawor/mappings
 load: plugin/frawor/mappings
 register: plugin/frawor/os