libexpr: Deprecate URL literals

Closes #437.

Change-Id: I9f67fc965bb4a7e7fd849e5067ac1cb3bab064cd
This commit is contained in:
piegames
2024-08-17 20:31:57 +02:00
parent 49d61b2e4b
commit 278fddc317
10 changed files with 44 additions and 17 deletions
+3 -3
View File
@@ -656,10 +656,10 @@ template<> struct BuildAST<grammar::expr::path> : p::maybe_nothing {};
template<> struct BuildAST<grammar::expr::uri> {
static void apply(const auto & in, ExprState & s, State & ps) {
bool noURLLiterals = ps.featureSettings.isEnabled(Xp::NoUrlLiterals);
if (noURLLiterals)
bool URLLiterals = ps.featureSettings.isEnabled(Dep::UrlLiterals);
if (!URLLiterals)
throw ParseError({
.msg = HintFmt("URL literals are disabled"),
.msg = HintFmt("URL literals are deprecated, allow using them with --extra-deprecated-features=url-literals"),
.pos = ps.positions[ps.at(in)]
});
s.pushExpr<ExprString>(ps.at(in), in.string());