From a1471b67fb65d9c6d90e3127a8ccf8c9b9b0694f Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 30 Jan 2021 17:50:58 -0500 Subject: [PATCH] CLI2: Do not attempt to evaluate values of string attributes --- src/CLI2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CLI2.cpp b/src/CLI2.cpp index f67461915..807bdaf67 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -1270,7 +1270,9 @@ void CLI2::desugarFilterAttributes () A2 op ("", Lexer::Type::op); op.tag ("FILTER"); - A2 rhs ("", values[0]._lextype); + // Attribute types that do not support evaluation should be interpreted + // as strings (currently this means that string attributes are not evaluated) + A2 rhs ("", evalSupported ? values[0]._lextype: Lexer::Type::string); rhs.tag ("FILTER"); // Special case for ':'. @@ -1364,7 +1366,7 @@ void CLI2::desugarFilterAttributes () // Do not modify this construct without full understanding. // Getting this wrong breaks a whole lot of filtering tests. - if (values.size () > 1 || evalSupported) + if (evalSupported) { for (auto& v : values) reconstructed.push_back (v);