mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
zig fmt
This commit is contained in:
@@ -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 = {} };
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user