🐐 INVOCA error message
This commit is contained in:
+7
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user