Skip to content

Commit d11334e

Browse files
authored
fix (#194)
1 parent 4ebd535 commit d11334e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/latexify/codegen/expression_codegen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _generate_sum_prod(self, node: ast.Call) -> str | None:
105105
Returns:
106106
Generated LaTeX, or None if the node has unsupported syntax.
107107
"""
108-
if not isinstance(node.args[0], ast.GeneratorExp):
108+
if not node.args or not isinstance(node.args[0], ast.GeneratorExp):
109109
return None
110110

111111
name = ast_utils.extract_function_name_or_none(node)

src/latexify/codegen/expression_codegen_test.py

+2
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ def test_visit_call(code: str, latex: str) -> None:
221221
@pytest.mark.parametrize(
222222
"src_suffix,dest_suffix",
223223
[
224+
# No arguments
225+
("()", r" \mathopen{}\left( \mathclose{}\right)"),
224226
# No comprehension
225227
("(x)", r" x"),
226228
(

0 commit comments

Comments
 (0)