diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2b20039..4f6ad9d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,7 +11,7 @@ jobs: parameters: job_name: ubuntu20_cpython image_name: ubuntu-20.04 - python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python_versions: ['3.9', '3.10', '3.11', '3.12'] test_suites: all: | sudo apt-get install universal-ctags gettext @@ -21,7 +21,7 @@ jobs: parameters: job_name: ubuntu22_cpython image_name: ubuntu-22.04 - python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python_versions: ['3.9', '3.10', '3.11', '3.12'] test_suites: all: | sudo apt-get install universal-ctags gettext diff --git a/setup.cfg b/setup.cfg index 4ddcdc0..f5532f1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,15 +45,15 @@ install_requires = plugincode commoncode typecode - tree-sitter - tree-sitter-bash - tree-sitter-c - tree-sitter-cpp - tree-sitter-go - tree-sitter-java - tree-sitter-javascript - tree-sitter-python - tree-sitter-rust + tree-sitter==0.22.0 + tree-sitter-bash==0.21.0 + tree-sitter-c==0.21.1 + tree-sitter-cpp==0.22.0 + tree-sitter-go==0.21.0 + tree-sitter-java==0.21.0 + tree-sitter-javascript==0.21.2 + tree-sitter-python==0.21.0 + tree-sitter-rust==0.21.2 pygments [options.packages.find] diff --git a/src/source_inspector/symbols_tree_sitter.py b/src/source_inspector/symbols_tree_sitter.py index bb4be79..6f26a36 100644 --- a/src/source_inspector/symbols_tree_sitter.py +++ b/src/source_inspector/symbols_tree_sitter.py @@ -96,13 +96,13 @@ def collect_symbols_and_strings(location): symbols, strings = [], [] if parser_result := get_parser(location): - parser, string_id = parser_result + parser, language_info = parser_result with open(location, "rb") as f: source = f.read() tree = parser.parse(source) - traverse(tree.root_node, symbols, strings, string_id) + traverse(tree.root_node, symbols, strings, language_info) return symbols, strings @@ -118,42 +118,74 @@ def get_parser(location): if not language or language not in TS_LANGUAGE_WHEELS: return - wheel = TS_LANGUAGE_WHEELS[language]["wheel"] - string_id = TS_LANGUAGE_WHEELS[language]["string_id"] + language_info = TS_LANGUAGE_WHEELS[language] + wheel = language_info["wheel"] try: grammar = importlib.import_module(wheel) except ModuleNotFoundError: raise TreeSitterWheelNotInstalled(f"{wheel} package is not installed") - LANGUAGE = Language(grammar.language(), language) + LANGUAGE = Language(grammar.language()) parser = Parser() parser.set_language(LANGUAGE) - return parser, string_id + return parser, language_info -def traverse(node, symbols, strings, string_id, depth=0): +def traverse(node, symbols, strings, language_info, depth=0): """Recursively traverse the parse tree node to collect symbols and strings.""" - if node.type == "identifier": - if source_symbol:=node.text.decode(): + if node.type in language_info.get("identifiers"): + if source_symbol := node.text.decode(): symbols.append(source_symbol) - elif node.type == string_id: - if source_string:=node.text.decode("unicode_escape").replace('"', ""): + elif node.type in language_info.get("string_literals"): + if source_string := node.text.decode(): strings.append(source_string) for child in node.children: - traverse(child, symbols, strings, string_id, depth + 1) + traverse(child, symbols, strings, language_info, depth + 1) TS_LANGUAGE_WHEELS = { - "Bash": {"wheel": "tree_sitter_bash", "string_id": "raw_string"}, - "C": {"wheel": "tree_sitter_c", "string_id": "string_literal"}, - "C++": {"wheel": "tree_sitter_cpp", "string_id": "string_literal"}, - "Go": {"wheel": "tree_sitter_go", "string_id": "raw_string_literal"}, - "Java": {"wheel": "tree_sitter_java", "string_id": "string_literal"}, - "JavaScript": {"wheel": "tree_sitter_javascript", "string_id": "string"}, - "Python": {"wheel": "tree_sitter_python", "string_id": "string"}, - "Rust": {"wheel": "tree_sitter_rust", "string_id": "raw_string_literal"}, + "Bash": { + "wheel": "tree_sitter_bash", + "identifiers": ["identifier"], + "string_literals": ["string_literal"], + }, + "C": { + "wheel": "tree_sitter_c", + "identifiers": ["identifier"], + "string_literals": ["string_literal"], + }, + "C++": { + "wheel": "tree_sitter_cpp", + "identifiers": ["identifier"], + "string_literals": ["string_literal"], + }, + "Go": { + "wheel": "tree_sitter_go", + "identifiers": ["identifier"], + "string_literals": ["raw_string_literal"], + }, + "Java": { + "wheel": "tree_sitter_java", + "identifiers": ["identifier"], + "string_literals": ["string_literal"], + }, + "JavaScript": { + "wheel": "tree_sitter_javascript", + "identifiers": ["identifier"], + "string_literals": ["string_literal"], + }, + "Python": { + "wheel": "tree_sitter_python", + "identifiers": ["identifier"], + "string_literals": ["string_literal"], + }, + "Rust": { + "wheel": "tree_sitter_rust", + "identifiers": ["identifier"], + "string_literals": ["raw_string_literal"], + }, } diff --git a/tests/data/symbols_tree_sitter/greet.sh b/tests/data/symbols_tree_sitter/greet.sh new file mode 100644 index 0000000..c0be7cc --- /dev/null +++ b/tests/data/symbols_tree_sitter/greet.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Define a global variable +GREETING="Hello" + +# Define a function to greet the user +greet_user() { + local username=$1 + echo "$GREETING, $username! Welcome to the Bash scripting tutorial." +} + +# Call the function with an argument +greet_user "Alice" diff --git a/tests/data/symbols_tree_sitter/if_ath.c-expected.json b/tests/data/symbols_tree_sitter/if_ath.c-expected.json index 212c8e5..4848e7e 100644 --- a/tests/data/symbols_tree_sitter/if_ath.c-expected.json +++ b/tests/data/symbols_tree_sitter/if_ath.c-expected.json @@ -10894,349 +10894,352 @@ "NOTIFY_DONE" ], "source_strings": [ - "opt_ah.h", - "if_ethersubr.h", - "if_media.h", - "if_llc.h", - "net80211/if_athproto.h", - "if_athvar.h", - "ah_desc.h", - "ah_devid.h", - "if_ath_pci.h", - "if_ath_ahb.h", - "ath_tx99.h", - "No error", - "No hardware present or device not yet supported", - "Memory allocation failed", - "Hardware didn't respond as expected", - "EEPROM magic number invalid", - "EEPROM version invalid", - "EEPROM unreadable", - "EEPROM checksum invalid", - "EEPROM read problem", - "EEPROM mac address invalid", - "EEPROM size not supported", - "Attempt to change write-locked EEPROM", - "Invalid parameter to function", - "Hardware revision not supported", - "Hardware self-test failed", - "Operation incomplete", - "i", - "i", - "i", - "i", - "i", - "s", - "s", - "Override default country code", - "Maximum VAPs", - "Enable/disable outdoor use", - "Enable/disable extended channel mode", - "Enable/disable RFKILL capability", - "Create ath device in [sta|ap|wds|adhoc|ahdemo|monitor] mode. defaults to sta, use 'none' to disable", - "Rate control algorithm [amrr|minstrel|onoe|sample], defaults to '", - "'", - "i", - "Load-time debug output enable", - "%s: devid 0x%x\n", - "%s: unable to attach hardware: '%s' (HAL status %u)\n", - "%s: HAL ABI mismatch; ", - "driver expects 0x%x, HAL reports 0x%x\n", - "%s: Warning, using only %u entries in %u key cache\n", - "ath_pci: switching rfkill capability %s\n", - "on", - "off", - "%s: failed to allocate descriptors: %d\n", - "%s: unable to setup a beacon xmit queue!\n", - "%s: unable to setup CAB xmit queue!\n", - "%s: unable to setup xmit queue for %s traffic!\n", - "%s: unable to setup UAPSD xmit queue!\n", - "%s: unable to register device\n", - "%s: TX99 support enabled\n", - "none", - "sta", - "ap", - "adhoc", - "ahdemo", - "wds", - "monitor", - "Unknown autocreate mode: %s\n", - "ath%d", - "%s: autocreation of VAP failed: %d\n", - "%s: flags %x\n", - "too many virtual ap's (already got %d)\n", - "beacon slot %u not empty?", - "Staggered beacons are not possible ", - "with maxvaps set to %d.\n", - "sc->stagbeacons %sabled\n", - "en", - "dis", - "grppoll", - "%s:grppoll Buf allocation failed \n", - "%s: %s: unable to start recv logic\n", - "VAP not stopped", - "%s: %s: unable to start recv logic\n", - "%s: flags %x\n", - "%s: flags %x\n", - "%s: no skbuff\n", - "%s: U-APSD node (%s) has invalid keycache entry\n", - "%s: Node (%s) became U-APSD triggerable (%d)\n", - "%s: Node (%s) no longer U-APSD triggerable (%d)\n", - "%s: U-APSD trigger detected for node (%s) on AC %d\n", - "%s: SP already in progress - ignoring\n", - "%s: dropped dup trigger, ac %d, seq %d\n", - "%s: Queue empty, generating QoS NULL to send\n", - "%s: flags 0x%x\n", - "%s: status 0x%x\n", - "%s: hardware error; resetting\n", - "%s: rx FIFO overrun; resetting\n", - "%s: ignored\n", - "%s\n", - "%s: mode %d\n", - "%s: unable to reset hardware: '%s' (HAL status %u) ", - "(freq %u flags 0x%x)\n", - "%s: disabling interference mitigation (ANI)\n", - "%s: unable to start recv logic\n", - "%s: invalid %u flags 0x%x\n", - "%s: %s: unable to reset hardware: '%s' (HAL status %u)\n", - "%s: disabling interference mitigation (ANI)\n", - "%s: %s: unable to start recv logic\n", - "%s: txq depth = %d\n", - "%s: link[%u](%p)=%llx (%p)\n", - "%s: txq depth = %d\n", - "%s: TXDP[%u] = %llx (%p)\n", - "%s: link[%u] (%p)=%llx (%p)\n", - "%s: skb %p [data %p len %u] skbaddr %llx\n", - "no rate table, mode %u", - "%s: Q%d: %08x %08x %08x %08x %08x %08x\n", - "no bf_ff on staging queue %p", - "%s: discard, encapsulation failure\n", - "%s: stop queue\n", - "%s: discard, no xmit buf\n", - "%s: discard, invalid %d flags %x\n", - "%s: discard, no node in cb\n", - "%s: aggregating fast-frame\n", - "%s: adding to fast-frame stage Q\n", - "%s: discard, ff flush encap failure\n", - "%s: ff stageq flush failure\n", - "%s: Out-Of-Order fast-frame\n", - "%s: discard, encapsulation failure\n", - "%s: discard, invalid %d flags %x\n", - "%s: stop queue\n", - "ath_mgtstart: discard, no xmit buf\n", - "WEP", - "AES-OCB", - "AES-CCM", - "CKIP", - "TKIP", - "CLR", - "%s: [%02u] %-7s ", - "%02x", - " mac %s", - " %s ", - "mic", - "rxmic", - "%02x", - " txmic ", - "%02x", - "\n", - "got a non-TKIP key, cipher %u", - "invalid cipher type %u", - "key cache !split", - "%s: key pair %u,%u %u,%u\n", - "%s: out of pair space\n", - "key cache split", - "%s: key pair %u,%u\n", - "%s: out of pair space\n", - "%s: key %u\n", - "%s: out of space\n", - "%s: bogus group key\n", - "%s: delete key %u\n", - "%s:\n", - "%s:\n", - "%s: RX filter 0x%x, MC filter %08x:%08x\n", - "%s: Leaving turbo\n", - "%s: Entering turbo\n", - "unexpected operating mode %d", - "%s: dynamic turbo switch to %s mode\n", - "turbo", - "base", - "%s: unable to update h/w beacon queue parameters\n", - "%s: cannot get sk_buff\n", - "%s: %s beacons, bslot %d intval %u tsfadjust(Kus) %llu\n", - "stagger", - "burst", - "%s: m %p len %u\n", - "%s: skip VAP in %s state\n", - "%s: avp=%p av_bcbuf=%p\n", - "%s: flush previous cabq traffic\n", - "%s: missed %u consecutive beacons\n", - "%s: resume beacon xmit after %u misses\n", - "%s: slot %d [tsf %llu tsftu %u intval %u] vap %p\n", - "%s: flip defant to %u, %u > %u\n", - "%s: beacon queue %u did not stop?\n", - "%s: stuck beacon; resetting (bmiss count %u)\n", - "%s: avp=%p av_bcbuf=%p\n", - "%s: TXDP%u = %llx (%p)\n", - "%s: nexttbtt %u intval %u (%u)\n", - "%s: tsf %llu tsf:tu %u intval %u nexttbtt %u dtim %u nextdtim %u bmiss %u sleep %u cfp:period %u maxdur %u next %u timoffset %u\n", - "%s: %s DMA: %u buffers %u desc/buf\n", - "%s: %s DMA map: %p (%lu) -> %llx (%lu)\n", - "rx", - "tx", - "beacon", - "%s: an %p\n", - "move data from NORMAL to XR\n", - "moved %d buffers from NORMAL to XR\n", - "move buffers from XR to NORMAL\n", - "%s: link[%u](%p)=%p (%p)\n", - "moved %d buffers from XR to NORMAL\n", - "%s: skbuff alloc of size %u failed\n", - "%s: skbuff alloc of size %u failed\n", - "data padding not enabled?", - "%s:%d %s\n", - "%s:%d %s\n", - "ibss merge, rstamp %u tsf %llu ", - "tstamp %llu\n", - "%s\n", - "%s: no buffer (%s)\n", - "%s: no skbuff (%s)\n", - "%s: runt packet %d\n", - "%s: short packet %d\n", - "%s: HAL qnum %u out of range, max %u!\n", - "0.25", - ".25", - "0.5", - ".5", - "1", - "3", - "6", - "?", - "%s %s", - "%d", - "grppoll_start: grppoll Buf allocation failed\n", - "%s: No more TxBufs\n", - "%s: No more TxBufs left\n", - "%s: HAL qnum %u out of range, max %u!\n", - "%s: AC %u out of range, max %u!\n", - "%s: unable to update hardware queue ", - "parameters for %s traffic!\n", - "%s: delivery Q empty, replacing with overflow Q\n", - "%s: added AC %d frame to delivery Q, new depth = %d\n", - "%s: delivery and overflow Qs full, dropped oldest\n", - "%s: added AC %d to overflow Q, new depth = %d\n", - "%s: skb %p [data %p len %u] skbaddr %llx\n", - "%s: skb%d %p [data %p len %u] skbaddr %llx\n", - "%s: skb%d %p [data %p len %u] skbaddr %llx\n", - "no rate table, mode %u", - "%s: bogus frame type 0x%x (%s)\n", - "cix not setup", - "%s: invalid TX rate %u (%s: %u)\n", - "%s: set up txdesc: pktlen %d hdrlen %d ", - "atype %d txpower %d txrate %d try0 %d keyix %d ant %d flags %x ", - "ctsrate %d ctsdur %d icvlen %d ivlen %d comp %d\n", - "%s: Q%d: %08x %08x %08x %08x %08x %08x\n", - "%s: Q%d: (ds)%p (lk)%08x (d)%08x (c0)%08x (c1)%08x %08x %08x\n", - "%s: Q%d: %08x %08x %08x %08x %08x %08x\n", - "%s: Qing U-APSD data frame for node %s \n", - "%s: %p<%s> refcnt %d\n", - "%s: tx queue %d (0x%x), link %p\n", - "%s: reaping U-APSD txq\n", - "%s: frame's last desc: %p\n", - "%s: frame in SP retried out, possible EOSP stranded!!!\n", - "Processing U-APSD txq for ath_buf with no node!\n", - "%s: EOSP detected for node (%s) on desc %p\n", - "%s: h/w assigned sequence number is not sane (%d), ignoring it\n", - "%s: updating frame's sequence number from %d to %d\n", - "%s: free skb %p\n", - "%s: free skb %p\n", - "%s: free skb %p\n", - "%s: tx tasklet restart the queue\n", - "%s: %sRUNNING %svalid\n", - "!", - "in", - "%s: tx queue [%u] 0x%x, link %p\n", - "%s: beacon queue 0x%x\n", - "ath_stoprecv: rx queue 0x%x, link %p\n", - "%s: mtu %u cachelsz %u rxbufsize %u\n", - "bogus channel %u/0x%x", - "%s: %u (%u MHz) -> %u (%u MHz)\n", - "%s: %s: unable to reset channel %u (%u MHz) ", - "flags 0x%x '%s' (HAL status %u)\n", - "%s: disabling interference mitigation (ANI)\n", - "%s: %s: unable to restart recv logic\n", - "%s: %s: start dfs wait period\n", - "%s: channel %u/%x\n", - "%s: calibration of channel %u failed\n", - "%s: unable to allocate channel table\n", - "%s: RX filter 0x%x bssid %s aid 0\n", - "%s: RX filter 0x%x bssid %s aid 0x%x\n", - "%s: %s: %s -> %s\n", - "%s: RX filter 0x%x bssid %s aid 0x%x\n", - "%s(RUN): ic_flags=0x%08x iv=%d bssid=%s ", - "capinfo=0x%04x chan=%d\n", - "%s: %s: VAP -> DFS_WAIT\n", - "%s: %s: VAP out of DFS_WAIT\n", - "%s: %s: VAP DFS_WAIT -> RUN\n", - "got invalid node key index 0x%x", - "got invalid vap def key index 0x%x", - "new node with a ucast key already setup (keyix %u)", - "%s: unable to allocate channel table\n", - "%s: unable to collect channel list from HAL; ", - "regdomain likely %u country code %u\n", - "%s: on %u off %u\n", - "%s: rate table too small (%u > %u)\n", - "%s: rate table too small (%u > %u)\n", - "%s: rate table too small (%u > %u)\n", - "%s: invalid mode %u\n", - "%s: rate table too small (%u > %u)\n", - "no h/w rate set for phy mode %u", - "%s: FF TxOp violation\n", - "R (%p %llx) %08x %08x %08x %08x %08x %08x %c\n", - "T (%p %llx) %08x %08x %08x %08x %08x %08x %08x %08x %c\n", - "%s: cannot set address; device running\n", - "%s: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", - "%s: invalid %d, min %u, max %u\n", - "%s: %d\n", - "slottime", - "acktimeout", - "ctstimeout", - "softled", - "ledpin", - "countrycode", - "maxvaps", - "regdomain", - "debug", - "txantenna", - "rxantenna", - "diversity", - "txintrperiod", - "fftxqmin", - "tkipmic", - "xrpollperiod", - "xrpollcount", - "ackrate", - "intmit", - "%s: no memory for sysctl table!\n", - "%s: no memory for device name storage!\n", - "dev", - "%s: failed to register sysctls!\n", - "%s: mac %d.%d phy %d.%d", - " 5 GHz radio %d.%d 2 GHz radio %d.%d", - " radio %d.%d", - " radio %d.%d", - "\n", - "%s: Use hw queue %u for %s traffic\n", - "%s: Use hw queue %u for CAB traffic\n", - "%s: Use hw queue %u for beacons\n", - "debug", - "countrycode", - "maxvaps", - "outdoor", - "xchanmode", - "calibrate", - "ath", - "dev" + "\"opt_ah.h\"", + "\"if_ethersubr.h\"", + "\"if_media.h\"", + "\"if_llc.h\"", + "\"net80211/if_athproto.h\"", + "\"if_athvar.h\"", + "\"ah_desc.h\"", + "\"ah_devid.h\"", + "\"if_ath_pci.h\"", + "\"if_ath_ahb.h\"", + "\"ath_tx99.h\"", + "\"No error\"", + "\"No hardware present or device not yet supported\"", + "\"Memory allocation failed\"", + "\"Hardware didn't respond as expected\"", + "\"EEPROM magic number invalid\"", + "\"EEPROM version invalid\"", + "\"EEPROM unreadable\"", + "\"EEPROM checksum invalid\"", + "\"EEPROM read problem\"", + "\"EEPROM mac address invalid\"", + "\"EEPROM size not supported\"", + "\"Attempt to change write-locked EEPROM\"", + "\"Invalid parameter to function\"", + "\"Hardware revision not supported\"", + "\"Hardware self-test failed\"", + "\"Operation incomplete\"", + "\"i\"", + "\"i\"", + "\"i\"", + "\"i\"", + "\"i\"", + "\"s\"", + "\"s\"", + "\"Override default country code\"", + "\"Maximum VAPs\"", + "\"Enable/disable outdoor use\"", + "\"Enable/disable extended channel mode\"", + "\"Enable/disable RFKILL capability\"", + "\"Create ath device in [sta|ap|wds|adhoc|ahdemo|monitor] mode. defaults to sta, use 'none' to disable\"", + "\"Rate control algorithm [amrr|minstrel|onoe|sample], defaults to '\"", + "\"'\"", + "\"i\"", + "\"Load-time debug output enable\"", + "\"%s: devid 0x%x\\n\"", + "\"%s: unable to attach hardware: '%s' (HAL status %u)\\n\"", + "\"%s: HAL ABI mismatch; \"", + "\"driver expects 0x%x, HAL reports 0x%x\\n\"", + "\"%s: Warning, using only %u entries in %u key cache\\n\"", + "\"ath_pci: switching rfkill capability %s\\n\"", + "\"on\"", + "\"off\"", + "\"%s: failed to allocate descriptors: %d\\n\"", + "\"%s: unable to setup a beacon xmit queue!\\n\"", + "\"%s: unable to setup CAB xmit queue!\\n\"", + "\"%s: unable to setup xmit queue for %s traffic!\\n\"", + "\"%s: unable to setup UAPSD xmit queue!\\n\"", + "\"%s: unable to register device\\n\"", + "\"%s: TX99 support enabled\\n\"", + "\"none\"", + "\"sta\"", + "\"ap\"", + "\"adhoc\"", + "\"ahdemo\"", + "\"wds\"", + "\"monitor\"", + "\"Unknown autocreate mode: %s\\n\"", + "\"ath%d\"", + "\"%s: autocreation of VAP failed: %d\\n\"", + "\"%s: flags %x\\n\"", + "\"too many virtual ap's (already got %d)\\n\"", + "\"beacon slot %u not empty?\"", + "\"Staggered beacons are not possible \"", + "\"with maxvaps set to %d.\\n\"", + "\"sc->stagbeacons %sabled\\n\"", + "\"en\"", + "\"dis\"", + "\"grppoll\"", + "\"%s:grppoll Buf allocation failed \\n\"", + "\"%s: %s: unable to start recv logic\\n\"", + "\"VAP not stopped\"", + "\"%s: %s: unable to start recv logic\\n\"", + "\"%s: flags %x\\n\"", + "\"%s: flags %x\\n\"", + "\"%s: no skbuff\\n\"", + "\"%s: U-APSD node (%s) has invalid keycache entry\\n\"", + "\"%s: Node (%s) became U-APSD triggerable (%d)\\n\"", + "\"%s: Node (%s) no longer U-APSD triggerable (%d)\\n\"", + "\"%s: U-APSD trigger detected for node (%s) on AC %d\\n\"", + "\"%s: SP already in progress - ignoring\\n\"", + "\"%s: dropped dup trigger, ac %d, seq %d\\n\"", + "\"%s: Queue empty, generating QoS NULL to send\\n\"", + "\"%s: flags 0x%x\\n\"", + "\"%s: status 0x%x\\n\"", + "\"%s: hardware error; resetting\\n\"", + "\"%s: rx FIFO overrun; resetting\\n\"", + "\"%s: ignored\\n\"", + "\"%s\\n\"", + "\"%s: mode %d\\n\"", + "\"%s: unable to reset hardware: '%s' (HAL status %u) \"", + "\"(freq %u flags 0x%x)\\n\"", + "\"%s: disabling interference mitigation (ANI)\\n\"", + "\"%s: unable to start recv logic\\n\"", + "\"%s: invalid %u flags 0x%x\\n\"", + "\"%s: %s: unable to reset hardware: '%s' (HAL status %u)\\n\"", + "\"%s: disabling interference mitigation (ANI)\\n\"", + "\"%s: %s: unable to start recv logic\\n\"", + "\"%s: txq depth = %d\\n\"", + "\"%s: link[%u](%p)=%llx (%p)\\n\"", + "\"%s: txq depth = %d\\n\"", + "\"%s: TXDP[%u] = %llx (%p)\\n\"", + "\"%s: link[%u] (%p)=%llx (%p)\\n\"", + "\"%s: skb %p [data %p len %u] skbaddr %llx\\n\"", + "\"no rate table, mode %u\"", + "\"%s: Q%d: %08x %08x %08x %08x %08x %08x\\n\"", + "\"no bf_ff on staging queue %p\"", + "\"%s: discard, encapsulation failure\\n\"", + "\"%s: stop queue\\n\"", + "\"%s: discard, no xmit buf\\n\"", + "\"%s: discard, invalid %d flags %x\\n\"", + "\"%s: discard, no node in cb\\n\"", + "\"%s: aggregating fast-frame\\n\"", + "\"%s: adding to fast-frame stage Q\\n\"", + "\"%s: discard, ff flush encap failure\\n\"", + "\"%s: ff stageq flush failure\\n\"", + "\"%s: Out-Of-Order fast-frame\\n\"", + "\"%s: discard, encapsulation failure\\n\"", + "\"%s: discard, invalid %d flags %x\\n\"", + "\"%s: stop queue\\n\"", + "\"ath_mgtstart: discard, no xmit buf\\n\"", + "\"WEP\"", + "\"AES-OCB\"", + "\"AES-CCM\"", + "\"CKIP\"", + "\"TKIP\"", + "\"CLR\"", + "\"%s: [%02u] %-7s \"", + "\"%02x\"", + "\" mac %s\"", + "\" %s \"", + "\"mic\"", + "\"rxmic\"", + "\"%02x\"", + "\" txmic \"", + "\"%02x\"", + "\"\\n\"", + "\"got a non-TKIP key, cipher %u\"", + "\"invalid cipher type %u\"", + "\"key cache !split\"", + "\"%s: key pair %u,%u %u,%u\\n\"", + "\"%s: out of pair space\\n\"", + "\"key cache split\"", + "\"%s: key pair %u,%u\\n\"", + "\"%s: out of pair space\\n\"", + "\"%s: key %u\\n\"", + "\"%s: out of space\\n\"", + "\"%s: bogus group key\\n\"", + "\"%s: delete key %u\\n\"", + "\"%s:\\n\"", + "\"%s:\\n\"", + "\"%s: RX filter 0x%x, MC filter %08x:%08x\\n\"", + "\"%s: Leaving turbo\\n\"", + "\"%s: Entering turbo\\n\"", + "\"unexpected operating mode %d\"", + "\"%s: dynamic turbo switch to %s mode\\n\"", + "\"turbo\"", + "\"base\"", + "\"%s: unable to update h/w beacon queue parameters\\n\"", + "\"%s: cannot get sk_buff\\n\"", + "\"%s: %s beacons, bslot %d intval %u tsfadjust(Kus) %llu\\n\"", + "\"stagger\"", + "\"burst\"", + "\"%s: m %p len %u\\n\"", + "\"%s: skip VAP in %s state\\n\"", + "\"%s: avp=%p av_bcbuf=%p\\n\"", + "\"%s: flush previous cabq traffic\\n\"", + "\"%s: missed %u consecutive beacons\\n\"", + "\"%s: resume beacon xmit after %u misses\\n\"", + "\"%s: slot %d [tsf %llu tsftu %u intval %u] vap %p\\n\"", + "\"%s: flip defant to %u, %u > %u\\n\"", + "\"%s: beacon queue %u did not stop?\\n\"", + "\"%s: stuck beacon; resetting (bmiss count %u)\\n\"", + "\"%s: avp=%p av_bcbuf=%p\\n\"", + "\"%s: TXDP%u = %llx (%p)\\n\"", + "\"%s: nexttbtt %u intval %u (%u)\\n\"", + "\"%s: tsf %llu tsf:tu %u intval %u nexttbtt %u dtim %u nextdtim %u bmiss %u sleep %u cfp:period %u maxdur %u next %u timoffset %u\\n\"", + "\"%s: %s DMA: %u buffers %u desc/buf\\n\"", + "\"%s: %s DMA map: %p (%lu) -> %llx (%lu)\\n\"", + "\"rx\"", + "\"tx\"", + "\"beacon\"", + "\"%s: an %p\\n\"", + "\"move data from NORMAL to XR\\n\"", + "\"moved %d buffers from NORMAL to XR\\n\"", + "\"move buffers from XR to NORMAL\\n\"", + "\"%s: link[%u](%p)=%p (%p)\\n\"", + "\"moved %d buffers from XR to NORMAL\\n\"", + "\"%s: skbuff alloc of size %u failed\\n\"", + "\"%s: skbuff alloc of size %u failed\\n\"", + "\"data padding not enabled?\"", + "\"%s:%d %s\\n\"", + "\"%s:%d %s\\n\"", + "\"ibss merge, rstamp %u tsf %llu \"", + "\"tstamp %llu\\n\"", + "\"%s\\n\"", + "\"%s: no buffer (%s)\\n\"", + "\"%s: no skbuff (%s)\\n\"", + "\"%s: runt packet %d\\n\"", + "\"%s: short packet %d\\n\"", + "\"%s: HAL qnum %u out of range, max %u!\\n\"", + "\"0.25\"", + "\".25\"", + "\"0.5\"", + "\".5\"", + "\"1\"", + "\"3\"", + "\"6\"", + "\"?\"", + "\"%s %s\"", + "\"%d\"", + "\"grppoll_start: grppoll Buf allocation failed\\n\"", + "\"%s: No more TxBufs\\n\"", + "\"%s: No more TxBufs left\\n\"", + "\"%s: HAL qnum %u out of range, max %u!\\n\"", + "\"%s: AC %u out of range, max %u!\\n\"", + "\"%s: unable to update hardware queue \"", + "\"parameters for %s traffic!\\n\"", + "\"%s: delivery Q empty, replacing with overflow Q\\n\"", + "\"%s: added AC %d frame to delivery Q, new depth = %d\\n\"", + "\"%s: delivery and overflow Qs full, dropped oldest\\n\"", + "\"%s: added AC %d to overflow Q, new depth = %d\\n\"", + "\"%s: skb %p [data %p len %u] skbaddr %llx\\n\"", + "\"%s: skb%d %p [data %p len %u] skbaddr %llx\\n\"", + "\"%s: skb%d %p [data %p len %u] skbaddr %llx\\n\"", + "\"no rate table, mode %u\"", + "\"%s: bogus frame type 0x%x (%s)\\n\"", + "\"cix not setup\"", + "\"%s: invalid TX rate %u (%s: %u)\\n\"", + "\"%s: set up txdesc: pktlen %d hdrlen %d \"", + "\"atype %d txpower %d txrate %d try0 %d keyix %d ant %d flags %x \"", + "\"ctsrate %d ctsdur %d icvlen %d ivlen %d comp %d\\n\"", + "\"%s: Q%d: %08x %08x %08x %08x %08x %08x\\n\"", + "\"%s: Q%d: (ds)%p (lk)%08x (d)%08x (c0)%08x (c1)%08x %08x %08x\\n\"", + "\"%s: Q%d: %08x %08x %08x %08x %08x %08x\\n\"", + "\"%s: Qing U-APSD data frame for node %s \\n\"", + "\"%s: %p<%s> refcnt %d\\n\"", + "\"%s: tx queue %d (0x%x), link %p\\n\"", + "\"%s: reaping U-APSD txq\\n\"", + "\"%s: frame's last desc: %p\\n\"", + "\"%s: frame in SP retried out, possible EOSP stranded!!!\\n\"", + "\"Processing U-APSD txq for ath_buf with no node!\\n\"", + "\"%s: EOSP detected for node (%s) on desc %p\\n\"", + "\"%s: h/w assigned sequence number is not sane (%d), ignoring it\\n\"", + "\"%s: updating frame's sequence number from %d to %d\\n\"", + "\"%s: free skb %p\\n\"", + "\"%s: free skb %p\\n\"", + "\"%s: free skb %p\\n\"", + "\"%s: tx tasklet restart the queue\\n\"", + "\"%s: %sRUNNING %svalid\\n\"", + "\"\"", + "\"!\"", + "\"in\"", + "\"\"", + "\"%s: tx queue [%u] 0x%x, link %p\\n\"", + "\"%s: beacon queue 0x%x\\n\"", + "\"ath_stoprecv: rx queue 0x%x, link %p\\n\"", + "\"%s: mtu %u cachelsz %u rxbufsize %u\\n\"", + "\"bogus channel %u/0x%x\"", + "\"%s: %u (%u MHz) -> %u (%u MHz)\\n\"", + "\"%s: %s: unable to reset channel %u (%u MHz) \"", + "\"flags 0x%x '%s' (HAL status %u)\\n\"", + "\"%s: disabling interference mitigation (ANI)\\n\"", + "\"%s: %s: unable to restart recv logic\\n\"", + "\"%s: %s: start dfs wait period\\n\"", + "\"%s: channel %u/%x\\n\"", + "\"%s: calibration of channel %u failed\\n\"", + "\"%s: unable to allocate channel table\\n\"", + "\"%s: RX filter 0x%x bssid %s aid 0\\n\"", + "\"%s: RX filter 0x%x bssid %s aid 0x%x\\n\"", + "\"%s: %s: %s -> %s\\n\"", + "\"%s: RX filter 0x%x bssid %s aid 0x%x\\n\"", + "\"%s(RUN): ic_flags=0x%08x iv=%d bssid=%s \"", + "\"capinfo=0x%04x chan=%d\\n\"", + "\"%s: %s: VAP -> DFS_WAIT\\n\"", + "\"%s: %s: VAP out of DFS_WAIT\\n\"", + "\"%s: %s: VAP DFS_WAIT -> RUN\\n\"", + "\"got invalid node key index 0x%x\"", + "\"got invalid vap def key index 0x%x\"", + "\"new node with a ucast key already setup (keyix %u)\"", + "\"%s: unable to allocate channel table\\n\"", + "\"%s: unable to collect channel list from HAL; \"", + "\"regdomain likely %u country code %u\\n\"", + "\"%s: on %u off %u\\n\"", + "\"%s: rate table too small (%u > %u)\\n\"", + "\"%s: rate table too small (%u > %u)\\n\"", + "\"%s: rate table too small (%u > %u)\\n\"", + "\"%s: invalid mode %u\\n\"", + "\"%s: rate table too small (%u > %u)\\n\"", + "\"no h/w rate set for phy mode %u\"", + "\"%s: FF TxOp violation\\n\"", + "\"R (%p %llx) %08x %08x %08x %08x %08x %08x %c\\n\"", + "\"T (%p %llx) %08x %08x %08x %08x %08x %08x %08x %08x %c\\n\"", + "\"%s: cannot set address; device running\\n\"", + "\"%s: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\\n\"", + "\"%s: invalid %d, min %u, max %u\\n\"", + "\"%s: %d\\n\"", + "\"slottime\"", + "\"acktimeout\"", + "\"ctstimeout\"", + "\"softled\"", + "\"ledpin\"", + "\"countrycode\"", + "\"maxvaps\"", + "\"regdomain\"", + "\"debug\"", + "\"txantenna\"", + "\"rxantenna\"", + "\"diversity\"", + "\"txintrperiod\"", + "\"fftxqmin\"", + "\"tkipmic\"", + "\"xrpollperiod\"", + "\"xrpollcount\"", + "\"ackrate\"", + "\"intmit\"", + "\"%s: no memory for sysctl table!\\n\"", + "\"%s: no memory for device name storage!\\n\"", + "\"dev\"", + "\"%s: failed to register sysctls!\\n\"", + "\"%s: mac %d.%d phy %d.%d\"", + "\" 5 GHz radio %d.%d 2 GHz radio %d.%d\"", + "\" radio %d.%d\"", + "\" radio %d.%d\"", + "\"\\n\"", + "\"%s: Use hw queue %u for %s traffic\\n\"", + "\"%s: Use hw queue %u for CAB traffic\\n\"", + "\"%s: Use hw queue %u for beacons\\n\"", + "\"debug\"", + "\"countrycode\"", + "\"maxvaps\"", + "\"outdoor\"", + "\"xchanmode\"", + "\"calibrate\"", + "\"ath\"", + "\"dev\"", + "\"\"" ], "scan_errors": [] } diff --git a/tests/data/symbols_tree_sitter/test3.cpp-expected.json b/tests/data/symbols_tree_sitter/test3.cpp-expected.json index 7b71241..c544035 100644 --- a/tests/data/symbols_tree_sitter/test3.cpp-expected.json +++ b/tests/data/symbols_tree_sitter/test3.cpp-expected.json @@ -422,36 +422,36 @@ "amapidx" ], "source_strings": [ - "stacktrace.h", - "lhn_defines.h", - "/proc/%d/maps", - "ro", - "%", - "x", - "%", - "x", - "/usr/bin/addr2line --functions -C -e %s 0x%", - "x", - "/usr/bin/addr2line --functions -C -e /proc/%d/exe 0x%", - "x", - "r", - "??:0", - "??", - "/usr/bin/addr2line --functions -C -e %s 0x%", - "x", - "/usr/bin/addr2line --functions -C -e /proc/%d/exe 0x%", - "x", - "r", - "sigaction.c:149", - "__pthread_sighandler", - "__restore", - "%s %s", - "??:0 ??", - "STACKTRACE:dump\n", - " frame=%02d pc=0x%0*", - "x %s\n", - " frame=%02d pc=0x%0*", - "x unknown\n" + "\"stacktrace.h\"", + "\"lhn_defines.h\"", + "\"/proc/%d/maps\"", + "\"ro\"", + "\"%\"", + "\"x\"", + "\"%\"", + "\"x\"", + "\"/usr/bin/addr2line --functions -C -e %s 0x%\"", + "\"x\"", + "\"/usr/bin/addr2line --functions -C -e /proc/%d/exe 0x%\"", + "\"x\"", + "\"r\"", + "\"??:0\"", + "\"??\"", + "\"/usr/bin/addr2line --functions -C -e %s 0x%\"", + "\"x\"", + "\"/usr/bin/addr2line --functions -C -e /proc/%d/exe 0x%\"", + "\"x\"", + "\"r\"", + "\"sigaction.c:149\"", + "\"__pthread_sighandler\"", + "\"__restore\"", + "\"%s %s\"", + "\"??:0 ??\"", + "\"STACKTRACE:dump\\n\"", + "\" frame=%02d pc=0x%0*\"", + "\"x %s\\n\"", + "\" frame=%02d pc=0x%0*\"", + "\"x unknown\\n\"" ], "scan_errors": [] }