parser: Detect function declaration (#580)

This commit is contained in:
MS
2024-02-19 10:00:48 -05:00
committed by GitHub
parent 21f80c825a
commit ba8f2b1c0f
3 changed files with 24 additions and 0 deletions

View File

@@ -78,6 +78,11 @@ class ParserError(Enum):
# they annotate are different.
WRONG_STRING = 205
# ERROR: This lineref FUNCTION marker is next to a function declaration or
# forward reference. The correct place for the marker is where the function
# is implemented so we can match with the PDB.
NO_IMPLEMENTATION = 206
@dataclass
class ParserAlert:

View File

@@ -487,6 +487,9 @@ class DecompParser:
):
self._function_starts_here()
self._function_done()
elif self.function_sig.endswith(");"):
# Detect forward reference or declaration
self._syntax_error(ParserError.NO_IMPLEMENTATION)
else:
self.state = ReaderState.WANT_CURLY