Documented the output_class macro

This commit is contained in:
Salvador E. Tropea 2020-06-26 12:02:18 -03:00
parent 5ce3da2bcc
commit 43b7e27a22
1 changed files with 7 additions and 0 deletions

View File

@ -59,6 +59,13 @@ def document(sentences, to_source, **kw):
def output_class(tree, **kw):
"""A decorator to wraps a class with:
from .out_base import BaseOutput
... Class definition
BaseOutput.register(CLASS_NAME_LOWER_STRING, CLASS_NAME)
Allowing to register the class as an output. """
if isinstance(tree, ClassDef):
# Create the register call
name = tree.name