NomicFoundation / slang

Solidity compiler tooling by @NomicFoundation

Home Page:https://nomicfoundation.github.io/slang/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support parsing Yul builtins

DaniPopes opened this issue · comments

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.
───╯

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.

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