Modify the inscribe decorator to accept a dict.
This commit is contained in:
+3
-4
@@ -58,9 +58,9 @@ HELP_TEMPLATE = '''\
|
|||||||
_dictionary = {}
|
_dictionary = {}
|
||||||
|
|
||||||
|
|
||||||
def inscribe(function):
|
def inscribe(function, d=_dictionary):
|
||||||
'''A decorator to inscribe functions into the default dictionary.'''
|
'''A decorator to inscribe functions into the default dictionary.'''
|
||||||
_dictionary[function.name] = function
|
d[function.name] = function
|
||||||
return function
|
return function
|
||||||
|
|
||||||
|
|
||||||
@@ -351,8 +351,7 @@ def inscribe_(stack, expression, dictionary):
|
|||||||
|
|
||||||
'''
|
'''
|
||||||
(name, body), stack = stack
|
(name, body), stack = stack
|
||||||
d = Def(name, body)
|
inscribe(Def(name, body), dictionary)
|
||||||
dictionary[d.name] = d
|
|
||||||
return stack, expression, dictionary
|
return stack, expression, dictionary
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user