getgrit / gritql

GritQL is a query language for searching, linting, and modifying code.
https://docs.grit.io/
MIT License
3.17k stars 82 forks source link

Panic when parsing Rust lists #575

Open morgante opened 1 week ago

morgante commented 1 week ago

The studio panics when running this pattern:

language rust

`fn $name($args) -> $ret { $block }` as $node where {
    $arg0 = $args[0],
    $node => `fn x($arg0) -> $ret { $block }`
} 

When applied to:

fn foo(x: usize) -> usize {
    println!("Hi!");
    return x;
}

Reported in https://discord.com/channels/1140989670751219762/1304597516234526761/1305934295810052269