public Expression GetExp(Expression e) { Expression r = e.WasResolved() ? e.Resolved : e; ParensExpression p = e as ParensExpression; return((r != null) ? r : (p != null) ? GetExp(p.E) : e); }
public string GenerateConditionString(ParensExpression expression, IDictionary <string, string> rename) { var bob = new StringBuilder(); bob.Append(expression.tok.val); bob.Append(GenerateConditionString(expression.E, rename)); bob.Append(")"); return(bob.ToString()); }
public virtual void Visit(ParensExpression parenthesesExpression) { Visit(parenthesesExpression.E); }
public string GenerateString(ParensExpression expression) { return("(" + GenerateString(expression.E) + ")"); }
void ParensExpression(out Expression e, bool allowSemi, bool allowLambda) { IToken x; var args = new List<Expression>(); Expect(50); x = t; if (StartOf(7)) { Expressions(args); } Expect(51); if (args.Count == 1) { e = new ParensExpression(x, args[0]); } else { // make sure the corresponding tuple type exists var tmp = theBuiltIns.TupleType(x, args.Count, true); e = new DatatypeValue(x, BuiltIns.TupleTypeName(args.Count), BuiltIns.TupleTypeCtorName, args); } }