diff --git a/compiler/error/compiler.py b/compiler/error/compiler.py index 49f3359b..ac475da9 100644 --- a/compiler/error/compiler.py +++ b/compiler/error/compiler.py @@ -108,12 +108,12 @@ def start(): notice=notice, super_class=super_class, code=code, - name="\"{}\"".format(name), + docstring='"""{}"""'.format(name), sub_classes="".join([sub_class_template.format( sub_class=k[0], super_class=super_class, id="\"{}\"".format(k[1]), - message="\"{}\"".format(k[2]) + docstring='"""{}"""'.format(k[2]) ) for k in sub_classes]) ) diff --git a/compiler/error/template/class.txt b/compiler/error/template/class.txt index 0c729eb7..fd240f4b 100644 --- a/compiler/error/template/class.txt +++ b/compiler/error/template/class.txt @@ -4,8 +4,10 @@ from ..error import Error class {super_class}(Error): + {docstring} CODE = {code} - NAME = {name} + """:obj:`int`: Error Code""" + NAME = __doc__ {sub_classes} \ No newline at end of file diff --git a/compiler/error/template/sub_class.txt b/compiler/error/template/sub_class.txt index bc163407..a33503ec 100644 --- a/compiler/error/template/sub_class.txt +++ b/compiler/error/template/sub_class.txt @@ -1,5 +1,7 @@ class {sub_class}({super_class}): + {docstring} ID = {id} - MESSAGE = {message} + """:obj:`str`: Error ID""" + MESSAGE = __doc__