Skip to content

refactor: solang#8

Merged
mds1 merged 7 commits intomainfrom
solang
Nov 15, 2022
Merged

refactor: solang#8
mds1 merged 7 commits intomainfrom
solang

Conversation

@mds1
Copy link
Contributor

@mds1 mds1 commented Nov 11, 2022

Replace hacky regex checks with solang, which is a solidity parser. One downside is that we currently lose line number info, but we can get it back in a future update. solang provides location data as start and end offsets in bytes, so we have to manually convert that to line number by mapping it to the input string.

Edit: foundry has the function we need to do that implemented here, so we can use that to report line numbers, h/t/ @rkrasiuk

Copy link

@rkrasiuk rkrasiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some smol comments/suggestions

Copy link
Contributor

@jferas jferas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.. and losing the line number for now doesn't seem like a major issue as the offending string is output

@mds1 mds1 merged commit 8c44058 into main Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants