🐐 INVOCA error message

This commit is contained in:
2026-04-22 14:09:01 +02:00
parent 5e2ebcdc9d
commit 461bfbbdc5
3 changed files with 11 additions and 1 deletions
+7 -1
View File
@@ -408,7 +408,13 @@ class Parser():
@self.pg.error
def error_handle(token):
raise SyntaxError(f"{token.name}, {token.value}, {token.source_pos}")
pos = token.source_pos
loc = f" at line {pos.lineno}, column {pos.colno}" if pos else ""
if token.name == "SYMBOL_LPARENS":
raise SyntaxError(
f"Unexpected '('{loc}. To call a function, use INVOCA: INVOCA func (args)"
)
raise SyntaxError(f"Unexpected token '{token.value}'{loc}")
parser = self.pg.build()
return parser.parse(tokens_input) # type: ignore