Wilfred / difftastic

a structural diff that understands syntax 🟥🟩

Home Page:https://difftastic.wilfred.me.uk/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Solidity parser is incomplete

mateuszradomski opened this issue · comments

Hi,

This issue is more a question than a bug report. The tree sitter parser for solidity is incomplete, it produces an error on a valid type.
Given this code:

mapping(uint256 x => mapping(uint256 y => bool isFinalized))

The tree sitter parser contains errors in the AST

m@mateuszs-mbp backend % difft --dump-ts test.sol | grep ERROR
  ERROR (0, 0) - (0, 60)
      ERROR (0, 16) - (0, 17)
        ERROR (0, 37) - (0, 38)
        ERROR (0, 42) - (0, 46)

I've decided to post this issue here and not in the solidity parser repo since the repository is long dead (not active for 2 years). I've noticed that you have inlined all parsers in the repository, would you accept a PR that fixes a given issue into this inlined parser code?

If yes, I'll submit it in the near future if no please close this issue.

Could you fork the upstream repo instead? I'd rather not have the vendored code differ from upstream. If you fork, you can have CI etc and we can merge here as normal :)