Skip to content

Commit

Permalink
Align ParseExceptionResult with Java definition
Browse files Browse the repository at this point in the history
The field names of LST and marker types need to be the same in both Java and Python.
  • Loading branch information
knutwannheden committed Sep 4, 2024
1 parent 40b1e17 commit f221ce1
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions rewrite/rewrite/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ParseExceptionResult(Marker):
@classmethod
def build(cls, parser: 'Parser', exception: Exception) -> ParseExceptionResult:
return cls(random_id(), type(parser).__name__, type(exception).__name__,
''.join(traceback.format_exception(exception)), None)
''.join(traceback.format_exception(exception)))

_id: UUID

Expand Down Expand Up @@ -102,15 +102,6 @@ def exception_type(self) -> str:
def with_exception_type(self, exception_type: str) -> ParseExceptionResult:
return self if exception_type is self._exception_type else replace(self, _exception_type=exception_type)

_exception_message: str

@property
def exception_message(self) -> str:
return self._exception_message

def with_exception_message(self, exception_message: str) -> ParseExceptionResult:
return self if exception_message is self._exception_message else replace(self, _exception_message=exception_message)

_message: str

@property
Expand Down

0 comments on commit f221ce1

Please sign in to comment.