Skip to content

Commit

Permalink
Merge branch 'main' into Eeems-patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems authored Aug 17, 2023
2 parents b97e6a7 + f344c5e commit c66ec37
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions toltec/bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,17 @@ def get_declarations(src: str) -> Tuple[Variables, Functions]:
if name not in default_variables:
variables[name] = value
else:
assert next_token == "("
assert lexer.get_token() == ")"
if next_token != "(":
raise ScriptError(
f"Unexpected token '{next_token}' on line {lexer.lineno}. Expecting '('."
)

_token = lexer.get_token()
if _token != ")":
raise ScriptError(
f"Unexpected token '{_token}' on line {lexer.lineno}. Expecting ')'."
)

start, end = _parse_func(lexer)
functions[token] = declarations[start:end].strip(" ")

Expand Down

0 comments on commit c66ec37

Please sign in to comment.