From 91768e139facd26234aba48bfbd244554ca2a636 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Fri, 19 Jan 2024 23:13:51 +0800 Subject: [PATCH] auto-sync: Fix some tree-sitter queries --- suite/auto-sync/Updater/CppTranslator/Patches/FeatureBits.py | 2 +- suite/auto-sync/Updater/CppTranslator/Patches/NamespaceArch.py | 2 +- suite/auto-sync/Updater/CppTranslator/Patches/NamespaceLLVM.py | 2 +- suite/auto-sync/Updater/CppTranslator/Patches/STIFeatureBits.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/suite/auto-sync/Updater/CppTranslator/Patches/FeatureBits.py b/suite/auto-sync/Updater/CppTranslator/Patches/FeatureBits.py index dbf187b881..278060d6f6 100644 --- a/suite/auto-sync/Updater/CppTranslator/Patches/FeatureBits.py +++ b/suite/auto-sync/Updater/CppTranslator/Patches/FeatureBits.py @@ -18,7 +18,7 @@ def get_search_pattern(self) -> str: return ( "(subscript_expression " ' ((identifier) @id (#match? @id "[fF]eatureBits"))' - " ((qualified_identifier) @qid)" + " (subscript_argument_list ((qualified_identifier) @qid))" ") @feature_bits" ) diff --git a/suite/auto-sync/Updater/CppTranslator/Patches/NamespaceArch.py b/suite/auto-sync/Updater/CppTranslator/Patches/NamespaceArch.py index 2ddbc0fa5c..1d708a353d 100644 --- a/suite/auto-sync/Updater/CppTranslator/Patches/NamespaceArch.py +++ b/suite/auto-sync/Updater/CppTranslator/Patches/NamespaceArch.py @@ -16,7 +16,7 @@ def __init__(self, priority: int): super().__init__(priority) def get_search_pattern(self) -> str: - return "(namespace_definition" " (identifier)" " (declaration_list) @decl_list" ") @namespace_def" + return "(namespace_definition" " (namespace_identifier)" " (declaration_list) @decl_list" ") @namespace_def" def get_main_capture_name(self) -> str: return "namespace_def" diff --git a/suite/auto-sync/Updater/CppTranslator/Patches/NamespaceLLVM.py b/suite/auto-sync/Updater/CppTranslator/Patches/NamespaceLLVM.py index 8d4acedd30..5f737cbb45 100644 --- a/suite/auto-sync/Updater/CppTranslator/Patches/NamespaceLLVM.py +++ b/suite/auto-sync/Updater/CppTranslator/Patches/NamespaceLLVM.py @@ -18,7 +18,7 @@ def __init__(self, priority: int): def get_search_pattern(self) -> str: return ( "(namespace_definition" - ' (identifier) @id (#eq? @id "llvm")' + ' (namespace_identifier) @id (#eq? @id "llvm")' " (declaration_list) @decl_list" ") @namespace_def" ) diff --git a/suite/auto-sync/Updater/CppTranslator/Patches/STIFeatureBits.py b/suite/auto-sync/Updater/CppTranslator/Patches/STIFeatureBits.py index cc10ff580c..275a0d63e0 100644 --- a/suite/auto-sync/Updater/CppTranslator/Patches/STIFeatureBits.py +++ b/suite/auto-sync/Updater/CppTranslator/Patches/STIFeatureBits.py @@ -25,7 +25,7 @@ def get_search_pattern(self) -> str: " )" " (argument_list)" " )" - " ((qualified_identifier) @flag)" + " (subscript_argument_list ((qualified_identifier) @flag))" ") @sti_feature_bits" )