Open rathod-sahaab opened 9 months ago
This is a minimal example to decrease verbosity.
What I actually want to do is declare variables at i(3) from the variables type in declaration of void solve(...)
i(3)
void solve(...)
cin >> a >> b; // to //dynamic node -> void solve({} a, {} b) {, i(1), i(2) void solve(int a, int b) // to int a; string b;
Overview of config, I can't even get dynamic node to read from output of function node. Reading from input works
return { s( "codeforces", fmt( [[ -- ... void solve({}) {{ {} }} int main(int argc, char *argv[]) {{ -- declare variables {} cin >> {}; solve({}); }} -- ... }} ]], { d(2, function(args) vim.print(args) local parts = stringz.split(args[1][1], ",") local nodes = {} for index, part in ipairs(parts) do table.insert(nodes, t(part .. ", ")) end return sn(nil, nodes) end, k("solve-passed-params"), { key = "solve-args" }), i(0, "", { key = "solve-body" }), i(3), f(function(args) vim.print(args) local parts = stringz.split(args[1][1]:gsub("%s+", ""), ">>") return table.concat(parts, ", ") end, k("input"), { "solve-passed-params" }), } ) ), }
Oh, are you just missing the key = "solve-passed-params" in f(...)?
key = "solve-passed-params"
f(...)
This is a minimal example to decrease verbosity.
What I actually want to do is declare variables at
i(3)
from the variables type in declaration ofvoid solve(...)
Overview of config, I can't even get dynamic node to read from output of function node. Reading from input works