| { | |
| "ast": { | |
| "items": [ | |
| { | |
| "use": { | |
| "tree": { | |
| "path": { | |
| "ident": "crate", | |
| "tree": { | |
| "path": { | |
| "ident": "extractor", | |
| "tree": { | |
| "path": { | |
| "ident": "types", | |
| "tree": { | |
| "group": [ | |
| { | |
| "ident": "CodeSnippet" | |
| }, | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "fn": { | |
| "attrs": [ | |
| { | |
| "meta": { | |
| "name_value": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "doc" | |
| } | |
| ] | |
| }, | |
| "value": { | |
| "lit": { | |
| "str": "\" Tests a code snippet by attempting to compile/execute it.\"" | |
| } | |
| } | |
| } | |
| }, | |
| "style": "outer" | |
| } | |
| ], | |
| "ident": "test_code_snippet_old", | |
| "inputs": [ | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "snippet" | |
| } | |
| }, | |
| "ty": { | |
| "reference": { | |
| "elem": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "CodeSnippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "mut": true | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "output": null, | |
| "stmts": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "call": { | |
| "args": [], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "std" | |
| }, | |
| { | |
| "ident": "time" | |
| }, | |
| { | |
| "ident": "Instant" | |
| }, | |
| { | |
| "ident": "now" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "start_time" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "None" | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "output" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "match": { | |
| "arms": [ | |
| { | |
| "body": { | |
| "block": { | |
| "stmts": [ | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "binary": { | |
| "left": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"fn \"" | |
| } | |
| } | |
| ], | |
| "method": "contains", | |
| "receiver": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "content" | |
| } | |
| } | |
| } | |
| }, | |
| "op": "||", | |
| "right": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"let \"" | |
| } | |
| } | |
| ], | |
| "method": "contains", | |
| "receiver": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "content" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "else_branch": { | |
| "block": { | |
| "stmts": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "test_result" | |
| } | |
| }, | |
| "right": { | |
| "call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "lit": { | |
| "bool": false | |
| } | |
| }, | |
| "ident": "passed" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "to_string", | |
| "receiver": { | |
| "lit": { | |
| "str": "\"No function or variable declarations found\"" | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "error_message" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "elapsed", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "start_time" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "execution_time" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "output" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "output" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "test_result" | |
| } | |
| }, | |
| "right": { | |
| "call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "lit": { | |
| "bool": true | |
| } | |
| }, | |
| "ident": "passed" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "None" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "error_message" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "output" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "output" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "elapsed", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "start_time" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "execution_time" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"rust\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "block": { | |
| "stmts": [ | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "binary": { | |
| "left": { | |
| "binary": { | |
| "left": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"function\"" | |
| } | |
| } | |
| ], | |
| "method": "contains", | |
| "receiver": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "content" | |
| } | |
| } | |
| } | |
| }, | |
| "op": "||", | |
| "right": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"const \"" | |
| } | |
| } | |
| ], | |
| "method": "contains", | |
| "receiver": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "content" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "op": "||", | |
| "right": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"let \"" | |
| } | |
| } | |
| ], | |
| "method": "contains", | |
| "receiver": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "content" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "else_branch": { | |
| "block": { | |
| "stmts": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "test_result" | |
| } | |
| }, | |
| "right": { | |
| "call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "lit": { | |
| "bool": false | |
| } | |
| }, | |
| "ident": "passed" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "to_string", | |
| "receiver": { | |
| "lit": { | |
| "str": "\"No function or variable declarations found\"" | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "error_message" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "elapsed", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "start_time" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "execution_time" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "output" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "output" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "test_result" | |
| } | |
| }, | |
| "right": { | |
| "call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "lit": { | |
| "bool": true | |
| } | |
| }, | |
| "ident": "passed" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "None" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "error_message" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "elapsed", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "start_time" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "execution_time" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "output" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "output" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| "pat": { | |
| "or": { | |
| "cases": [ | |
| { | |
| "lit": { | |
| "str": "\"javascript\"" | |
| } | |
| }, | |
| { | |
| "lit": { | |
| "str": "\"js\"" | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "block": { | |
| "stmts": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "test_result" | |
| } | |
| }, | |
| "right": { | |
| "call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "lit": { | |
| "bool": false | |
| } | |
| }, | |
| "ident": "passed" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "to_string", | |
| "receiver": { | |
| "lit": { | |
| "str": "\"Language not supported for testing\"" | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "error_message" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "elapsed", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "start_time" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "execution_time" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "output" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "output" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| "pat": { | |
| "_": {} | |
| } | |
| } | |
| ], | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "as_str", | |
| "receiver": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "language" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ], | |
| "vis": "pub" | |
| } | |
| }, | |
| { | |
| "fn": { | |
| "attrs": [ | |
| { | |
| "meta": { | |
| "name_value": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "doc" | |
| } | |
| ] | |
| }, | |
| "value": { | |
| "lit": { | |
| "str": "\" Tests a code snippet by attempting to compile/execute it. \"" | |
| } | |
| } | |
| } | |
| }, | |
| "style": "outer" | |
| } | |
| ], | |
| "ident": "test_code_snippet", | |
| "inputs": [ | |
| { | |
| "typed": { | |
| "pat": { | |
| "ident": { | |
| "ident": "snippet" | |
| } | |
| }, | |
| "ty": { | |
| "reference": { | |
| "elem": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "CodeSnippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "mut": true | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "output": null, | |
| "stmts": [ | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "call": { | |
| "args": [], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "std" | |
| }, | |
| { | |
| "ident": "time" | |
| }, | |
| { | |
| "ident": "Instant" | |
| }, | |
| { | |
| "ident": "now" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "start_time" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "let": { | |
| "init": { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "None" | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| "pat": { | |
| "ident": { | |
| "ident": "output" | |
| } | |
| } | |
| } | |
| }, | |
| { | |
| "expr": [ | |
| { | |
| "match": { | |
| "arms": [ | |
| { | |
| "body": { | |
| "block": { | |
| "stmts": [ | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "binary": { | |
| "left": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"fn \"" | |
| } | |
| } | |
| ], | |
| "method": "contains", | |
| "receiver": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "content" | |
| } | |
| } | |
| } | |
| }, | |
| "op": "||", | |
| "right": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"let \"" | |
| } | |
| } | |
| ], | |
| "method": "contains", | |
| "receiver": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "content" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "else_branch": { | |
| "block": { | |
| "stmts": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "test_result" | |
| } | |
| }, | |
| "right": { | |
| "call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "lit": { | |
| "bool": false | |
| } | |
| }, | |
| "ident": "passed" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "to_string", | |
| "receiver": { | |
| "lit": { | |
| "str": "\"No function or variable declarations found\"" | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "error_message" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "elapsed", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "start_time" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "execution_time" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "output" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "output" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "test_result" | |
| } | |
| }, | |
| "right": { | |
| "call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "lit": { | |
| "bool": true | |
| } | |
| }, | |
| "ident": "passed" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "None" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "error_message" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "elapsed", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "start_time" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "execution_time" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "output" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "output" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| "pat": { | |
| "lit": { | |
| "str": "\"rust\"" | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "block": { | |
| "stmts": [ | |
| { | |
| "expr": [ | |
| { | |
| "if": { | |
| "cond": { | |
| "binary": { | |
| "left": { | |
| "binary": { | |
| "left": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"function\"" | |
| } | |
| } | |
| ], | |
| "method": "contains", | |
| "receiver": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "content" | |
| } | |
| } | |
| } | |
| }, | |
| "op": "||", | |
| "right": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"const \"" | |
| } | |
| } | |
| ], | |
| "method": "contains", | |
| "receiver": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "content" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "op": "||", | |
| "right": { | |
| "method_call": { | |
| "args": [ | |
| { | |
| "lit": { | |
| "str": "\"let \"" | |
| } | |
| } | |
| ], | |
| "method": "contains", | |
| "receiver": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "content" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "else_branch": { | |
| "block": { | |
| "stmts": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "test_result" | |
| } | |
| }, | |
| "right": { | |
| "call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "lit": { | |
| "bool": false | |
| } | |
| }, | |
| "ident": "passed" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "to_string", | |
| "receiver": { | |
| "lit": { | |
| "str": "\"No function or variable declarations found\"" | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "error_message" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "elapsed", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "start_time" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "execution_time" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "output" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "output" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| "then_branch": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "test_result" | |
| } | |
| }, | |
| "right": { | |
| "call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "lit": { | |
| "bool": true | |
| } | |
| }, | |
| "ident": "passed" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "None" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "error_message" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "elapsed", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "start_time" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "execution_time" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "output" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "output" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| "pat": { | |
| "or": { | |
| "cases": [ | |
| { | |
| "lit": { | |
| "str": "\"javascript\"" | |
| } | |
| }, | |
| { | |
| "lit": { | |
| "str": "\"js\"" | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| { | |
| "body": { | |
| "block": { | |
| "stmts": [ | |
| { | |
| "expr": [ | |
| { | |
| "assign": { | |
| "left": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "test_result" | |
| } | |
| }, | |
| "right": { | |
| "call": { | |
| "args": [ | |
| { | |
| "struct": { | |
| "fields": [ | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "lit": { | |
| "bool": false | |
| } | |
| }, | |
| "ident": "passed" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "to_string", | |
| "receiver": { | |
| "lit": { | |
| "str": "\"Language not supported for testing\"" | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "error_message" | |
| }, | |
| { | |
| "colon_token": true, | |
| "expr": { | |
| "call": { | |
| "args": [ | |
| { | |
| "method_call": { | |
| "args": [], | |
| "method": "elapsed", | |
| "receiver": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "start_time" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "ident": "execution_time" | |
| }, | |
| { | |
| "expr": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "output" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "output" | |
| } | |
| ], | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "TestResult" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ], | |
| "func": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "Some" | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| true | |
| ] | |
| } | |
| ] | |
| } | |
| }, | |
| "pat": { | |
| "_": {} | |
| } | |
| } | |
| ], | |
| "expr": { | |
| "method_call": { | |
| "args": [], | |
| "method": "as_str", | |
| "receiver": { | |
| "field": { | |
| "base": { | |
| "path": { | |
| "segments": [ | |
| { | |
| "ident": "snippet" | |
| } | |
| ] | |
| } | |
| }, | |
| "ident": "language" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| false | |
| ] | |
| } | |
| ], | |
| "vis": "pub" | |
| } | |
| } | |
| ] | |
| }, | |
| "file_path": "src\\extractor\\system\\test_code.rs", | |
| "summary": { | |
| "emoji_counts_in_strings": {}, | |
| "string_literals": [ | |
| "\" Tests a code snippet by attempting to compile/execute it.\"", | |
| "\"fn \"", | |
| "\"let \"", | |
| "\"No function or variable declarations found\"", | |
| "\"rust\"", | |
| "\"function\"", | |
| "\"const \"", | |
| "\"let \"", | |
| "\"No function or variable declarations found\"", | |
| "\"javascript\"", | |
| "\"js\"", | |
| "\"Language not supported for testing\"", | |
| "\" Tests a code snippet by attempting to compile/execute it. \"", | |
| "\"fn \"", | |
| "\"let \"", | |
| "\"No function or variable declarations found\"", | |
| "\"rust\"", | |
| "\"function\"", | |
| "\"const \"", | |
| "\"let \"", | |
| "\"No function or variable declarations found\"", | |
| "\"javascript\"", | |
| "\"js\"", | |
| "\"Language not supported for testing\"" | |
| ], | |
| "top_level_nodes": 1, | |
| "total_nodes": 696, | |
| "type_counts": { | |
| "_": 2, | |
| "args": 56, | |
| "arms": 2, | |
| "assign": 10, | |
| "attrs": 2, | |
| "base": 22, | |
| "binary": 6, | |
| "block": 10, | |
| "body": 6, | |
| "bool": 10, | |
| "call": 28, | |
| "cases": 2, | |
| "colon_token": 30, | |
| "cond": 4, | |
| "elem": 2, | |
| "else_branch": 4, | |
| "expr": 62, | |
| "field": 22, | |
| "fields": 10, | |
| "fn": 2, | |
| "func": 28, | |
| "group": 1, | |
| "ident": 177, | |
| "if": 4, | |
| "init": 4, | |
| "inputs": 2, | |
| "items": 1, | |
| "left": 16, | |
| "let": 4, | |
| "lit": 34, | |
| "match": 2, | |
| "meta": 2, | |
| "method": 28, | |
| "method_call": 28, | |
| "mut": 2, | |
| "name_value": 2, | |
| "op": 6, | |
| "or": 2, | |
| "output": 2, | |
| "pat": 12, | |
| "path": 93, | |
| "receiver": 28, | |
| "reference": 2, | |
| "right": 16, | |
| "segments": 90, | |
| "stmts": 12, | |
| "str": 24, | |
| "struct": 10, | |
| "style": 2, | |
| "then_branch": 4, | |
| "tree": 4, | |
| "ty": 2, | |
| "typed": 2, | |
| "use": 1, | |
| "value": 2, | |
| "vis": 2 | |
| }, | |
| "word_counts": { | |
| "a": 2, | |
| "attempting": 2, | |
| "by": 2, | |
| "code": 2, | |
| "compile": 2, | |
| "const": 2, | |
| "declarations": 4, | |
| "execute": 2, | |
| "fn": 2, | |
| "for": 2, | |
| "found": 4, | |
| "function": 6, | |
| "it": 2, | |
| "javascript": 2, | |
| "js": 2, | |
| "language": 2, | |
| "let": 4, | |
| "no": 4, | |
| "not": 2, | |
| "or": 4, | |
| "rust": 2, | |
| "snippet": 2, | |
| "supported": 2, | |
| "testing": 2, | |
| "tests": 2, | |
| "to": 2, | |
| "variable": 4 | |
| }, | |
| "word_emoji_counts": { | |
| "π": 4, | |
| "π": 4, | |
| "π": 2, | |
| "π¦βοΈ": 2 | |
| } | |
| }, | |
| "timestamp": 1751588252 | |
| } |