-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Yul identifiers accept dots #16047
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
Comments
We're planning to disallow that soon. See #15540 (comment) for context. |
Actually, wait. #15540 is only about object names. For arbitrary identifiers we actually do need dots (e.g. |
It actually is documented, in multiple places.
Language Grammar >
Solidity v0.7.0 Breaking Changes > Inline Assembly
Though looks like we don't mention it under Inline Assembly. We should add it there as well. Also note that Language Grammar reflects Solidity grammar. The one for pure Yul is under Yul > Specification of Yul. |
Actually, it's already on the Inline Assembly page as well:
|
The language grammar specifies |
The Solidity grammar for yul identifiers states that
The Yul specification defines an identifier with the rule So, to be clear, in Solidity, yul code, which can only appear inside inline assembly blocks, doesn't accept dots in user-defined identifiers, albeit it accepts dots if they are referencing variables outside the scope of the block (such as Examples: contract A {
function f() public pure returns (uint x) {
assembly {
let z.a := mload(0)
x := z.a
}
}
}
Pure Yul does accept dots in user-defined identifiers: {
let z.a := mload(0)
let x.y.z := add(z.a, 0x2A)
mstore(z.a, x.y.z)
}
|
Only in Yul mode. |
I can declare identifiers in Yul with dots, but this is not documented in the grammar
The text was updated successfully, but these errors were encountered: