-
Notifications
You must be signed in to change notification settings - Fork 5
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
Incorrect solidity grammar highlighting problems #8
Comments
Another example (taken from https://docs.soliditylang.org/en/v0.8.15/assembly.html#access-to-external-variables-functions-and-libraries): // SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.10 <0.9.0;
contract C {
// Assigns a new selector and address to the return variable @fun
function combineToFunctionPointer(address newAddress, uint newSelector) public pure returns (function() external fun) {
assembly {
fun.selector := newSelector
fun.address := newAddress
}
}
}
|
|
Code (here in GitHub's highlighting it works): contract Highlighting {
mapping(address account => uint256 tokensA) public claimedATokens;
mapping(address account => uint256 tokensB) public claimedBTokens;
function _claimTokens(
uint256 bonus, // syntax highligting works here
mapping(address => uint256) storage _tokenMapping, //this line brokes syntax highlighting
address account, //not working
uint256 amountToClaim //not working
) internal { // from here it is working again
// some more common code
_tokenMapping[account] = _tokenMapping[account] + amountToClaim + bonus;
}
function claimATokens(address account, uint256 amountToClaim /*green coment*/) external /*yellow coment?*/ {
// ... code specif for A ...
_claimTokens(0, claimedATokens, account, amountToClaim);
}
function claimBTokens(address account, uint256 amountToClaim) external {
// ... code specif for B ...
_claimTokens(1, claimedBTokens, account, amountToClaim);
}
} |
The grammar used in the extension doesn't correctly highlight symbols if they are followed by curly braces {}.
Examples for reproduction:
The text was updated successfully, but these errors were encountered: