| { | |
| "ast": { | |
| "items": [ | |
| { | |
| "use": { | |
| "tree": { | |
| "path": { | |
| "ident": "crate", | |
| "tree": { | |
| "path": { | |
| "ident": "extractor", | |
| "tree": { | |
| "group": [ | |
| { | |
| "path": { | |
| "ident": "model", | |
| "tree": { | |
| "group": [ | |
| { | |
| "path": { | |
| "ident": "extract", | |
| "tree": { | |
| "ident": "extract_code_snippets" | |
| } | |
| } | |
| }, | |
| { | |
| "path": { | |
| "ident": "extract_html", | |
| "tree": { | |
| "ident": "extract_code_snippets_from_html" | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "path": { | |
| "ident": "types", | |
| "tree": { | |
| "group": [ | |
| { | |
| "ident": "ExtractedFile" | |
| }, | |
| { | |
| "ident": "ProcessingFile" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "use": { | |
| "tree": { | |
| "path": { | |
| "ident": "dioxus", | |
| "tree": { | |
| "group": [ | |
| { | |
| "path": { | |
| "ident": "html", | |
| "tree": { | |
| "ident": "FileEngine" | |
| } | |
| } | |
| }, | |
| { | |
| "path": { | |
| "ident": "prelude", | |
| "tree": "*" | |
| } | |
| }, | |
| { | |
| "path": { | |
| "ident": "signals", | |
| "tree": { | |
| "group": [ | |
| { | |
| "ident": "Signal" | |
| }, | |
| { | |
| "ident": "Writable" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "use": { | |
| "tree": { | |
| "path": { | |
| "ident": "gloo_timers", | |
| "tree": { | |
| "path": { | |
| "ident": "future", | |
| "tree": { | |
| "ident": "TimeoutFuture" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "use": { | |
| "tree": { | |
| "path": { | |
| "ident": "std", | |
| "tree": { | |
| "group": [ | |
| { | |
| "path": { | |
| "ident": "pin", | |
| "tree": { | |
| "ident": "Pin" | |
| } | |
| } | |
| }, | |
| { | |
| "path": { | |
| "ident": "sync", | |
| "tree": { | |
| "ident": "Arc" | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "fn": { | |
| "async": true, | |
| "generics": { | |
| "params": [ | |
| { | |
| "type": { | |
| "ident": "F" | |
| } | |
| }, | |
| { | |
| "type": { | |
| "ident": "P" | |
| } | |
| } | |
| ], | |
| "where_clause": [ | |
| { | |
| "type": { | |
| "bounded_ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "F" | |
| } | |
| ] | |
| } | |
| }, | |
| "bounds": [ | |
| { | |
| "trait": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "parenthesized": { | |
| "inputs": [ | |
| { | |
| "reference": { | |
| "elem": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "str" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "usize" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "output": null | |
| } | |
| }, | |
| "ident": "FnMut" | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "trait": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Send" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "type": { | |
| "bounded_ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "P" | |
| } | |
| ] | |
| } | |
| }, | |
| "bounds": [ | |
| { | |
| "trait": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "parenthesized": { | |
| "inputs": [ | |
| { | |
| "reference": { | |
| "elem": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "str" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "usize" | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "usize" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "output": null | |
| } | |
| }, | |
| "ident": "FnMut" | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "trait": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Send" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| ] | |
| }, | |
| "ident": "process_file_engine_with_callbacks", | |
| "inputs": [ | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "file_engine" | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "trait_object": { | |
| "bounds": [ | |
| { | |
| "trait": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "FileEngine" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "dyn": true | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Arc" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "on_file_start", | |
| "mut": true | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "F" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "on_progress", | |
| "mut": true | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "P" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "output": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "ExtractedFile" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Vec" | |
| } | |
| ] | |
| } | |
| }, | |
| "stmts": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "call": { | |
| "args": [], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Vec" | |
| }, | |
| { | |
| "ident": "new" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "extracted_files", | |
| "mut": true | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "files", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_engine" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "file_names" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "for_loop": { | |
| "body": [ | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "let": { | |
| "expr": { | |
| "await": { | |
| "base": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_name" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "method": "read_file_to_string", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_engine" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "tuple_struct": { | |
| "elems": [ | |
| { | |
| "ident": { | |
| "ident": "content" | |
| } | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "collect", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "lines", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "type": { | |
| "pat": { | |
| "ident": { | |
| "ident": "lines" | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "reference": { | |
| "elem": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "str" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Vec" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "len", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "lines" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "total_lines" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "call": { | |
| "args": [ | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_name" | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "total_lines" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "on_file_start" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "for_loop": { | |
| "body": [ | |
| { | |
| "expr": [ | |
| { | |
| "call": { | |
| "args": [ | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_name" | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "i" | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "total_lines" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "on_progress" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "binary": { | |
| "left": { | |
| "binary": { | |
| "left": { | |
| "binary": { | |
| "left": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "i" | |
| } | |
| ] | |
| } | |
| }, | |
| "op": "%", | |
| "right": { | |
| "lit": { | |
| "int": "100" | |
| } | |
| } | |
| } | |
| }, | |
| "op": "==", | |
| "right": { | |
| "lit": { | |
| "int": "0" | |
| } | |
| } | |
| } | |
| }, | |
| "op": "||", | |
| "right": { | |
| "binary": { | |
| "left": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "i" | |
| } | |
| ] | |
| } | |
| }, | |
| "op": "==", | |
| "right": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "total_lines" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "expr": [ | |
| { | |
| "await": { | |
| "base": { | |
| "call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "int": "10" | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TimeoutFuture" | |
| }, | |
| { | |
| "ident": "new" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ], | |
| "expr": { | |
| "range": { | |
| "end": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "total_lines" | |
| } | |
| ] | |
| } | |
| }, | |
| "limits": "..=", | |
| "start": { | |
| "lit": { | |
| "int": "0" | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "i" | |
| } | |
| } | |
| } | |
| }, | |
| false | |
| ] | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "reference": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "extract_code_snippets" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "snippets" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippets" | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "all_snippets", | |
| "mut": true | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "call": { | |
| "args": [ | |
| { | |
| "reference": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "extract_code_snippets_from_html" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "method": "extend", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "all_snippets" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "clone", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_name" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "name" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "all_snippets" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "snippets" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "total_lines" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "total_lines" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "ExtractedFile" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "method": "push", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "extracted_files" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ], | |
| "expr": { | |
| "reference": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_names" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "file_name" | |
| } | |
| } | |
| } | |
| }, | |
| false | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "extracted_files" | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "fn": { | |
| "async": true, | |
| "ident": "process_files", | |
| "inputs": [ | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "file_engine" | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "trait_object": { | |
| "bounds": [ | |
| { | |
| "trait": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "FileEngine" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "dyn": true | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Arc" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "files", | |
| "mut": true | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "ExtractedFile" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Vec" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Signal" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "processing_file", | |
| "mut": true | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "ProcessingFile" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Option" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Signal" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "output": null, | |
| "stmts": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "files", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_engine" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "file_names" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "for_loop": { | |
| "body": [ | |
| { | |
| "expr": [ | |
| { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "dot2_token": true, | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "clone", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_name" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "name" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "ProcessingFile" | |
| } | |
| ] | |
| }, | |
| "rest": { | |
| "call": { | |
| "args": [], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Default" | |
| }, | |
| { | |
| "ident": "default" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "method": "set", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "processing_file" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "await": { | |
| "base": { | |
| "call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "int": "50" | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TimeoutFuture" | |
| }, | |
| { | |
| "ident": "new" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "let": { | |
| "expr": { | |
| "await": { | |
| "base": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_name" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "method": "read_file_to_string", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_engine" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "tuple_struct": { | |
| "elems": [ | |
| { | |
| "ident": { | |
| "ident": "content" | |
| } | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "collect", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "lines", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "type": { | |
| "pat": { | |
| "ident": { | |
| "ident": "lines" | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "reference": { | |
| "elem": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "str" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Vec" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "len", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "lines" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "total_lines" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "let": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "as_mut", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "write", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "processing_file" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "tuple_struct": { | |
| "elems": [ | |
| { | |
| "ident": { | |
| "ident": "pf" | |
| } | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "pf" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "total_lines" | |
| } | |
| }, | |
| "right": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "total_lines" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "pf" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "current_content" | |
| } | |
| }, | |
| "right": { | |
| "method_call": { | |
| "args": [], | |
| "method": "clone", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "for_loop": { | |
| "body": [ | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "let": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "as_mut", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "write", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "processing_file" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "tuple_struct": { | |
| "elems": [ | |
| { | |
| "ident": { | |
| "ident": "pf" | |
| } | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "pf" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "progress" | |
| } | |
| }, | |
| "right": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "i" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "binary": { | |
| "left": { | |
| "binary": { | |
| "left": { | |
| "binary": { | |
| "left": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "i" | |
| } | |
| ] | |
| } | |
| }, | |
| "op": "%", | |
| "right": { | |
| "lit": { | |
| "int": "100" | |
| } | |
| } | |
| } | |
| }, | |
| "op": "==", | |
| "right": { | |
| "lit": { | |
| "int": "0" | |
| } | |
| } | |
| } | |
| }, | |
| "op": "||", | |
| "right": { | |
| "binary": { | |
| "left": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "i" | |
| } | |
| ] | |
| } | |
| }, | |
| "op": "==", | |
| "right": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "total_lines" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "expr": [ | |
| { | |
| "await": { | |
| "base": { | |
| "call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "int": "10" | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TimeoutFuture" | |
| }, | |
| { | |
| "ident": "new" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ], | |
| "expr": { | |
| "range": { | |
| "end": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "total_lines" | |
| } | |
| ] | |
| } | |
| }, | |
| "limits": "..=", | |
| "start": { | |
| "lit": { | |
| "int": "0" | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "i" | |
| } | |
| } | |
| } | |
| }, | |
| false | |
| ] | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "reference": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "extract_code_snippets" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "snippets" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "clone", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_name" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "name" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippets" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "snippets" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "total_lines" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "total_lines" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "ExtractedFile" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "method": "push", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "write", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "files" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ], | |
| "expr": { | |
| "reference": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_names" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "file_name" | |
| } | |
| } | |
| } | |
| }, | |
| false | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "None" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "method": "set", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "processing_file" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ], | |
| "vis": "pub" | |
| } | |
| }, | |
| { | |
| "fn": { | |
| "ident": "create_file_reader", | |
| "inputs": [ | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "processing_file", | |
| "mut": true | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "ProcessingFile" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Option" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Signal" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "files", | |
| "mut": true | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "ExtractedFile" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Vec" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Signal" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "output": { | |
| "impl_trait": { | |
| "bounds": [ | |
| { | |
| "trait": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "parenthesized": { | |
| "inputs": [ | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "trait_object": { | |
| "bounds": [ | |
| { | |
| "trait": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "FileEngine" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "dyn": true | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Arc" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "output": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "trait_object": { | |
| "bounds": [ | |
| { | |
| "trait": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "std" | |
| }, | |
| { | |
| "ident": "future" | |
| }, | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "assoc_type": { | |
| "ident": "Output", | |
| "ty": { | |
| "tuple": { | |
| "elems": [] | |
| } | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Future" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "dyn": true | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Box" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Pin" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "Fn" | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "trait": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Clone" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "stmts": [ | |
| { | |
| "expr": [ | |
| { | |
| "closure": { | |
| "body": { | |
| "block": { | |
| "stmts": [ | |
| { | |
| "expr": [ | |
| { | |
| "call": { | |
| "args": [ | |
| { | |
| "async": { | |
| "move": true, | |
| "stmts": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "files", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_engine" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "file_names" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "for_loop": { | |
| "body": [ | |
| { | |
| "expr": [ | |
| { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "dot2_token": true, | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "clone", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_name" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "name" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "ProcessingFile" | |
| } | |
| ] | |
| }, | |
| "rest": { | |
| "call": { | |
| "args": [], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Default" | |
| }, | |
| { | |
| "ident": "default" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "method": "set", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "processing_file" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "await": { | |
| "base": { | |
| "call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "int": "50" | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TimeoutFuture" | |
| }, | |
| { | |
| "ident": "new" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "let": { | |
| "expr": { | |
| "await": { | |
| "base": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_name" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "method": "read_file_to_string", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_engine" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "tuple_struct": { | |
| "elems": [ | |
| { | |
| "ident": { | |
| "ident": "content" | |
| } | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "collect", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "lines", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "type": { | |
| "pat": { | |
| "ident": { | |
| "ident": "lines" | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "reference": { | |
| "elem": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "str" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Vec" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "len", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "lines" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "total_lines" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "let": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "as_mut", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "write", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "processing_file" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "tuple_struct": { | |
| "elems": [ | |
| { | |
| "ident": { | |
| "ident": "pf" | |
| } | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "pf" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "total_lines" | |
| } | |
| }, | |
| "right": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "total_lines" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "pf" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "current_content" | |
| } | |
| }, | |
| "right": { | |
| "method_call": { | |
| "args": [], | |
| "method": "clone", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "for_loop": { | |
| "body": [ | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "let": { | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "as_mut", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "write", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "processing_file" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "tuple_struct": { | |
| "elems": [ | |
| { | |
| "ident": { | |
| "ident": "pf" | |
| } | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "pf" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "progress" | |
| } | |
| }, | |
| "right": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "i" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "binary": { | |
| "left": { | |
| "binary": { | |
| "left": { | |
| "binary": { | |
| "left": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "i" | |
| } | |
| ] | |
| } | |
| }, | |
| "op": "%", | |
| "right": { | |
| "lit": { | |
| "int": "100" | |
| } | |
| } | |
| } | |
| }, | |
| "op": "==", | |
| "right": { | |
| "lit": { | |
| "int": "0" | |
| } | |
| } | |
| } | |
| }, | |
| "op": "||", | |
| "right": { | |
| "binary": { | |
| "left": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "i" | |
| } | |
| ] | |
| } | |
| }, | |
| "op": "==", | |
| "right": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "total_lines" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "expr": [ | |
| { | |
| "await": { | |
| "base": { | |
| "call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "int": "10" | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TimeoutFuture" | |
| }, | |
| { | |
| "ident": "new" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ], | |
| "expr": { | |
| "range": { | |
| "end": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "total_lines" | |
| } | |
| ] | |
| } | |
| }, | |
| "limits": "..=", | |
| "start": { | |
| "lit": { | |
| "int": "0" | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "i" | |
| } | |
| } | |
| } | |
| }, | |
| false | |
| ] | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "reference": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "content" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "extract_code_snippets" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "snippets" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "clone", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_name" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "name" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippets" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "snippets" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "total_lines" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "total_lines" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "ExtractedFile" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "method": "push", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "write", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "files" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ], | |
| "expr": { | |
| "reference": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "file_names" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "file_name" | |
| } | |
| } | |
| } | |
| }, | |
| false | |
| ] | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "None" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "method": "set", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "processing_file" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Box" | |
| }, | |
| { | |
| "ident": "pin" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| "inputs": [ | |
| { | |
| "type": { | |
| "pat": { | |
| "ident": { | |
| "ident": "file_engine" | |
| } | |
| }, | |
| "ty": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "arguments": { | |
| "angle_bracketed": { | |
| "args": [ | |
| { | |
| "type": { | |
| "trait_object": { | |
| "bounds": [ | |
| { | |
| "trait": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "FileEngine" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "dyn": true | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "Arc" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "move": true, | |
| "output": null | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ], | |
| "vis": "pub" | |
| } | |
| }, | |
| { | |
| "fn": { | |
| "ident": "create_download_filename", | |
| "inputs": [ | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "language" | |
| } | |
| }, | |
| "ty": { | |
| "reference": { | |
| "elem": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "str" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "output": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "String" | |
| } | |
| ] | |
| } | |
| }, | |
| "stmts": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "match": { | |
| "arms": [ | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"rs\"" | |
| } | |
| }, | |
| "pat": { | |
| "or": { | |
| "cases": [ | |
| { | |
| "lit": { | |
| "str": "\"rust\"" | |
| } | |
| }, | |
| { | |
| "lit": { | |
| "str": "\"rs\"" | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"js\"" | |
| } | |
| }, | |
| "pat": { | |
| "or": { | |
| "cases": [ | |
| { | |
| "lit": { | |
| "str": "\"javascript\"" | |
| } | |
| }, | |
| { | |
| "lit": { | |
| "str": "\"js\"" | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"ts\"" | |
| } | |
| }, | |
| "pat": { | |
| "or": { | |
| "cases": [ | |
| { | |
| "lit": { | |
| "str": "\"typescript\"" | |
| } | |
| }, | |
| { | |
| "lit": { | |
| "str": "\"ts\"" | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"py\"" | |
| } | |
| }, | |
| "pat": { | |
| "or": { | |
| "cases": [ | |
| { | |
| "lit": { | |
| "str": "\"python\"" | |
| } | |
| }, | |
| { | |
| "lit": { | |
| "str": "\"py\"" | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"java\"" | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"java\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"cpp\"" | |
| } | |
| }, | |
| "pat": { | |
| "or": { | |
| "cases": [ | |
| { | |
| "lit": { | |
| "str": "\"cpp\"" | |
| } | |
| }, | |
| { | |
| "lit": { | |
| "str": "\"c++\"" | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"c\"" | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"c\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"html\"" | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"html\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"css\"" | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"css\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"json\"" | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"json\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"xml\"" | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"xml\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"yml\"" | |
| } | |
| }, | |
| "pat": { | |
| "or": { | |
| "cases": [ | |
| { | |
| "lit": { | |
| "str": "\"yaml\"" | |
| } | |
| }, | |
| { | |
| "lit": { | |
| "str": "\"yml\"" | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"toml\"" | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"toml\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"go\"" | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"go\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"php\"" | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"php\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"rb\"" | |
| } | |
| }, | |
| "pat": { | |
| "or": { | |
| "cases": [ | |
| { | |
| "lit": { | |
| "str": "\"ruby\"" | |
| } | |
| }, | |
| { | |
| "lit": { | |
| "str": "\"rb\"" | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"swift\"" | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"swift\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"kt\"" | |
| } | |
| }, | |
| "pat": { | |
| "or": { | |
| "cases": [ | |
| { | |
| "lit": { | |
| "str": "\"kotlin\"" | |
| } | |
| }, | |
| { | |
| "lit": { | |
| "str": "\"kt\"" | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"scala\"" | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"scala\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"sh\"" | |
| } | |
| }, | |
| "pat": { | |
| "or": { | |
| "cases": [ | |
| { | |
| "lit": { | |
| "str": "\"bash\"" | |
| } | |
| }, | |
| { | |
| "lit": { | |
| "str": "\"sh\"" | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"sql\"" | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"sql\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "lit": { | |
| "str": "\"txt\"" | |
| } | |
| }, | |
| "pat": { | |
| "_": {} | |
| } | |
| } | |
| ], | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "as_str", | |
| "receiver": { | |
| "method_call": { | |
| "args": [], | |
| "method": "to_lowercase", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "language" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "extension" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "macro": { | |
| "delimiter": "paren", | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "format" | |
| } | |
| ] | |
| }, | |
| "tokens": [ | |
| { | |
| "lit": "\"{}_snippets.{}\"" | |
| }, | |
| { | |
| "punct": { | |
| "op": ",", | |
| "spacing": "alone" | |
| } | |
| }, | |
| { | |
| "ident": "language" | |
| }, | |
| { | |
| "punct": { | |
| "op": ".", | |
| "spacing": "alone" | |
| } | |
| }, | |
| { | |
| "ident": "to_lowercase" | |
| }, | |
| { | |
| "group": { | |
| "delimiter": "parenthesis", | |
| "stream": [] | |
| } | |
| }, | |
| { | |
| "punct": { | |
| "op": ",", | |
| "spacing": "alone" | |
| } | |
| }, | |
| { | |
| "ident": "extension" | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ], | |
| "vis": "pub" | |
| } | |
| } | |
| ] | |
| }, | |
| "file_path": "src\\extractor\\model\\files.rs", | |
| "summary": { | |
| "emoji_counts_in_strings": {}, | |
| "string_literals": [ | |
| "\"rs\"", | |
| "\"rust\"", | |
| "\"rs\"", | |
| "\"js\"", | |
| "\"javascript\"", | |
| "\"js\"", | |
| "\"ts\"", | |
| "\"typescript\"", | |
| "\"ts\"", | |
| "\"py\"", | |
| "\"python\"", | |
| "\"py\"", | |
| "\"java\"", | |
| "\"java\"", | |
| "\"cpp\"", | |
| "\"cpp\"", | |
| "\"c++\"", | |
| "\"c\"", | |
| "\"c\"", | |
| "\"html\"", | |
| "\"html\"", | |
| "\"css\"", | |
| "\"css\"", | |
| "\"json\"", | |
| "\"json\"", | |
| "\"xml\"", | |
| "\"xml\"", | |
| "\"yml\"", | |
| "\"yaml\"", | |
| "\"yml\"", | |
| "\"toml\"", | |
| "\"toml\"", | |
| "\"go\"", | |
| "\"go\"", | |
| "\"php\"", | |
| "\"php\"", | |
| "\"rb\"", | |
| "\"ruby\"", | |
| "\"rb\"", | |
| "\"swift\"", | |
| "\"swift\"", | |
| "\"kt\"", | |
| "\"kotlin\"", | |
| "\"kt\"", | |
| "\"scala\"", | |
| "\"scala\"", | |
| "\"sh\"", | |
| "\"bash\"", | |
| "\"sh\"", | |
| "\"sql\"", | |
| "\"sql\"", | |
| "\"txt\"", | |
| "\"{}_snippets.{}\"" | |
| ], | |
| "top_level_nodes": 1, | |
| "total_nodes": 1309, | |
| "type_counts": { | |
| "_": 1, | |
| "angle_bracketed": 19, | |
| "args": 78, | |
| "arguments": 22, | |
| "arms": 1, | |
| "assign": 6, | |
| "assoc_type": 1, | |
| "async": 3, | |
| "await": 8, | |
| "base": 14, | |
| "binary": 12, | |
| "block": 1, | |
| "body": 29, | |
| "bounded_ty": 2, | |
| "bounds": 8, | |
| "call": 17, | |
| "cases": 9, | |
| "closure": 1, | |
| "colon_token": 6, | |
| "cond": 10, | |
| "delimiter": 2, | |
| "dot2_token": 2, | |
| "dyn": 5, | |
| "elem": 6, | |
| "elems": 8, | |
| "end": 3, | |
| "expr": 88, | |
| "field": 6, | |
| "fields": 5, | |
| "fn": 4, | |
| "for_loop": 6, | |
| "func": 17, | |
| "generics": 1, | |
| "group": 7, | |
| "ident": 296, | |
| "if": 10, | |
| "impl_trait": 1, | |
| "init": 15, | |
| "inputs": 8, | |
| "int": 14, | |
| "items": 1, | |
| "left": 18, | |
| "let": 22, | |
| "limits": 3, | |
| "lit": 67, | |
| "macro": 1, | |
| "match": 1, | |
| "method": 42, | |
| "method_call": 42, | |
| "move": 2, | |
| "mut": 8, | |
| "op": 15, | |
| "or": 9, | |
| "output": 8, | |
| "params": 1, | |
| "parenthesized": 3, | |
| "pat": 63, | |
| "path": 172, | |
| "punct": 3, | |
| "range": 3, | |
| "receiver": 42, | |
| "reference": 13, | |
| "rest": 2, | |
| "right": 18, | |
| "segments": 157, | |
| "spacing": 3, | |
| "start": 3, | |
| "stmts": 6, | |
| "str": 52, | |
| "stream": 1, | |
| "struct": 5, | |
| "then_branch": 10, | |
| "tokens": 1, | |
| "trait": 11, | |
| "trait_object": 5, | |
| "tree": 19, | |
| "tuple": 1, | |
| "tuple_struct": 7, | |
| "ty": 14, | |
| "type": 26, | |
| "typed": 9, | |
| "use": 4, | |
| "vis": 3, | |
| "where_clause": 1 | |
| }, | |
| "word_counts": { | |
| "_snippets": 1, | |
| "bash": 1, | |
| "c": 3, | |
| "cpp": 2, | |
| "css": 2, | |
| "go": 2, | |
| "html": 2, | |
| "java": 2, | |
| "javascript": 1, | |
| "js": 2, | |
| "json": 2, | |
| "kotlin": 1, | |
| "kt": 2, | |
| "php": 2, | |
| "py": 2, | |
| "python": 1, | |
| "rb": 2, | |
| "rs": 2, | |
| "ruby": 1, | |
| "rust": 1, | |
| "scala": 2, | |
| "sh": 2, | |
| "sql": 2, | |
| "swift": 2, | |
| "toml": 2, | |
| "ts": 2, | |
| "txt": 1, | |
| "typescript": 1, | |
| "xml": 2, | |
| "yaml": 1, | |
| "yml": 2 | |
| }, | |
| "word_emoji_counts": {} | |
| }, | |
| "timestamp": 1751588213 | |
| } |