mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
css: lower case parse function
This commit is contained in:
@@ -5,13 +5,13 @@ const std = @import("std");
|
|||||||
const Selector = @import("selector.zig").Selector;
|
const Selector = @import("selector.zig").Selector;
|
||||||
const parser = @import("parser.zig");
|
const parser = @import("parser.zig");
|
||||||
|
|
||||||
// Parse parse a selector string and returns the parsed result or an error.
|
// parse parse a selector string and returns the parsed result or an error.
|
||||||
pub fn Parse(alloc: std.mem.Allocator, s: []const u8, opts: parser.ParseOptions) parser.ParseError!Selector {
|
pub fn parse(alloc: std.mem.Allocator, s: []const u8, opts: parser.ParseOptions) parser.ParseError!Selector {
|
||||||
var p = parser.Parser{ .s = s, .i = 0, .opts = opts };
|
var p = parser.Parser{ .s = s, .i = 0, .opts = opts };
|
||||||
return p.parse(alloc);
|
return p.parse(alloc);
|
||||||
}
|
}
|
||||||
|
|
||||||
test "Parse" {
|
test "parse" {
|
||||||
const alloc = std.testing.allocator;
|
const alloc = std.testing.allocator;
|
||||||
|
|
||||||
const testcases = [_][]const u8{
|
const testcases = [_][]const u8{
|
||||||
@@ -118,7 +118,7 @@ test "Parse" {
|
|||||||
};
|
};
|
||||||
|
|
||||||
for (testcases) |tc| {
|
for (testcases) |tc| {
|
||||||
const s = Parse(alloc, tc, .{}) catch |e| {
|
const s = parse(alloc, tc, .{}) catch |e| {
|
||||||
std.debug.print("query {s}", .{tc});
|
std.debug.print("query {s}", .{tc});
|
||||||
return e;
|
return e;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user