···2871287128722872fn segment_matched_value(
28732873 segment: &TypedPatternBitArraySegment,
28742874- // Override for the segment pattern, if we need to determine the value of
28752875- // an assignment segment.
28742874+ // If we are compiling an assignment pattern, we still need access to the
28752875+ // `type_` and `options` fields of the `segment`, so we must still pass that
28762876+ // in above. However, we need to check the correct sub-pattern of the original
28772877+ // pattern, so if they are different we set this argument to `Some`.
28762878 pattern: Option<&TypedPattern>,
28772879) -> BitArrayMatchedValue {
28782880 let pattern = pattern.unwrap_or(&segment.value);
···29082910fn segment_size(
29092911 segment: &TypedPatternBitArraySegment,
29102912 pattern_variables: &HashMap<EcoString, ReadAction>,
29112911- // Override for the segment pattern, if we need to determine the size of an
29122912- // assignment segment.
29132913+ // If we are compiling an assignment pattern, we still need access to the
29142914+ // `type_` and `options` fields of the `segment`, so we must still pass that
29152915+ // in above. However, we need to check the correct sub-pattern of the original
29162916+ // pattern, so if they are different we set this argument to `Some`.
29132917 pattern: Option<&TypedPattern>,
29142918) -> ReadSize {
29152919 let pattern = pattern.unwrap_or(&segment.value);
···29552959 )
29562960 }
29572961 ast::Pattern::String { value, .. } if segment.has_utf32_option() => {
29582958- // Each utf32 codepoint is 32 bits
29622962+ // Each utf32 code unit is 32 bits
29592963 ReadSize::ConstantBits(
29602964 length_utf32(&convert_string_escape_chars(value)) * BigInt::from(32),
29612965 )
···161161 length
162162}
163163164164-/// Gets the number of UTF-32 codepoints in a string (also known as the number of
165165-/// characters).
164164+/// Gets the number of UTF-32 codepoints in a string
166165pub fn length_utf32(string: &str) -> usize {
167166 string.chars().count()
168167}