MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / macro_capture_values

Function macro_capture_values

codegraph-kernel/src/rustlang.rs:2016–2030  ·  view source on GitHub ↗

captureValues: the function values among a call's arguments or a list's elements. A list (`list`) ends at the `;` of `[f; 3]`: what follows is its length.

(tokens: &[Node<'t>], list: bool, src: &'t str, out: &mut Vec<MacroRef<'t>>)

Source from the content-addressed store, hash-verified

2014/// elements. A list (`list`) ends at the `;` of `[f; 3]`: what follows is its
2015/// length.
2016fn macro_capture_values<'t>(tokens: &[Node<'t>], list: bool, src: &'t str, out: &mut Vec<MacroRef<'t>>) {
2017 let mut from = 0usize;
2018 for i in 0..=tokens.len() {
2019 let ty = if i < tokens.len() { tokens[i].kind() } else { "," };
2020 let length = list && ty == ";";
2021 if ty != "," && !length {
2022 continue;
2023 }
2024 macro_capture_value(tokens, from, i, src, out);
2025 if length {
2026 break;
2027 }
2028 from = i + 1;
2029 }
2030}
2031
2032/// captureFieldValues: each `field: value` entry of a struct literal.
2033fn macro_capture_field_values<'t>(tokens: &[Node<'t>], src: &'t str, out: &mut Vec<MacroRef<'t>>) {

Callers 2

macro_scan_macroFunction · 0.85
macro_parse_chainFunction · 0.85

Calls 2

macro_capture_valueFunction · 0.85
lenMethod · 0.80

Tested by

no test coverage detected