// TupleExpression public override bool Walk(TupleExpression node) { return false; }
public override void PostWalk(TupleExpression node) { }
// TupleExpression public virtual bool Walk(TupleExpression node) { return true; }
public virtual void PostWalk(TupleExpression node) { }
public override IDbExpression Visit(EntityExpression item) { if (item.Type != null) currentEntity = mapping.Entities[item.Type]; currentAlias = item.Alias; if (visitingColumns) { if (item.Expression == null) return new ColumnExpression(currentAlias, ColumnExpression.AllColumns); return (IAliasedExpression)Visit(item.Expression); } if (inWhere) { TupleExpression ids = new TupleExpression(); if (currentEntity != null) foreach (Mapping.Attribute id in currentEntity.Ids.Values) ids.Add(new ColumnExpression(currentAlias, id.Field.ColumnName)); return ids; } return base.Visit(item); }
public virtual TupleExpression Update(TupleExpression item, IEnumerable<Evaluant.NLinq.Expressions.Expression> expressions) { if (item == expressions) return item; return new TupleExpression(expressions); }
// TupleExpression public override bool Walk(TupleExpression node) { return Location >= node.StartIndex && Location <= node.EndIndex; }
public SublistParameter(int position, TupleExpression tuple) : base("." + position, ParameterKind.Normal) { _tuple = tuple; }
public override IDbExpression Visit(TupleExpression item) { writer.Write("("); bool isFirst = true; foreach (var tupleItem in item) { if (isFirst) isFirst = false; else writer.Write(", "); Visit(tupleItem); } writer.Write(")"); return item; }
public override bool Walk(TupleExpression node) { AddTagIfNecessary(node); return(base.Walk(node)); }
public override bool Walk(TupleExpression node) { AddTagIfNecessary(node.Items?.FirstOrDefault()?.StartIndex, node.Items?.LastOrDefault()?.EndIndex); return(base.Walk(node)); }
public override bool Walk(TupleExpression node) { return(true); }
internal static string GetDefaultValue(PythonAnalyzer state, Parameter curParam, PythonAst tree) { if (curParam.DefaultValue != null) { // TODO: Support all possible expressions for default values, we should // probably have a PythonAst walker for expressions or we should add ToCodeString() // onto Python ASTs so they can round trip ConstantExpression defaultValue = curParam.DefaultValue as ConstantExpression; if (defaultValue != null) { return(defaultValue.GetConstantRepr(state.LanguageVersion)); } else { NameExpression nameExpr = curParam.DefaultValue as NameExpression; if (nameExpr != null) { return(nameExpr.Name); } else { DictionaryExpression dict = curParam.DefaultValue as DictionaryExpression; if (dict != null) { if (dict.Items.Count == 0) { return("{}"); } else { return("{...}"); } } else { ListExpression list = curParam.DefaultValue as ListExpression; if (list != null) { if (list.Items.Count == 0) { return("[]"); } else { return("[...]"); } } else { TupleExpression tuple = curParam.DefaultValue as TupleExpression; if (tuple != null) { if (tuple.Items.Count == 0) { return("()"); } else { return("(...)"); } } else { return(curParam.DefaultValue.ToCodeString(tree).Trim()); } } } } } } return(null); }