CSS: More stuff and tests (#14832)

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
This commit is contained in:
Zack Radisic
2024-10-27 13:49:25 -07:00
committed by GitHub
parent f005e8c057
commit 5502278f3e
71 changed files with 68353 additions and 887 deletions

View File

@@ -4397,7 +4397,7 @@ pub fn trimLeadingChar(slice: []const u8, char: u8) []const u8 {
/// e.g.
/// `trimLeadingPattern2("abcdef", 'a', 'b') == "cdef"`
pub fn trimLeadingPattern2(slice_: []const u8, comptime byte1: u8, comptime byte2: u8) []const u8 {
const pattern: u16 = comptime @as(u16, byte1) << 8 | @as(u16, byte2);
const pattern: u16 = comptime @as(u16, byte2) << 8 | @as(u16, byte1);
var slice = slice_;
while (slice.len >= 2) {
const sliceu16: [*]const u16 = @ptrCast(@alignCast(slice.ptr));