* Pass the autoArgs to findAlongAttrPath so that "nix-instantiate
foo.nix -A attr --arg name value" will work if (name, value) is needed in the evaluation leading up to "attr".
This commit is contained in:
		
							parent
							
								
									b19cebc513
								
							
						
					
					
						commit
						9638f3f393
					
				
					 3 changed files with 11 additions and 7 deletions
				
			
		|  | @ -12,7 +12,8 @@ bool isAttrs(EvalState & state, Expr e, ATermMap & attrs) | |||
| } | ||||
| 
 | ||||
| 
 | ||||
| Expr findAlongAttrPath(EvalState & state, const string & attrPath, Expr e) | ||||
| Expr findAlongAttrPath(EvalState & state, const string & attrPath, | ||||
|     const ATermMap & autoArgs, Expr e) | ||||
| { | ||||
|     Strings tokens = tokenizeString(attrPath, "."); | ||||
| 
 | ||||
|  | @ -33,7 +34,7 @@ Expr findAlongAttrPath(EvalState & state, const string & attrPath, Expr e) | |||
|         if (string2Int(attr, attrIndex)) apType = apIndex; | ||||
| 
 | ||||
|         /* Evaluate the expression. */ | ||||
|         e = evalExpr(state, autoCallFunction(evalExpr(state, e), ATermMap(1))); | ||||
|         e = evalExpr(state, autoCallFunction(evalExpr(state, e), autoArgs)); | ||||
| 
 | ||||
|         /* It should evaluate to either an attribute set or an
 | ||||
|            expression, according to what is specified in the | ||||
|  |  | |||
|  | @ -7,7 +7,8 @@ | |||
| #include "eval.hh" | ||||
| 
 | ||||
| 
 | ||||
| Expr findAlongAttrPath(EvalState & state, const string & attrPath, Expr e); | ||||
| Expr findAlongAttrPath(EvalState & state, const string & attrPath, | ||||
|     const ATermMap & autoArgs, Expr e); | ||||
| 
 | ||||
| 
 | ||||
| #endif /* !__ATTR_PATH_H */ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue