srctree

Robin Linden parent 62992f97 9538986a
html: Merge the simplified parse api into parser.h

parse.h was added back when parser.h held a header-only HTML parser, buteven then it was a bit of a premature compile-time optimization.

inlinesplit
engine/engine.cpp added: 14, removed: 49, total 0
@@ -6,7 +6,7 @@
 
#include "css/default.h"
#include "css/parser.h"
#include "html/parse.h"
#include "html/parser.h"
#include "style/style.h"
 
#include <spdlog/spdlog.h>
 
html/BUILD added: 14, removed: 49, total 0
@@ -3,14 +3,8 @@ load("//bzl:copts.bzl", "HASTUR_COPTS")
 
cc_library(
name = "html",
srcs = [
"parse.cpp",
"parser.cpp",
],
hdrs = [
"parse.h",
"parser.h",
],
srcs = ["parser.cpp"],
hdrs = ["parser.h"],
copts = HASTUR_COPTS,
visibility = ["//visibility:public"],
deps = [
 
ev/null added: 14, removed: 49, total 0
@@ -1,15 +0,0 @@
// SPDX-FileCopyrightText: 2021 Robin Lindén <dev@robinlinden.eu>
//
// SPDX-License-Identifier: BSD-2-Clause
 
#include "html/parse.h"
 
#include "html/parser.h"
 
namespace html {
 
dom::Document parse(std::string_view input) {
return Parser::parse_document(input);
}
 
} // namespace html
 
ev/null added: 14, removed: 49, total 0
@@ -1,18 +0,0 @@
// SPDX-FileCopyrightText: 2021 Robin Lindén <dev@robinlinden.eu>
//
// SPDX-License-Identifier: BSD-2-Clause
 
#ifndef HTML_PARSE_H_
#define HTML_PARSE_H_
 
#include "dom/dom.h"
 
#include <string_view>
 
namespace html {
 
dom::Document parse(std::string_view input);
 
} // namespace html
 
#endif
 
html/parser.h added: 14, removed: 49, total 0
@@ -47,4 +47,8 @@ private:
bool seen_html_tag_{false};
};
 
inline dom::Document parse(std::string_view input) {
return Parser::parse_document(input);
}
 
} // namespace html
 
html/parser_test.cpp added: 14, removed: 49, total 0
@@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: BSD-2-Clause
 
#include "html/parse.h"
#include "html/parser.h"
 
#include "etest/etest.h"