Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dissect/cstruct/cstruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from dissect.cstruct.exceptions import ResolveError
from dissect.cstruct.expression import Expression
from dissect.cstruct.parser import CStyleParser, TokenParser
from dissect.cstruct.parser import CStyleParser
from dissect.cstruct.types import (
LEB128,
Array,
Expand Down Expand Up @@ -264,9 +264,9 @@ def load(self, definition: str, deftype: int | None = None, **kwargs) -> cstruct
deftype = deftype or cstruct.DEF_CSTYLE

if deftype == cstruct.DEF_CSTYLE:
TokenParser(self, **kwargs).parse(definition)
elif deftype == cstruct.DEF_LEGACY:
CStyleParser(self, **kwargs).parse(definition)
else:
raise ValueError(f"Unknown definition type: {deftype}")

return self

Expand Down
8 changes: 4 additions & 4 deletions dissect/cstruct/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ class Error(Exception):
pass


class LexerError(Error):
pass


class ParserError(Error):
pass

Expand All @@ -20,7 +24,3 @@ class ArraySizeError(Error):

class ExpressionParserError(Error):
pass


class ExpressionTokenizerError(Error):
pass
Loading
Loading