tree-sitter-lean icon indicating copy to clipboard operation
tree-sitter-lean copied to clipboard

`_dollar` seems to cause the grammar to explode

Open vigoux opened this issue 1 year ago • 4 comments

DISCLAIMER: I am not a lean expert, I just started to learn it.

I was debugging a little the reason why the grammar was extremely long to generate, despite not being that big. For that I followed the steps mentioned in this wiki page.

It seems that the _dollar rule causes a lot of states to be generated, and that could be the source of the issues.

Here are the top offenders in terms of state counts:

binary_expression              	12424
comparison                     	9877
_dollar                        	9877
subarray                       	9664
let                            	6881
match                          	2301
tactics                        	1756
tactics_repeat1                	1620
fun_repeat2                    	1557
fun                            	1305
_do_seq_repeat1                	1246
_do_seq                        	1136

I would very much like to help, but I do not have enough lean knowledge to provide any meaningful fix at the moment.

vigoux avatar Oct 12 '23 09:10 vigoux