captureFieldValues: each `field: value` entry of a struct literal.
(tokens: &[Node<'t>], src: &'t str, out: &mut Vec<MacroRef<'t>>)
| 2031 | |
| 2032 | /// captureFieldValues: each `field: value` entry of a struct literal. |
| 2033 | fn macro_capture_field_values<'t>(tokens: &[Node<'t>], src: &'t str, out: &mut Vec<MacroRef<'t>>) { |
| 2034 | let mut from = 0usize; |
| 2035 | for i in 0..=tokens.len() { |
| 2036 | if i < tokens.len() && tokens[i].kind() != "," { |
| 2037 | continue; |
| 2038 | } |
| 2039 | if i >= from + 3 && tokens[from + 1].kind() == ":" { |
| 2040 | let field = tokens[from]; |
| 2041 | if macro_is_name(Some(&field), src) || field.kind() == "integer_literal" { |
| 2042 | macro_capture_value(tokens, from + 2, i, src, out); |
| 2043 | } |
| 2044 | } |
| 2045 | from = i + 1; |
| 2046 | } |
| 2047 | } |
| 2048 | |
| 2049 | /// captureValue: `tokens[from..to)` as a function value — an identifier |
| 2050 | /// alone, or a path alone whose last segment is written like a function's |
no test coverage detected