solhint
solhint copied to clipboard
Upgrade parser
@fvictorio do you think this will resolve this error I'm getting on a block of assembly?
Linter: Parse error: extraneous input ',' expecting {'from', '{', '}', '(', 'error', 'for', 'function', 'address', 'calldata', 'if', 'assembly', 'return', 'revert', 'byte', 'let', '=:', 'switch', 'callback', DecimalNumber, HexNumber, HexLiteralFragment, 'break', 'continue', 'leave', 'payable', 'constructor', 'receive', Identifier, StringLiteralFragment} [undefined]
Code:
let p := j
let word := mload(add(dataPtr, p))
let h, l := byteToHex(word, hexCharsPtr)
The error happens on the 3rd line, but the contract compiles as expected.
@potomak can you give me a full (compilable) example that includes an assembly block with a let a, b := ... assignment?
Example:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
contract Test {
function foo() public pure {
assembly {
function bar() -> a, b {
a := 1
b := 2
}
let i, j := bar()
}
}
}
Thank you. The parser doesn't support that syntax yet, so upgrading won't fix your problem. I created an issue in the parser's repo about this.