Skip to content

Commit

Permalink
+ ParsingException
Browse files Browse the repository at this point in the history
Signed-off-by: Ferit Yiğit BALABAN <fyb@fybx.dev>
  • Loading branch information
fybx committed Dec 16, 2023
1 parent 559bd0b commit 14a2851
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions crispy/parsing_exception.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# This file is part of the crispy-parser library.
# Copyright (C) 2023 Ferit Yiğit BALABAN
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
# USA.


class ParsingException(Exception):
def __init__(self, reason: str, expected: str, at_position: int, found: str):
super().__init__(reason)
self.expected = expected
self.at_position = at_position
self.found = found

0 comments on commit 14a2851

Please sign in to comment.