public override NodeFinderResult VisitBlockExpr(AstBlockExpr block, int i = 0) { foreach (var s in block.Statements) { if (GetRelativeLocation(s.Location, i) == RelativeLocation.Same) { return(s.Accept(this, i)); } } return(new NodeFinderResult(block.Scope, expr: block)); }
public override string VisitBlockExpr(AstBlockExpr block, int indentLevel = 0) { var sb = new StringBuilder(); { int i = 0; foreach (var s in block.Statements) { if (i > 0) { sb.AppendLine(); } if (s is AstConstantDeclaration c && c.Type == CheezType.Code) { ; // local const code in macro, dont print }
public override string VisitBlockExpr(AstBlockExpr block, int indentLevel = 0) { var sb = new StringBuilder(); { int i = 0; foreach (var s in block.Statements) { if (i > 0) { sb.AppendLine(); } sb.Append(s.Accept(this)); ++i; } } return($"{{\n{sb.ToString().Indent(4)}\n}}".Indent(indentLevel)); }
public virtual ReturnType VisitBlockExpr(AstBlockExpr expr, DataType data = default) => default;
public AstWhileStmt(AstBlockExpr body, AstIdExpr label, ILocation Location = null) : base(Location: Location) { this.Body = body; this.Label = label; }