// CallExpr public virtual bool Walk(CallExpr node) { return true; }
public virtual void PostWalk(CallExpr node) { }
public override void PostWalk(CallExpr node) { }
// CallExpr public override bool Walk(CallExpr node) { return false; }
private CallExpr ParseCall(Expr target) { Eat(TokenType.LeftParenthesis); List<Arg> args = new List<Arg>(); if (!MaybeEat(TokenType.RightParenthesis)) { do { args.Add(ParseArg()); } while (MaybeEat(TokenType.Comma)); Eat(TokenType.RightParenthesis); } var ret = new CallExpr(target, args.ToArray()); ret.SetLoc(_globalParent, target.StartIndex, GetEnd()); return ret; }
private Expr ParseCallExpr() { Expr ret = ParseMemberExpr(); if (ret == null) return null; var start = ret.StartIndex; while (MaybeEat(TokenType.LeftParenthesis)) { List<Arg> args = new List<Arg>(); if (!MaybeEat(TokenType.RightParenthesis)) { do { args.Add(ParseArg()); } while (MaybeEat(TokenType.Comma)); Eat(TokenType.RightParenthesis); } ret = new CallExpr(ret, args.ToArray()); ret.SetLoc(_globalParent, start, GetEnd()); } return ret; }
// CallExpr public override bool Walk(CallExpr node) { node.Parent = _currentScope; return base.Walk(node); }