Back after checking jester, I choose the macro route. Here is it (in case 
someone has the same needs than me)
    
    
    import std/[macros, os]
    
    macro includeDir*(arg:static[string]): untyped =
        
        let tree = nnkStmtList.newTree()
        let inclStmt = nnkIncludeStmt.newTree()
        
        for file in os.walkDir(arg):
            inclStmt.add(newIdentNode(file[1]))
            # echo file
        
        
        tree.add(inclStmt)
        result = tree
    
    
    Run

Reply via email to