This commit is contained in:
pfg
2025-03-31 15:23:11 -07:00
parent 6bfce0799a
commit 9052872a03
3 changed files with 19 additions and 18 deletions

View File

@@ -1697,15 +1697,15 @@ pub fn TopLevelRuleParser(comptime AtRuleParserT: type) type {
const layer: ?struct { value: ?LayerName } =
if (input.tryParse(Parser.expectIdentMatching, .{"layer"}) == .result)
.{ .value = null }
else if (input.tryParse(Parser.expectFunctionMatching, .{"layer"}) == .result) brk: {
break :brk .{
.value = switch (input.parseNestedBlock(LayerName, {}, voidWrap(LayerName, LayerName.parse))) {
.result => |v| v,
.err => |e| return .{ .err = e },
},
};
} else null;
.{ .value = null }
else if (input.tryParse(Parser.expectFunctionMatching, .{"layer"}) == .result) brk: {
break :brk .{
.value = switch (input.parseNestedBlock(LayerName, {}, voidWrap(LayerName, LayerName.parse))) {
.result => |v| v,
.err => |e| return .{ .err = e },
},
};
} else null;
const supports = if (input.tryParse(Parser.expectFunctionMatching, .{"supports"}) == .result) brk: {
const Func = struct {
@@ -4710,11 +4710,12 @@ pub const nth = struct {
if (bytes.len >= 3 and
bun.strings.eqlCaseInsensitiveASCIIICheckLength(bytes[0..2], "n-") and
brk: {
for (bytes[2..]) |b| {
if (b < '0' or b > '9') break :brk false;
}
break :brk true;
}) {
for (bytes[2..]) |b| {
if (b < '0' or b > '9') break :brk false;
}
break :brk true;
})
{
return parse_number_saturate(allocator, str[1..]); // Include the minus sign
} else {
return .{ .err = {} };

View File

@@ -7680,7 +7680,7 @@ pub const Scope = struct {
if (Symbol.isKindHoistedOrFunction(new) and
Symbol.isKindHoistedOrFunction(existing) and
(scope.kind == .entry or scope.kind == .function_body or scope.kind == .function_args or
(new == existing and Symbol.isKindHoisted(existing))))
(new == existing and Symbol.isKindHoisted(existing))))
{
return .replace_with_new;
}

View File

@@ -1735,9 +1735,9 @@ fn NewLexer_(
// Omit the trailing "*/" from the checks below
const end_comment_text =
if (is_multiline_comment)
text.len - 2
else
text.len;
text.len - 2
else
text.len;
if (has_legal_annotation or lexer.preserve_all_comments_before) {
if (is_multiline_comment) {