Skip to content

Commit

Permalink
Merge pull request #44 from AutoResearch/42-fix-tests
Browse files Browse the repository at this point in the history
bug: fix arg parser
  • Loading branch information
younesStrittmatter authored Dec 1, 2024
2 parents e514e24 + f3b3d54 commit d4d7c37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sweetbean/util/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def _fct_args_to_js(args):
"""
res = "("
for arg in args:
for idx, arg in enumerate(args):
res += str(_var_to_js(arg))
if arg != args[-1]:
if idx != len(args) - 1:
res += ", "
res += ")"
return res
Expand All @@ -53,9 +53,9 @@ def _var_to_js(var):
# test if is sequence
if isinstance(var, (list, tuple, set)):
res = "["
for v in var:
for idx, v in enumerate(var):
res += str(_var_to_js(v))
if v != var[-1]:
if idx != len(var) - 1:
res += ","
return f"{res}]"
if isinstance(var, dict):
Expand Down

0 comments on commit d4d7c37

Please sign in to comment.