aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/parser/parser.cc
diff options
context:
space:
mode:
authorpiegames <git@piegames.de>2024-08-18 17:28:37 +0200
committerpiegames <git@piegames.de>2024-08-21 12:59:03 +0200
commit0edfea450b90ab5843c1fb898bd9343c881bc4ad (patch)
treeb3584a640364c07b6189c3b320fdd1de6862bc40 /src/libexpr/parser/parser.cc
parent0a8888d1c7220eddba40895a9c6c63d06edf4614 (diff)
libexpr: Soft-deprecate ancient let syntax
Change-Id: I6802b26f038578870ea1fa1ed298f0c4b1f29c4a
Diffstat (limited to 'src/libexpr/parser/parser.cc')
-rw-r--r--src/libexpr/parser/parser.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libexpr/parser/parser.cc b/src/libexpr/parser/parser.cc
index 6e8ab2fe4..17463056c 100644
--- a/src/libexpr/parser/parser.cc
+++ b/src/libexpr/parser/parser.cc
@@ -668,6 +668,16 @@ template<> struct BuildAST<grammar::expr::uri> {
template<> struct BuildAST<grammar::expr::ancient_let> : change_head<BindingsState> {
static void success(const auto & in, BindingsState & b, ExprState & s, State & ps) {
+ // Added 2024-09-18. Turn into an error at some point in the future.
+ // See the documentation on deprecated features for more details.
+ if (!ps.featureSettings.isEnabled(Dep::AncientLet))
+ warn(
+ "%s found at %s. This feature is deprecated and will be removed in the future. Use %s to silence this warning.",
+ "let {",
+ ps.positions[ps.at(in)],
+ "--extra-deprecated-features ancient-let"
+ );
+
b.attrs.pos = ps.at(in);
b.attrs.recursive = true;
s.pushExpr<ExprSelect>(b.attrs.pos, b.attrs.pos, std::make_unique<ExprAttrs>(std::move(b.attrs)), ps.s.body);