getgrit / gritql

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

Bug: error parsing rust `impl 'lifetime + ...` #486

Open guissalustiano opened 2 months ago

guissalustiano commented 2 months ago

When I apply a pattern against

fn foo<'a>(x: impl 'a + Clone ) {}

It fails to parse: ERROR (code: 300) - Error parsing source code at 1:10

The follow code works

fn foo<'a, T: 'a + Clone>(x: impl 'a + Clone ) {}

Which confirms that the issue is on impl 'a + Clone.

morgante commented 2 months ago

This probably needs an upstream fix: https://github.com/tree-sitter/tree-sitter-rust

If it's working with the upstream Grammar we likely just need to bump our version.

guissalustiano commented 2 months ago

Thanks! An issue about that was open yesterday. https://github.com/tree-sitter/tree-sitter-rust/issues/234