Extract decorator names from preceding decorator/annotation nodes Count annotations inside a Java/Kotlin/C# "modifiers" node.
| 1713 | // Extract decorator names from preceding decorator/annotation nodes |
| 1714 | // Count annotations inside a Java/Kotlin/C# "modifiers" node. |
| 1715 | static int count_modifier_annotations(TSNode modifiers, const CBMLangSpec *spec) { |
| 1716 | int count = 0; |
| 1717 | uint32_t mc = ts_node_child_count(modifiers); |
| 1718 | for (uint32_t mi = 0; mi < mc; mi++) { |
| 1719 | TSNode mchild = ts_node_child(modifiers, mi); |
| 1720 | if (cbm_kind_in_set(mchild, spec->decorator_node_types)) { |
| 1721 | count++; |
| 1722 | } |
| 1723 | } |
| 1724 | return count; |
| 1725 | } |
| 1726 | |
| 1727 | // Find the wrapper child that holds annotations/attributes for languages where |
| 1728 | // they are nested under an intermediate node rather than being a prev-sibling: |
no test coverage detected