Open echodrift opened 9 months ago
Hello @lvdthieu,
Our parser doesn't understand size: = extcodesize(investor)
because the operator we consider as assignment in assembly is :=
(no space between :
and =
) which would make your code look like this size := extcodesize(investor)
.
Just out of curiosity, does : =
compile without errors using the solidity compiler? If that's the case we need to update our grammar.
Hello @Janther, Thank for give me your time, I have tried to compile the file using hardhat framework, in which I config solidity compiler version as 0.4.24 and it's compilable.
for now just change name: = value
to name := value
in your code since fixing the grammar might take some time.
Actually, I am doing a survey about solidity smart contracts and I need to parse multiple files (from verified Smart Contracts from Etherscan.io). I encounter some weird cases that a file has some "syntax error" (I'm not sure) but it's still compilable. I have recognized some patterns in these files and I want to let you know. Example files
errors: [
{
message: "extraneous input 'indexed' expecting {',', ')'}",
line: 516,
column: 91
}
]
errors: [
{
message: "extraneous input 'fallback' expecting {'from', 'error', 'address', 'calldata', 'revert', 'callback', 'override', 'constant', 'immutable', 'leave', 'internal', 'payable', 'private', 'public', 'global', 'constructor', 'receive', Identifier}",
line: 35,
column: 17
}
]
errors: [
{
message: `token recognition error at: '"The number of recipients differs from the number of amounts \\\r\n` +
"'",
line: 6,
column: 8
},
{
message: `token recognition error at: '";\r'`,
line: 7,
column: 19
},
{ message: "missing ';' at 'string'", line: 8, column: 4 },
{
message: `token recognition error at: '"The ether value sent is less than the total intended amount to send \\\r\n` +
"'",
line: 9,
column: 8
},
{
message: `token recognition error at: '";\r'`,
line: 10,
column: 21
},
{
message: "extraneous input 'event' expecting {'from', 'error', 'address', 'calldata', 'revert', 'callback', 'leave', 'payable', 'global', 'constructor', 'receive', Identifier}",
line: 12,
column: 4
},
{
message: "mismatched input '(' expecting ';'",
line: 12,
column: 14
},
{
message: "mismatched input ',' expecting {';', '='}",
line: 12,
column: 32
},
{
message: "extraneous input ')' expecting {';', '='}",
line: 12,
column: 45
}
]
When I try to parse a solidity file with assembly code, parser throw a ParseError:
But when I use solidity compiler to compile file, it is still compilable. Here is my source code example.