* Allow integer bindings in derivations.
This commit is contained in:
		
							parent
							
								
									d1d87badf6
								
							
						
					
					
						commit
						6e8c19714a
					
				
					 4 changed files with 25 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -127,6 +127,7 @@ Expr evalExpr2(EvalState & state, Expr e)
 | 
			
		|||
    if (atMatch(m, e) >> "Str" ||
 | 
			
		||||
        atMatch(m, e) >> "Path" ||
 | 
			
		||||
        atMatch(m, e) >> "Uri" ||
 | 
			
		||||
        atMatch(m, e) >> "Int" ||
 | 
			
		||||
        atMatch(m, e) >> "Bool" ||
 | 
			
		||||
        atMatch(m, e) >> "Function" ||
 | 
			
		||||
        atMatch(m, e) >> "Attrs" ||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -89,6 +89,13 @@ static string processBinding(EvalState & state, Expr e, StoreExpr & ne)
 | 
			
		|||
    if (atMatch(m, e) >> "Bool" >> "True") return "1";
 | 
			
		||||
    if (atMatch(m, e) >> "Bool" >> "False") return "";
 | 
			
		||||
 | 
			
		||||
    int n;
 | 
			
		||||
    if (atMatch(m, e) >> "Int" >> n) {
 | 
			
		||||
        ostringstream st;
 | 
			
		||||
        st << n;
 | 
			
		||||
        return st.str();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (atMatch(m, e) >> "Attrs" >> es) {
 | 
			
		||||
        Expr a = queryAttr(e, "type");
 | 
			
		||||
        if (a && evalString(state, a) == "derivation") {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue