Exemple #1
0
        public DataType VisitList(PyList l)
        {
            var listType = new ListType();

            if (l.elts.Count == 0)
            {
                return(listType);  // list of unknown.
            }
            foreach (var exp in l.elts)
            {
                listType.add(exp.Accept(this));
                if (exp is Str sExp)
                {
                    listType.addValue(sExp.s);
                }
            }
            return(listType);
        }