| { | |
| "ast": { | |
| "items": [ | |
| { | |
| "use": { | |
| "tree": { | |
| "path": { | |
| "ident": "crate", | |
| "tree": { | |
| "path": { | |
| "ident": "extractor", | |
| "tree": { | |
| "group": [ | |
| { | |
| "path": { | |
| "ident": "model", | |
| "tree": { | |
| "path": { | |
| "ident": "extract", | |
| "tree": { | |
| "ident": "estimate_token_count" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "path": { | |
| "ident": "types", | |
| "tree": { | |
| "group": [ | |
| { | |
| "ident": "CodeSnippet" | |
| }, | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "use": { | |
| "tree": { | |
| "path": { | |
| "ident": "scraper", | |
| "tree": { | |
| "group": [ | |
| { | |
| "ident": "Html" | |
| }, | |
| { | |
| "ident": "Selector" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "use": { | |
| "tree": { | |
| "path": { | |
| "ident": "std", | |
| "tree": { | |
| "group": [ | |
| { | |
| "path": { | |
| "ident": "collections", | |
| "tree": { | |
| "path": { | |
| "ident": "hash_map", | |
| "tree": { | |
| "ident": "DefaultHasher" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "path": { | |
| "ident": "hash", | |
| "tree": { | |
| "group": [ | |
| { | |
| "ident": "Hash" | |
| }, | |
| { | |
| "ident": "Hasher" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "fn": { | |
| "attrs": [ | |
| { | |
| "meta": { | |
| "name_value": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "doc" | |
| } | |
| ] | |
| }, | |
| "value": { | |
| "lit": { | |
| "str": "\" Extract code snippets from HTML content containing markdown code blocks\"" | |
| } | |
| } | |
| } | |
| }, | |
| "style": "outer" | |
| } | |
| ], | |
| "ident": "extract_code_snippets_from_html", | |
| "inputs": [ | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "content" | |
| } | |
| }, | |
| "ty": { | |
| "reference": { | |
| "elem": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "str" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "output": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "CodeSnippet" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Vec" | |
| } | |
| ] | |
| } | |
| }, | |
| "stmts": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "call": { | |
| "args": [], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Vec" | |
| }, | |
| { | |
| "ident": "new" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "snippets", | |
| "mut": true | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Html" | |
| }, | |
| { | |
| "ident": "parse_fragment" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "document" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "unwrap", | |
| "receiver": { | |
| "call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"div[data-testid=\\'markdown-code-block\\']\"" | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Selector" | |
| }, | |
| { | |
| "ident": "parse" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "code_block_selector" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "for_loop": { | |
| "body": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "unwrap", | |
| "receiver": { | |
| "call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"div > div > span\"" | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Selector" | |
| }, | |
| { | |
| "ident": "parse" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "lang_selector" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "closure": { | |
| "body": { | |
| "method_call": { | |
| "args": [], | |
| "method": "to_string", | |
| "receiver": { | |
| "lit": { | |
| "str": "\"text\"" | |
| } | |
| } | |
| } | |
| }, | |
| "inputs": [], | |
| "output": null | |
| } | |
| } | |
| ], | |
| "method": "unwrap_or_else", | |
| "receiver": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "closure": { | |
| "body": { | |
| "method_call": { | |
| "args": [], | |
| "method": "to_string", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "trim", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "inner_html", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "span" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "inputs": [ | |
| { | |
| "ident": { | |
| "ident": "span" | |
| } | |
| } | |
| ], | |
| "output": null | |
| } | |
| } | |
| ], | |
| "method": "map", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "next", | |
| "receiver": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "reference": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "lang_selector" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "method": "select", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "code_block" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "language" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "unwrap", | |
| "receiver": { | |
| "call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"pre > code\"" | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Selector" | |
| }, | |
| { | |
| "ident": "parse" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "code_selector" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "let": { | |
| "expr": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "reference": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "code_selector" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "method": "select", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "code_block" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "codec" | |
| } | |
| } | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"\"" | |
| } | |
| } | |
| ], | |
| "method": "join", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "collect", | |
| "receiver": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "closure": { | |
| "body": { | |
| "method_call": { | |
| "args": [], | |
| "method": "text", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "element" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "inputs": [ | |
| { | |
| "ident": { | |
| "ident": "element" | |
| } | |
| } | |
| ], | |
| "output": null | |
| } | |
| } | |
| ], | |
| "method": "flat_map", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "codec" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "turbofish": { | |
| "args": [ | |
| { | |
| "type": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": "_" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Vec" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "colon2_token": true | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "code_content" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "unary": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "is_empty", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "trim", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "code_content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "op": "!" | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "count", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "lines", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "code_content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "line_count" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "binary": { | |
| "left": { | |
| "binary": { | |
| "left": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "block_index" | |
| } | |
| ] | |
| } | |
| }, | |
| "op": "*", | |
| "right": { | |
| "lit": { | |
| "int": "100" | |
| } | |
| } | |
| } | |
| }, | |
| "op": "+", | |
| "right": { | |
| "lit": { | |
| "int": "1" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "line_start" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "binary": { | |
| "left": { | |
| "binary": { | |
| "left": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "line_start" | |
| } | |
| ] | |
| } | |
| }, | |
| "op": "+", | |
| "right": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "line_count" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "op": "-", | |
| "right": { | |
| "lit": { | |
| "int": "1" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "line_end" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "language" | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "code_content" | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "line_start" | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "line_end" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "create_code_snippet" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "snippet" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "method": "push", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippets" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ], | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "enumerate", | |
| "receiver": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "reference": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "code_block_selector" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "method": "select", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "document" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "tuple": { | |
| "elems": [ | |
| { | |
| "ident": { | |
| "ident": "block_index" | |
| } | |
| }, | |
| { | |
| "ident": { | |
| "ident": "code_block" | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| false | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippets" | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ], | |
| "vis": "pub" | |
| } | |
| }, | |
| { | |
| "fn": { | |
| "attrs": [ | |
| { | |
| "meta": { | |
| "name_value": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "doc" | |
| } | |
| ] | |
| }, | |
| "value": { | |
| "lit": { | |
| "str": "\" Create a complete CodeSnippet with all fields populated (reusing your existing function)\"" | |
| } | |
| } | |
| } | |
| }, | |
| "style": "outer" | |
| } | |
| ], | |
| "ident": "create_code_snippet", | |
| "inputs": [ | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "language" | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "String" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "content" | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "String" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "line_start" | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "usize" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "line_end" | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "usize" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "output": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "CodeSnippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "stmts": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "reference": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "generate_content_hash" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "content_hash" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "reference": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "estimate_token_count" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "token_count" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "count", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "lines", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "line_count" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "count", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "chars", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "char_count" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "call": { | |
| "args": [], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "create_default_test_result" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "test_result" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "language" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "language" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "content" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "line_start" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "line_start" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "line_end" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "line_end" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content_hash" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "content_hash" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "token_count" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "token_count" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "line_count" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "line_count" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "char_count" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "char_count" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "test_result" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "test_result" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "CodeSnippet" | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "fn": { | |
| "attrs": [ | |
| { | |
| "meta": { | |
| "name_value": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "doc" | |
| } | |
| ] | |
| }, | |
| "value": { | |
| "lit": { | |
| "str": "\" Generate a simple hash for content deduplication (reusing your existing function)\"" | |
| } | |
| } | |
| } | |
| }, | |
| "style": "outer" | |
| } | |
| ], | |
| "ident": "generate_content_hash", | |
| "inputs": [ | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "content" | |
| } | |
| }, | |
| "ty": { | |
| "reference": { | |
| "elem": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "str" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "output": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "String" | |
| } | |
| ] | |
| } | |
| }, | |
| "stmts": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "call": { | |
| "args": [], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "DefaultHasher" | |
| }, | |
| { | |
| "ident": "new" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "hasher", | |
| "mut": true | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "reference": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "hasher" | |
| } | |
| ] | |
| } | |
| }, | |
| "mut": true | |
| } | |
| } | |
| ], | |
| "method": "hash", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "macro": { | |
| "delimiter": "paren", | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "format" | |
| } | |
| ] | |
| }, | |
| "tokens": [ | |
| { | |
| "lit": "\"{:x}\"" | |
| }, | |
| { | |
| "punct": { | |
| "op": ",", | |
| "spacing": "alone" | |
| } | |
| }, | |
| { | |
| "ident": "hasher" | |
| }, | |
| { | |
| "punct": { | |
| "op": ".", | |
| "spacing": "alone" | |
| } | |
| }, | |
| { | |
| "ident": "finish" | |
| }, | |
| { | |
| "group": { | |
| "delimiter": "parenthesis", | |
| "stream": [] | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "fn": { | |
| "attrs": [ | |
| { | |
| "meta": { | |
| "name_value": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "doc" | |
| } | |
| ] | |
| }, | |
| "value": { | |
| "lit": { | |
| "str": "\" Create a default test result (reusing your existing function)\"" | |
| } | |
| } | |
| } | |
| }, | |
| "style": "outer" | |
| } | |
| ], | |
| "ident": "create_default_test_result", | |
| "inputs": [], | |
| "output": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| }, | |
| "stmts": [ | |
| { | |
| "expr": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "lit": { | |
| "bool": false | |
| } | |
| }, | |
| "ident": "passed" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "None" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "error_message" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "None" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "execution_time" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "None" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "output" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ] | |
| } | |
| } | |
| ] | |
| }, | |
| "file_path": "src\\extractor\\model\\extract_html.rs", | |
| "summary": { | |
| "emoji_counts_in_strings": {}, | |
| "string_literals": [ | |
| "\" Extract code snippets from HTML content containing markdown code blocks\"", | |
| "\"div[data-testid=\\'markdown-code-block\\']\"", | |
| "\"div > div > span\"", | |
| "\"text\"", | |
| "\"pre > code\"", | |
| "\"\"", | |
| "\" Create a complete CodeSnippet with all fields populated (reusing your existing function)\"", | |
| "\" Generate a simple hash for content deduplication (reusing your existing function)\"", | |
| "\"{:x}\"", | |
| "\" Create a default test result (reusing your existing function)\"" | |
| ], | |
| "top_level_nodes": 1, | |
| "total_nodes": 579, | |
| "type_counts": { | |
| "angle_bracketed": 2, | |
| "args": 42, | |
| "arguments": 2, | |
| "attrs": 4, | |
| "binary": 4, | |
| "body": 4, | |
| "bool": 1, | |
| "call": 11, | |
| "closure": 3, | |
| "colon2_token": 1, | |
| "colon_token": 4, | |
| "cond": 2, | |
| "delimiter": 2, | |
| "elem": 2, | |
| "elems": 1, | |
| "expr": 48, | |
| "fields": 2, | |
| "fn": 4, | |
| "for_loop": 1, | |
| "func": 11, | |
| "group": 6, | |
| "ident": 169, | |
| "if": 2, | |
| "init": 17, | |
| "inputs": 7, | |
| "int": 3, | |
| "items": 1, | |
| "left": 4, | |
| "let": 18, | |
| "lit": 14, | |
| "macro": 1, | |
| "meta": 4, | |
| "method": 28, | |
| "method_call": 28, | |
| "mut": 3, | |
| "name_value": 4, | |
| "op": 7, | |
| "output": 7, | |
| "pat": 25, | |
| "path": 80, | |
| "punct": 2, | |
| "receiver": 28, | |
| "reference": 8, | |
| "right": 4, | |
| "segments": 70, | |
| "spacing": 2, | |
| "stmts": 4, | |
| "str": 9, | |
| "stream": 1, | |
| "struct": 2, | |
| "style": 4, | |
| "then_branch": 2, | |
| "tokens": 1, | |
| "tree": 13, | |
| "tuple": 1, | |
| "turbofish": 1, | |
| "ty": 6, | |
| "type": 3, | |
| "typed": 6, | |
| "unary": 1, | |
| "use": 3, | |
| "value": 4, | |
| "vis": 1 | |
| }, | |
| "word_counts": { | |
| "a": 3, | |
| "all": 1, | |
| "block": 1, | |
| "blocks": 1, | |
| "code": 5, | |
| "complete": 1, | |
| "containing": 1, | |
| "content": 2, | |
| "create": 2, | |
| "data": 1, | |
| "deduplication": 1, | |
| "default": 1, | |
| "div": 3, | |
| "existing": 3, | |
| "extract": 1, | |
| "fields": 1, | |
| "for": 1, | |
| "from": 1, | |
| "function": 3, | |
| "generate": 1, | |
| "hash": 1, | |
| "html": 1, | |
| "markdown": 2, | |
| "populated": 1, | |
| "pre": 1, | |
| "result": 1, | |
| "reusing": 3, | |
| "simple": 1, | |
| "snippet": 1, | |
| "snippets": 1, | |
| "span": 1, | |
| "test": 1, | |
| "testid": 1, | |
| "text": 1, | |
| "with": 1, | |
| "x": 1, | |
| "your": 3 | |
| }, | |
| "word_emoji_counts": { | |
| "🌱": 1, | |
| "📦": 2, | |
| "🧱": 1 | |
| } | |
| }, | |
| "timestamp": 1751588218 | |
| } |