aboutsummaryrefslogtreecommitdiffstats
path: root/tests/query/highlights
diff options
context:
space:
mode:
authorYongJieYongJie <KhooYongJie@gmx.com>2022-03-12 01:11:17 +0800
committerStephan Seitz <stephan.seitz@fau.de>2022-03-11 19:06:39 +0100
commitfc0b881f93851a79ae3506d54e0e3e368c98ce58 (patch)
tree645e9148d5b518010d3b3c1d12eae8d2dd0441f2 /tests/query/highlights
parentRefactor solidity highlights.scm (diff)
downloadnvim-treesitter-fc0b881f93851a79ae3506d54e0e3e368c98ce58.tar
nvim-treesitter-fc0b881f93851a79ae3506d54e0e3e368c98ce58.tar.gz
nvim-treesitter-fc0b881f93851a79ae3506d54e0e3e368c98ce58.tar.bz2
nvim-treesitter-fc0b881f93851a79ae3506d54e0e3e368c98ce58.tar.lz
nvim-treesitter-fc0b881f93851a79ae3506d54e0e3e368c98ce58.tar.xz
nvim-treesitter-fc0b881f93851a79ae3506d54e0e3e368c98ce58.tar.zst
nvim-treesitter-fc0b881f93851a79ae3506d54e0e3e368c98ce58.zip
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
Diffstat (limited to 'tests/query/highlights')
-rw-r--r--tests/query/highlights/solidity/test.sol8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/query/highlights/solidity/test.sol b/tests/query/highlights/solidity/test.sol
index aadf11b6d..42a335182 100644
--- a/tests/query/highlights/solidity/test.sol
+++ b/tests/query/highlights/solidity/test.sol
@@ -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