🌐 AI搜索 & 代理 主页
Skip to content

Commit 0bfab4a

Browse files
committed
Move call to create_diagram to __main__, so it does not get run when imported
1 parent d8ccaa5 commit 0bfab4a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

examples/tiny/tiny_parser.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,6 @@
258258
# Ignore comments globally (for full program parsing) and in interactive elements
259259
Program.ignore(comment)
260260

261-
# Optional: generate diagram
262-
Program.create_diagram(
263-
'tiny_parser_diagram.html',
264-
show_results_names=True,
265-
)
266-
267261

268262
def parse_tiny(text: str) -> pp.ParseResults:
269263
"""Parse a TINY source string and return structured ParseResults.
@@ -307,4 +301,11 @@ def _mini_tests() -> None:
307301

308302

309303
if __name__ == "__main__":
304+
305+
# Optional: generate diagram
306+
# Program.create_diagram(
307+
# 'tiny_parser_diagram.html',
308+
# show_results_names=True,
309+
# )
310+
310311
_mini_tests()

0 commit comments

Comments
 (0)