1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 23:11:16 +02:00

* Indented strings.

This commit is contained in:
Eelco Dolstra 2010-04-12 22:03:27 +00:00
parent a60317f20f
commit d4f0b0fc6c
7 changed files with 65 additions and 70 deletions

View file

@ -35,11 +35,8 @@ struct EvalState;
struct Expr
{
virtual void show(std::ostream & str) = 0;
virtual void eval(EvalState & state, Env & env, Value & v)
{
throw Error("not implemented");
}
virtual void show(std::ostream & str);
virtual void eval(EvalState & state, Env & env, Value & v);
};
std::ostream & operator << (std::ostream & str, Expr & e);
@ -62,6 +59,13 @@ struct ExprString : Expr
COMMON_METHODS
};
/* Temporary class used during parsing of indented strings. */
struct ExprIndStr : Expr
{
string s;
ExprIndStr(const string & s) : s(s) { };
};
struct ExprPath : Expr
{
string s;
@ -206,10 +210,6 @@ struct TermFun
ATerm bottomupRewrite(TermFun & f, ATerm e);
/* Create an attribute set expression from an Attrs value. */
Expr makeAttrs(const ATermMap & attrs);
/* Check whether all variables are defined in the given expression.
Throw an exception if this isn't the case. */
void checkVarDefs(const ATermMap & def, Expr e);