Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

Tweak comment wording

+10 -7
+9 -5
compiler-core/src/exhaustiveness.rs
··· 2871 2871 2872 2872 fn segment_matched_value( 2873 2873 segment: &TypedPatternBitArraySegment, 2874 - // Override for the segment pattern, if we need to determine the value of 2875 - // an assignment segment. 2874 + // If we are compiling an assignment pattern, we still need access to the 2875 + // `type_` and `options` fields of the `segment`, so we must still pass that 2876 + // in above. However, we need to check the correct sub-pattern of the original 2877 + // pattern, so if they are different we set this argument to `Some`. 2876 2878 pattern: Option<&TypedPattern>, 2877 2879 ) -> BitArrayMatchedValue { 2878 2880 let pattern = pattern.unwrap_or(&segment.value); ··· 2908 2910 fn segment_size( 2909 2911 segment: &TypedPatternBitArraySegment, 2910 2912 pattern_variables: &HashMap<EcoString, ReadAction>, 2911 - // Override for the segment pattern, if we need to determine the size of an 2912 - // assignment segment. 2913 + // If we are compiling an assignment pattern, we still need access to the 2914 + // `type_` and `options` fields of the `segment`, so we must still pass that 2915 + // in above. However, we need to check the correct sub-pattern of the original 2916 + // pattern, so if they are different we set this argument to `Some`. 2913 2917 pattern: Option<&TypedPattern>, 2914 2918 ) -> ReadSize { 2915 2919 let pattern = pattern.unwrap_or(&segment.value); ··· 2955 2959 ) 2956 2960 } 2957 2961 ast::Pattern::String { value, .. } if segment.has_utf32_option() => { 2958 - // Each utf32 codepoint is 32 bits 2962 + // Each utf32 code unit is 32 bits 2959 2963 ReadSize::ConstantBits( 2960 2964 length_utf32(&convert_string_escape_chars(value)) * BigInt::from(32), 2961 2965 )
+1 -2
compiler-core/src/strings.rs
··· 161 161 length 162 162 } 163 163 164 - /// Gets the number of UTF-32 codepoints in a string (also known as the number of 165 - /// characters). 164 + /// Gets the number of UTF-32 codepoints in a string 166 165 pub fn length_utf32(string: &str) -> usize { 167 166 string.chars().count() 168 167 }