def foreach(self, varnames: T.List[str], items: mparser.BaseNode, block: mparser.CodeBlockNode) -> mparser.ForeachClauseNode:
        """Create a "foreach" loop

        :param varnames: Iterator variable names (one for list, two for dict).
        :param items: The list of dict to iterate
        :param block: Lines inside the loop
        :return: The ForeachClauseNode
        """
        varids = [self.identifier(i) for i in varnames]
        commas = [self._symbol(',') for i in range(len(varnames) - 1)]
        return mparser.ForeachClauseNode(self._symbol('foreach'), varids, commas, self._symbol(':'), items, block, self._symbol('endforeach'))
Create a "foreach" loop

        :param varnames: Iterator variable names (one for list, two for dict).
        :param items: The list of dict to iterate
        :param block: Lines inside the loop
        :return: The ForeachClauseNode
        
mesonbuild/cargo/builder.py