mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 09:20:04 -04:00
Refactor solidity highlights.scm further
- Instead of @keyword, use @conditional, @exception, @return, @function as appropriate - Standardize to using @field (instead of @property)for struct members
This commit is contained in:
parent
8f3991065d
commit
fc0b881f93
2 changed files with 36 additions and 21 deletions
|
|
@ -21,7 +21,7 @@ contract Ballot {
|
|||
// ^ type
|
||||
uint weight; // weight is accumulated by delegation
|
||||
// ^ type
|
||||
// ^ variable
|
||||
// ^ field
|
||||
bool voted; // if true, that person already voted
|
||||
address delegate; // person delegated to
|
||||
uint vote; // index of the voted proposal
|
||||
|
|
@ -45,6 +45,9 @@ contract Ballot {
|
|||
// A dynamically-sized array of `Proposal` structs.
|
||||
Proposal[] public proposals;
|
||||
|
||||
enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill }
|
||||
// ^ constant
|
||||
|
||||
/// Create a new ballot to choose one of `proposalNames`.
|
||||
constructor(bytes32[] memory proposalNames) {
|
||||
// ^ constructor
|
||||
|
|
@ -69,8 +72,9 @@ contract Ballot {
|
|||
// Give `voter` the right to vote on this ballot.
|
||||
// May only be called by `chairperson`.
|
||||
function giveRightToVote(address voter) external {
|
||||
// ^ keyword
|
||||
// ^ keyword.function
|
||||
// ^ function
|
||||
// ^ parameter
|
||||
// If the first argument of `require` evaluates
|
||||
// to `false`, execution terminates and all
|
||||
// changes to the state and to Ether balances
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue