diff --git a/lix/libexpr/eval.cc b/lix/libexpr/eval.cc index 762e2827d..34a0cb678 100644 --- a/lix/libexpr/eval.cc +++ b/lix/libexpr/eval.cc @@ -1965,7 +1965,7 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v) NixInt n{0}; NixFloat nf = 0; - bool first = !forceString; + bool first = !isInterpolation; ValueType firstType = nString; const auto str = [&] { diff --git a/lix/libexpr/nixexpr.cc b/lix/libexpr/nixexpr.cc index 14e30a934..484114764 100644 --- a/lix/libexpr/nixexpr.cc +++ b/lix/libexpr/nixexpr.cc @@ -273,7 +273,7 @@ JSON ExprConcatStrings::toJSON(const SymbolTable & symbols) const parts.push_back(part->toJSON(symbols)); return { {"_type", "ExprConcatStrings"}, - {"forceString", forceString}, + {"isInterpolation", isInterpolation}, {"es", parts} }; } diff --git a/lix/libexpr/nixexpr.hh b/lix/libexpr/nixexpr.hh index 0adea91bb..b15806a88 100644 --- a/lix/libexpr/nixexpr.hh +++ b/lix/libexpr/nixexpr.hh @@ -572,10 +572,10 @@ MakeBinOp(ExprOpConcatLists, "++") struct ExprConcatStrings : Expr { - bool forceString; + bool isInterpolation; std::vector>> es; - ExprConcatStrings(const PosIdx & pos, bool forceString, std::vector>> es) - : Expr(pos), forceString(forceString), es(std::move(es)) { }; + ExprConcatStrings(const PosIdx & pos, bool isInterpolation, std::vector>> es) + : Expr(pos), isInterpolation(isInterpolation), es(std::move(es)) { }; JSON toJSON(const SymbolTable & symbols) const override; void eval(EvalState & state, Env & env, Value & v) override; void accept(ExprVisitor & ev, std::unique_ptr & ptr) override { ev.visit(*this, ptr); } diff --git a/tests/functional/lang/parse-okay-1.exp b/tests/functional/lang/parse-okay-1.exp index 8650b88bc..ca00a8379 100644 --- a/tests/functional/lang/parse-okay-1.exp +++ b/tests/functional/lang/parse-okay-1.exp @@ -8,10 +8,10 @@ body: value: x - _type: ExprVar value: y - forceString: false + isInterpolation: false - _type: ExprVar value: z - forceString: false + isInterpolation: false formals: x: null y: null diff --git a/tests/functional/lang/parse-okay-arithmetic.exp b/tests/functional/lang/parse-okay-arithmetic.exp index 4c36b3f34..7ab9039bb 100644 --- a/tests/functional/lang/parse-okay-arithmetic.exp +++ b/tests/functional/lang/parse-okay-arithmetic.exp @@ -32,7 +32,7 @@ args: fun: _type: ExprVar value: __div - forceString: false + isInterpolation: false - _type: ExprLiteral value: 1 valueType: Int diff --git a/tests/functional/lang/parse-okay-ind-string.exp b/tests/functional/lang/parse-okay-ind-string.exp index 833fce0fa..a88cfcbfd 100644 --- a/tests/functional/lang/parse-okay-ind-string.exp +++ b/tests/functional/lang/parse-okay-ind-string.exp @@ -115,7 +115,7 @@ attrs: - _type: ExprLiteral value: /lib/modules/dri valueType: String - forceString: true + isInterpolation: true then: _type: ExprConcatStrings es: @@ -128,7 +128,7 @@ attrs: - _type: ExprLiteral value: /X11R6/lib/modules/drivers/ valueType: String - forceString: true + isInterpolation: true - _type: ExprLiteral value: " \n\nexec " valueType: String @@ -140,7 +140,7 @@ attrs: ' valueType: String - forceString: true + isInterpolation: true s14: _type: ExprLiteral value: "Escaping of ' followed by ': ''\nEscaping of $ followed by {: ${\nAnd\ @@ -170,7 +170,7 @@ attrs: ' valueType: String - forceString: true + isInterpolation: true s16: _type: ExprLiteral value: 'cut -d $''\t'' -f 1 @@ -188,13 +188,13 @@ attrs: - _type: ExprLiteral value: $ valueType: String - forceString: false + isInterpolation: false - _type: ExprLiteral value: ' ' valueType: String - forceString: false + isInterpolation: false s18: _type: ExprLiteral value: " Lines without any indentation effectively disable the indentation\n\ @@ -255,7 +255,7 @@ attrs: ' valueType: String - forceString: true + isInterpolation: true s5: _type: ExprConcatStrings es: @@ -284,7 +284,7 @@ attrs: ' valueType: String - forceString: true + isInterpolation: true s6: _type: ExprLiteral value: " Tabs are not interpreted as whitespace (since we can't guess\n what\ @@ -316,7 +316,7 @@ attrs: ' valueType: String - forceString: true + isInterpolation: true s9: _type: ExprConcatStrings es: @@ -327,7 +327,7 @@ attrs: value: " Similarly you can force an indentation level,\n in this case to\ \ 2 spaces. This works because the anti-quote\n is significant (not whitespace).\n" valueType: String - forceString: true + isInterpolation: true body: _type: ExprConcatStrings es: @@ -373,61 +373,61 @@ body: value: s1 - _type: ExprVar value: s2 - forceString: false + isInterpolation: false - _type: ExprVar value: s3 - forceString: false + isInterpolation: false - _type: ExprVar value: s4 - forceString: false + isInterpolation: false - _type: ExprVar value: s5 - forceString: false + isInterpolation: false - _type: ExprVar value: s6 - forceString: false + isInterpolation: false - _type: ExprVar value: s7 - forceString: false + isInterpolation: false - _type: ExprVar value: s8 - forceString: false + isInterpolation: false - _type: ExprVar value: s9 - forceString: false + isInterpolation: false - _type: ExprVar value: s10 - forceString: false + isInterpolation: false - _type: ExprVar value: s11 - forceString: false + isInterpolation: false - _type: ExprVar value: s12 - forceString: false + isInterpolation: false - _type: ExprVar value: s13 - forceString: false + isInterpolation: false - _type: ExprVar value: s14 - forceString: false + isInterpolation: false - _type: ExprVar value: s15 - forceString: false + isInterpolation: false - _type: ExprVar value: s16 - forceString: false + isInterpolation: false - _type: ExprVar value: s17 - forceString: false + isInterpolation: false - _type: ExprVar value: s18 - forceString: false + isInterpolation: false - _type: ExprVar value: s19 - forceString: false + isInterpolation: false - _type: ExprVar value: s20 - forceString: false + isInterpolation: false - _type: ExprVar value: s21 - forceString: false + isInterpolation: false diff --git a/tests/functional/lang/parse-okay-json.exp b/tests/functional/lang/parse-okay-json.exp index 42f567520..1a7b59432 100644 --- a/tests/functional/lang/parse-okay-json.exp +++ b/tests/functional/lang/parse-okay-json.exp @@ -95,7 +95,7 @@ body: - _type: ExprLiteral value: '' valueType: String - forceString: false + isInterpolation: false value: _type: ExprVar value: 'null' @@ -171,7 +171,7 @@ body: - _type: ExprLiteral value: '' valueType: String - forceString: false + isInterpolation: false value: _type: ExprVar value: 'null' @@ -401,7 +401,7 @@ body: fun: _type: ExprVar value: __div - forceString: false + isInterpolation: false - _type: ExprLiteral value: 1 valueType: Int @@ -428,7 +428,7 @@ body: fun: _type: ExprVar value: __sub - forceString: false + isInterpolation: false - _type: ExprCall args: - _type: ExprLiteral @@ -448,7 +448,7 @@ body: fun: _type: ExprVar value: __sub - forceString: false + isInterpolation: false - _type: ExprCall args: - _type: ExprLiteral @@ -459,7 +459,7 @@ body: fun: _type: ExprVar value: __sub - forceString: false + isInterpolation: false - _type: ExprIf cond: _type: ExprOpImpl @@ -581,17 +581,17 @@ body: - _type: ExprLiteral value: 2 valueType: Int - forceString: false + isInterpolation: false - _type: ExprLiteral value: 3 valueType: Int - forceString: false + isInterpolation: false - _type: ExprConcatStrings es: - _type: ExprLiteral value: '' valueType: String - forceString: true + isInterpolation: true - _type: ExprConcatStrings es: - _type: ExprLiteral @@ -605,6 +605,6 @@ body: - _type: ExprLiteral value: '2' valueType: String - forceString: false - forceString: true + isInterpolation: false + isInterpolation: true - _type: ExprPos diff --git a/tests/functional/lang/parse-okay-rec-set-override-warning.exp b/tests/functional/lang/parse-okay-rec-set-override-warning.exp index 1046e7a78..2d1ea55cc 100644 --- a/tests/functional/lang/parse-okay-rec-set-override-warning.exp +++ b/tests/functional/lang/parse-okay-rec-set-override-warning.exp @@ -33,7 +33,7 @@ elems: - _type: ExprLiteral value: '' valueType: String - forceString: false + isInterpolation: false value: _type: ExprSet recursive: false diff --git a/tests/functional/lang/parse-okay-regression-751.exp b/tests/functional/lang/parse-okay-regression-751.exp index b54e36f7f..ea727b43a 100644 --- a/tests/functional/lang/parse-okay-regression-751.exp +++ b/tests/functional/lang/parse-okay-regression-751.exp @@ -22,4 +22,4 @@ body: fun: _type: ExprVar value: const - forceString: true + isInterpolation: true