duaraghav8 / Ethlint

(Formerly Solium) Code quality & Security Linter for Solidity
https://ethlint.readthedocs.io/en/latest/
MIT License
927 stars 128 forks source link

Underscores in integer literals are not supported #262

Open KaiRo-at opened 5 years ago

KaiRo-at commented 5 years ago

Description When underscores are used in integer literals as described in https://solidity.readthedocs.io/en/develop/types.html#rational-and-integer-literals to increase readability, the linter wrongly reports a syntax error: 30:19 error Syntax error: unexpected token _

Steps to reproduce

Put code like the following into your contract and run ethlint on it:

total = 50_000_000 * (uint256(10) ** decimals());

Expected behavior ethlint should accept and correctly interpret this syntax.

Operating System Linux

Linter version Solium version 1.2.4

Comments As a linter should help improve code readability among other things, and this is a readability feature, it would be nice if both work together. :)

Priority Low as it's easy to temporarily work around.

duaraghav8 commented 5 years ago

This is a bug in Ethlint's internal solidity parser. I'll ship the fix in the next release Thanks for reporting