Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade parser #330

Merged
merged 2 commits into from
Dec 7, 2022
Merged

Upgrade parser #330

merged 2 commits into from
Dec 7, 2022

Conversation

fvictorio
Copy link
Contributor

No description provided.

@potomak
Copy link

potomak commented Feb 20, 2022

@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.

@fvictorio
Copy link
Contributor Author

@potomak can you give me a full (compilable) example that includes an assembly block with a let a, b := ... assignment?

@potomak
Copy link

potomak commented Feb 21, 2022

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()
        }
    }
}

@fvictorio
Copy link
Contributor Author

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.

@dbale-altoros dbale-altoros merged commit 3be2277 into protofire:master Dec 7, 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