![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
#include <parser-state.hh>
Public Member Functions | |
| ToBeStringyExpr (std::string_view v) | |
| ToBeStringyExpr (Expr *expr) | |
| template<class F> | |
| void | visit (const F &f) |
| Expr * | toExpr (Exprs &exprs) |
This represents a string-like parse that possibly has yet to be constructed.
Examples: "foo" ${"foo" + "bar"} "foo.bar" "foo-${a}"
Using this type allows us to avoid construction altogether in cases where what we actually need is the string contents. For example in foo."bar.baz", there is no need to construct an AST node for "bar.baz", but we don't know that until we bubble the value up during parsing and see that it's a node in an AttrPath.
|
inline |
Visits the expression and invokes an overloaded functor object f. If the underlying Expr has a dynamic type of ExprString the overload taking std::string_view is invoked.
Used to consistently handle simple StringExpr ${"string"} as non-dynamic attributes.