我如何获得@punctuation.delimiter的值?

How do I get the value of @punctuation.delimiter?

我想获取有关树保姆的信息。其中,我想获取@punctuation.delimiter的值。我怎样才能得到它?

https://github.com/nvim-treesitter/nvim-treesitter/blob/419153c1f1992ced7f9462d92f0d7505c6ff3137/queries/rust/highlights.scm#L131

在上面的例子中,":":",""."我想获取字符串 ":",";",",","".

你可以简单地通过比较这个“装饰器”的名称和节点的字符类型来检查:

for _, match, _ in query:iter_matches(parent_node, 0, start_row, end_row) do
    for id, node in pairs(match) do
        if character_type == 'punctuation.delimiter' then
            -- do your stuff
        end
    end
end

Here's is an example how I tried to "access" those "decorators" in my query files.