Skip to content

Commit

Permalink
fix (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
odashi authored Nov 17, 2023
1 parent 4ebd535 commit d11334e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/latexify/codegen/expression_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def _generate_sum_prod(self, node: ast.Call) -> str | None:
Returns:
Generated LaTeX, or None if the node has unsupported syntax.
"""
if not isinstance(node.args[0], ast.GeneratorExp):
if not node.args or not isinstance(node.args[0], ast.GeneratorExp):
return None

name = ast_utils.extract_function_name_or_none(node)
Expand Down
2 changes: 2 additions & 0 deletions src/latexify/codegen/expression_codegen_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ def test_visit_call(code: str, latex: str) -> None:
@pytest.mark.parametrize(
"src_suffix,dest_suffix",
[
# No arguments
("()", r" \mathopen{}\left( \mathclose{}\right)"),
# No comprehension
("(x)", r" x"),
(
Expand Down

0 comments on commit d11334e

Please sign in to comment.