From f0853a78a84205e7e3a6f0f3f5960750127044c6 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Wed, 27 Sep 2023 23:58:13 +0800 Subject: feat(exception): 增加语法错误基类 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/psi/exception.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/psi/exception.py b/src/psi/exception.py index 838d72b..a8b7201 100644 --- a/src/psi/exception.py +++ b/src/psi/exception.py @@ -22,3 +22,15 @@ class ValueError(PsiException): raise ValueError("Invalid value encountered in the Psi code.") ``` """ + +class GrammarError(PsiException): + """ + An exception class for grammar-related errors in Psi code. + + This class inherits from the `PsiException` class. + + Example: + ```python + raise GrammarError("Invalid grammar encountered in the Psi code.") + ``` + """ -- cgit v1.2.3-70-g09d2