NomicFoundation / slang

Solidity compiler tooling by @NomicFoundation
https://nomicfoundation.github.io/slang/
MIT License
242 stars 19 forks source link

Support parsing Yul builtins #740

Closed DaniPopes closed 10 months ago

DaniPopes commented 10 months ago
contract C {
    function f() public pure {
        assembly {
            let opcode := byte(0, 0)
        }
    }
}

Produces

Error: Expected AsciiStringLiteral or HexStringLiteral or YulDecimalLiteral or YulFalseKeyword or YulHexLiteral or YulIdentifier or YulTrueKeyword.
   ╭─[test.sol:4:18]
   │
 4 │ ╭─▶          let opcode := byte(0, 0)
 5 │ ├─▶        }
   │ │              
   │ ╰────────────── Error occurred here.
───╯
OmarTawfik commented 10 months ago

Thank you for reporting! Looks like we need to add/document a few missing built-in yul functions. We are looking into this, and will update the issue once the fix is ready.

OmarTawfik commented 10 months ago

@DaniPopes fix has been released in Slang v0.13.1, and the online specification will be updated as soon as #749 is merged. Thanks!